Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- add_filter( 'get_user_metadata', function( $meta_value, $user_id, $meta_key ) {
- preg_match( '/^edit_(.*)_per_page$/', $meta_key, $matches );
- if ( is_array( $matches ) && ! empty( $matches[1] ) ) {
- global $wpdb;
- $per_page = $wpdb->get_var( $wpdb->prepare( "SELECT meta_value FROM $wpdb->usermeta WHERE meta_key = %s AND user_id = %d", $meta_key, $user_id ) );
- if ( ! $per_page ) {
- $meta_value = 100;
- }
- }
- return $meta_value;
- }, 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement