wp_edit_posts_query example

public function prepare_items() {
        global $mode$avail_post_stati$wp_query$per_page;

        if ( ! empty( $_REQUEST['mode'] ) ) {
            $mode = 'excerpt' === $_REQUEST['mode'] ? 'excerpt' : 'list';
            set_user_setting( 'posts_list_mode', $mode );
        } else {
            $mode = get_user_setting( 'posts_list_mode', 'list' );
        }

        // Is going to call wp().         $avail_post_stati = wp_edit_posts_query();

        $this->set_hierarchical_display(
            is_post_type_hierarchical( $this->screen->post_type )
            && 'menu_order title' === $wp_query->query['orderby']
        );

        $post_type = $this->screen->post_type;
        $per_page  = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );

        /** This filter is documented in wp-admin/includes/post.php */
        $per_page = apply_filters( 'edit_posts_per_page', $per_page$post_type );

        
Home | Imprint | This part of the site doesn't use cookies.