WordPress.org

Ready to get started?Download WordPress

Forums

Posts 2 Posts
filtering the otput of a shortcode (2 posts)

  1. Mikkel Breum
    Member
    Posted 8 months ago #

    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/

  2. Mikkel Breum
    Member
    Posted 8 months ago #

    using p2p version 1.6.2

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.