Published in: PHP
/** * Replace all tags matching a regexp with value of callback function * (passes grouped subpatterns to callback as params) */ function my_wp_plugin_tag_action($content,$tag,$function,$args = FALSE) { // match all regular expressions // filter duplicates // loop through foreach ($matches as $idx => $match) { //build arg array //call function, adding function output and full tag text to replacement array $tag_results[] = my_wp_plugin_buffer_func($function,$match); $found_tags[] = $full_tag; } // replace all tags with corresponding text } return $content; }
Comments
Subscribe to comments
You need to login to post a comment.

relies on http://snipplr.com/view/3521/return-output-of-function/
http://snipplr.com/view/3521/return-output-of-function/
http://snipplr.com/view/3521/return-output-of-function/
grrr...how to make a link?!?