custom field - Need to call this php function inside a modal window from text widget

admin2025-06-03  5

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
Add a comment  | 

1 Answer 1

Reset to default 0

There 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;   
}

?>
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1748928554a314898.html

最新回复(0)