Support » Plugin: Yet Another Related Posts Plugin (YARPP) » Excluding post types using yarpp_map_post_types

Viewing 3 replies - 1 through 3 (of 3 total)
  • have you found an answer to this yet chadrew? i’m interested in how i can assign my own custom post types.

    Hi all — thanks for your interest in the yarpp_map_post_types filter!

    First things first: yarpp_map_post_types is only called for “automatic display” YARPP instances, thereby allowing you to override the settings in “the pool” options. If you are calling YARPP directly via PHP, you can manually specify post types. Information on this is in the “custom displays” section of the readme.

    Second things second: the structure of yarpp_map_post_types is that you must return a nonempty array with the post type names that should be considered. Within your yarpp_map_post_types function, you can consider whatever information from the context. In particular, at this point in execution the active post_ID has not been hijacked yet by YARPP, so you can do things like check the global $post object to see what the reference post is, and change what post types should be considered based on that.

    I hope that helps. Is there anything in particular you all are looking to accomplish?

    Can you please give an example of how to use the filter?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Excluding post types using yarpp_map_post_types’ is closed to new replies.