Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator bcworkz

    (@bcworkz)

    There’s nothing to be accomplished by running from install.php. The filter callback needs to be added for any posts list request, but it doesn’t hurt to add it for any request as part of a plugin or theme. It will fail in install.php because that page is not loaded for post list requests.

    I don’t know what && (int) $result < 1 is supposed to accomplish in the linked code. After removing it the code works fine for me.

    Thread Starter Settler11

    (@settler11)

    I don’t know what && (int) $result < 1 is supposed to accomplish in the linked code. After removing it the code works fine for me.

    No idea either. So I removed the whole ‘if’ line and now it works.

    function my_edit_per_page( $result, $option, $user ) {
      $status = filter_input( INPUT_GET, 'post_status', FILTER_SANITIZE_STRING );
      return 19; // or whatever you want
    }
    add_filter( 'get_user_option_edit_post_per_page', 'my_edit_per_page', 10, 3 );  // for posts
    add_filter( 'get_user_option_edit_page_per_page', 'my_edit_per_page', 10, 3 );  // for posts
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘4.7 get_user_option_edit_page_per_page changed?’ is closed to new replies.