• I’m trying to filter the output using a filter and a shortcode. I can’t make the filter have any effect on the output, so I tried the following just to see if the filter function runs. It doesn’t..

    In a page I have:

    [p2p_connected type=posts_to_pages]

    In an activated plugin I have the following:

    function mytest( $args, $ctype, $post_id ) {
         die('stop');
    }
    add_filter( 'p2p_connectable_args', 'mytest', 10, 3 );

    When I visit the page with the shortcode, the filter is not triggered. The connected posts are output, but the filter that should kill the process is not run.

    if I inspect $GLOBALS[‘wp_filter’] I can see that ‘mytest’ is registered for ‘p2p_connectable_args’..

    Should this have worked under ‘normal curcamstances’ or am I using p2p wrong? If it should have worked like this, I’ll continue my troubleshooting, advice on what to look for appreciated 🙂

    http://wordpress.org/plugins/posts-to-posts/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘filtering the otput of a shortcode’ is closed to new replies.