gppa-postmeta-property-value-limit.php

Code

Filename: gppa-postmeta-property-value-limit.php

<?php
/**
 * Note: See https://gravitywiz.com/documentation/how-do-i-install-a-snippet/ for details on how to install snippets.
 */
add_filter( 'gppa_object_type_col_rows_query', function( $sql, $col, $table, $object_type ) {
	// Change this to the maximum number of post meta results
	$meta_limit = 1500;

	global $wpdb;
	if ( $wpdb->postmeta === $table ) {
		$sql = str_replace( '1000', $meta_limit, $sql );
	}
	return $sql;
}, 10, 4 );

Leave a Reply

Your email address will not be published. Required fields are marked *

  • Trouble installing this snippet? See our troubleshooting tips.
  • Need to include code? Create a gist and link to it in your comment.
  • Reporting a bug? Provide a URL where this issue can be recreated.

By commenting, I understand that I may receive emails related to Gravity Wiz and can unsubscribe at any time.