Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to enable YARPP (Yet Another Related Posts Plugin) support for Toolset's Custom Post Types.
* Enable YARPP support for Toolset's Custom Post Types
* @param $data array The CPT args.
* @param $post_type array The registered CPT list.
* @return array
function yarpp_support_func($data, $post_type) {
// Checking if our custom post type exists.
if(in_array($post_type, array('fotografia'))) {
// Adding the YARPP support.
$data['yarpp_support'] = true;
// Returning data set.
return $data;
// Adding Wordpress filter hook.
add_filter('wpcf_type', 'yarpp_support_func', 10, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment