Need to call this php function inside a modal window from sidebar text widget
<?php echo get_post_meta( $post->ID, 'link', true ); ?>
Need to call this php function inside a modal window from sidebar text widget
<?php echo get_post_meta( $post->ID, 'link', true ); ?>
Share
Improve this question
edited Feb 8, 2019 at 23:59
fuxia♦
107k39 gold badges255 silver badges461 bronze badges
asked Aug 20, 2013 at 16:57
Praveen MPraveen M
33 bronze badges
1 Answer
Reset to default 0There are several examples on the net, however I use this:
<?php
//functions.php
add_filter( 'widget_text', 'php_parser', 100 );
function php_parser( $html ){
if( strpos( $html, "<"."?php" ) !== false ){
ob_start();
eval( "?".">".$html );
$html = ob_get_contents();
ob_end_clean();
}
return $html;
}
?>