Rename the prefix for per page options

This commit is contained in:
Shiva Poudel 2018-02-23 10:03:56 +05:45
parent c2c97855be
commit e4bcc1d285
6 changed files with 6 additions and 6 deletions

View File

@ -186,7 +186,7 @@ class WC_Admin_API_Keys_Table_List extends WP_List_Table {
public function prepare_items() {
global $wpdb;
$per_page = $this->get_items_per_page( 'wc_keys_per_page' );
$per_page = $this->get_items_per_page( 'woocommerce_keys_per_page' );
$current_page = $this->get_pagenum();
if ( 1 < $current_page ) {

View File

@ -59,7 +59,7 @@ class WC_Admin_API_Keys {
// Add screen option.
add_screen_option( 'per_page', array(
'default' => 10,
'option' => 'wc_api_keys_per_page',
'option' => 'woocommerce_keys_per_page',
) );
}
}

View File

@ -227,7 +227,7 @@ class WC_Admin_Menus {
* @param int $value The number of rows to use.
*/
public function set_screen_option( $status, $option, $value ) {
if ( in_array( $option, array( 'wc_keys_per_page', 'wc_webhooks_per_page' ), true ) ) {
if ( in_array( $option, array( 'woocommerce_keys_per_page', 'woocommerce_webhooks_per_page' ), true ) ) {
return $value;
}

View File

@ -247,7 +247,7 @@ class WC_Admin_Webhooks_Table_List extends WP_List_Table {
* Prepare table list items.
*/
public function prepare_items() {
$per_page = $this->get_items_per_page( 'wc_webhooks_per_page' );
$per_page = $this->get_items_per_page( 'woocommerce_webhooks_per_page' );
$current_page = $this->get_pagenum();
// Query args.

View File

@ -278,7 +278,7 @@ class WC_Admin_Webhooks {
// Add screen option.
add_screen_option( 'per_page', array(
'default' => 10,
'option' => 'wc_webhooks_per_page',
'option' => 'woocommerce_webhooks_per_page',
) );
}
}

View File

@ -58,7 +58,7 @@ if ( defined( 'WC_REMOVE_ALL_DATA' ) && true === WC_REMOVE_ALL_DATA ) {
$wpdb->query( "DROP TABLE IF EXISTS {$wpdb->prefix}woocommerce_order_itemmeta" );
// Delete user meta data.
foreach ( array( 'wc_keys_per_page', 'wc_webhooks_per_page' ) as $meta_key ) {
foreach ( array( 'woocommerce_keys_per_page', 'woocommerce_webhooks_per_page' ) as $meta_key ) {
delete_metadata( 'user', 0, $meta_key, '', true );
}