Skip to content

Commit

Permalink
PHPCS fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgeatorres committed Feb 17, 2024
1 parent 295b6f9 commit ebb80ce
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
Expand Up @@ -92,7 +92,6 @@ private function render_custom_meta_form( array $metadata_to_list, \WC_Order $or
* Compute keys to display in autofill when adding new meta key entry in custom meta box.
* Currently, returns empty keys, will be implemented after caching is merged.
*
* @param array|null $keys Keys to display in autofill.
* @param \WP_Post|\WC_Order $order Order object.
*
* @return array|mixed Array of keys to display in autofill.
Expand All @@ -118,7 +117,16 @@ public function order_meta_keys_autofill( $order ) {

if ( null === $keys ) {
$meta_data_store = wc_get_container()->get( OrdersTableDataStoreMeta::class );
$keys = $meta_data_store->get_meta_keys( apply_filters( 'postmeta_form_limit', 30 ) );

/**
* Compatibility filter for 'postmeta_form_limit', which filters the number of custom fields to retrieve
* for the drop-down in the Custom Fields meta box.
*
* @since 8.7.0
*
* @param int $limit Number of custom fields to retrieve. Default 30.
*/
$keys = $meta_data_store->get_meta_keys( apply_filters( 'postmeta_form_limit', 30 ) );
}

if ( $keys ) {
Expand Down
Expand Up @@ -260,7 +260,7 @@ public function get_meta_keys( $limit = 100, $order = 'ASC', $include_private =
$query .= $wpdb->prepare( 'LIMIT %d ', $limit );
}

return $wpdb->get_col( $query );
return $wpdb->get_col( $query ); // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared - $query is prepared.
}

}

0 comments on commit ebb80ce

Please sign in to comment.