Developers: Filters

Follow

You may add the following filters in your theme’s functions.php file to customize YARPP further.

Customize the priority order for Automatic Placement (the_content):

add_filter( 'yarpp_content_priority', 1 );

Default: 1200

Customize the priority order for RSS Feed Placement (the_content_feed):

add_filter( 'yarpp_feed_priority', 1 );

Default: 600

Customize the priority order for RSS Feed Excerpt Placement (the_excerpt_rss):

add_filter( 'yarpp_excerpt_rss_priority', 1 );

Default: 600

To disable automatic creation of YARPP thumbnail sizes:

add_filter( 'yarpp_add_image_size', '__return_false' );

Disable YARPP Automatic Display in specific categories:

function yarpp_disable_categories() {
  if ( in_category( array( 'my_category_1_slug', 'my_category_2_slug' ) ) ) {
    return true;
  }
}
add_filter( 'noyarpp', 'yarpp_disable_categories' );

Dequeue YARPP's CSS Style Sheet (related.css):

add_filter( 'yarpp_enqueue_related_style', '__return_false' );

Disable the request-for-feedback modal when deactivating the plugin:

add_action(
  'admin_init',
  function(){
    remove_all_filters( 'shareaholic_deactivate_feedback_form_plugins' );
  },
  11
);

Disable YARPP Review Notice:

function yarpp_disable_review_notice() {
  remove_action( 'admin_notices', array('YARPP_Admin', 'display_review_notice' ) );
}
add_action( 'admin_init', 'yarpp_disable_review_notice', 11 );

To change the arguments of all YARPP shortcodes by default:

add_filter( 'shortcode_atts_yarpp', function( $atts ) {
  $atts['post_type']='page';
  return $atts;
});