How to return content of a shortcode inside a function?
-
Hi,
I have created a short-code
function show_current_year() { return '<span class="current-year">' . date('Y') . '</span>'; } add_shortcode( 'year', 'show_current_year' );Now it’s working fine.
Now I want to hook this shortcode [year] into my footer.php along with another function
function mt_text() { /* Retrieve the text from the database */ $some_text = get_option( 'theme_text', $default ); /* Filter and return the text */ echo apply_filters( 'get_text', '<div id="footer-info-test">' . $some_text . '</div>' ); } add_filter ('wp_footer', 'my_text');I want to show both the shortcode value (which is 2015) as well as the content that is being retrieved from the database.
Hope I made sense. Any suggestion or correction will be appreciated.
Thanks for your time
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘How to return content of a shortcode inside a function?’ is closed to new replies.