Ready to get started?Download WordPress


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

  1. Mikkel Breum
    Posted 9 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 ) {
    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 :)


  2. Mikkel Breum
    Posted 9 months ago #

    using p2p version 1.6.2


You must log in to post.

About this Plugin

About this Topic


No tags yet.