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?