Skip to content

Instantly share code, notes, and snippets.

@code-flow
Created December 17, 2018 13:54
Show Gist options
  • Save code-flow/4e080a224b87d49bc5d7ab60857338d7 to your computer and use it in GitHub Desktop.
Save code-flow/4e080a224b87d49bc5d7ab60857338d7 to your computer and use it in GitHub Desktop.
<?php
/*
Plugin Name: snip - WooCommerce review args
Plugin URI: https://rich-snippets.io/woocommerce-review-args-hook/
Description: Changes arguments on WooCommerce reviews
Version: 0.1.0
License: License: GPLv2 or later
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
} // Exit if accessed directly
add_filter( 'wpbuddy/rich_snippets/woocommerce/reviews/args', function ( $args ) {
/**
* To load 20 instead of 5 reviews for WooCommerce
*/
$args['number'] = 20;
return $args;
} );
@code-flow
Copy link
Author

code-flow commented Dec 17, 2018

This WordPress plugin changes the number of WooCommerce reviews loaded for SNIP - The Structured Data and Rich Snippets WordPress Plugin. Learn more about this plugin and how you can add more arguments to change how the loading of reviews behaves: https://rich-snippets.io/woocommerce-review-args-hook/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment