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

  1. Mikkel Breum
    Posted 2 years 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 2 years ago #

    using p2p version 1.6.2

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Posts 2 Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.