Pass POST data to the_content filter function?
-
add_filter( 'the_content', 'my_function' ); function my_function( $post_entry ){ // check if my POST vars are set // retrieve POST variables // more code to modify $post_entry return $post_entry } function my_shortcode(){ return "/ form code /"; } add_shortcode( 'the_shortcode', 'my_shortcode' );
As you can see I’m “catching” POST variables in the_content filter. It would obviously be better to catch them in an action hook but I must use the_content filter as I modify it with the POST variables. Any ideas how to catch POST variables somewhere else and then pass them to my_function (the_content filter callback) ?
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Pass POST data to the_content filter function?’ is closed to new replies.