get_views_links example

global $tabs$tab;

        $display_tabs = array();
        foreach ( (array) $tabs as $action => $text ) {
            $display_tabs[ 'theme-install-' . $action ] = array(
                'url'     => self_admin_url( 'theme-install.php?tab=' . $action ),
                'label'   => $text,
                'current' => $action === $tab,
            );
        }

        return $this->get_views_links( $display_tabs );
    }

    /** * Displays the theme install table. * * Overrides the parent display() method to provide a different container. * * @since 3.1.0 */
    public function display() {
        wp_nonce_field( 'fetch-list-' . get_class( $this ), '_ajax_fetch_list_nonce' );
        


            if ( 'search' !== $type ) {
                $status_links[ $type ] = array(
                    'url'     => esc_url( add_query_arg( 'theme_status', $type$url ) ),
                    'label'   => sprintf( $textnumber_format_i18n( $count ) ),
                    'current' => $type === $status,
                );
            }
        }

        return $this->get_views_links( $status_links );
    }

    /** * @global string $status * * @return array */
    protected function get_bulk_actions() {
        global $status;

        $actions = array();
        


            $status_link = add_query_arg( 'filter-status', $status$admin_url );

            $views[ $status ] = array(
                'url'     => esc_url( $status_link ),
                'label'   => $status_label,
                'current' => $status === $current_status,
            );
        }

        return $this->get_views_links( $views );
    }

    /** * Gets bulk actions. * * @since 4.9.6 * * @return array Array of bulk action labels keyed by their action. */
    protected function get_bulk_actions() {
        return array(
            
$full_url = 'all' === $status ? $url : add_query_arg( 'status', $status$url );

                $view_links[ $status ] = array(
                    'url'     => esc_url( $full_url ),
                    'label'   => $label,
                    'current' => $requested_status === $status || ( '' === $requested_status && 'all' === $status ),
                );
            }
        }

        return $this->get_views_links( $view_links );
    }

    /** * @return array */
    protected function get_bulk_actions() {
        $actions = array();
        if ( current_user_can( 'delete_sites' ) ) {
            $actions['delete'] = __( 'Delete' );
        }
        $actions['spam']    = _x( 'Mark as spam', 'site' );
        
/* translators: Number of users. */
                _n(
                    'Super Admin <span class="count">(%s)</span>',
                    'Super Admins <span class="count">(%s)</span>',
                    $total_admins
                ),
                number_format_i18n( $total_admins )
            ),
            'current' => 'super' === $role,
        );

        return $this->get_views_links( $role_links );
    }

    /** * @global string $mode List table view mode. * * @param string $which */
    protected function pagination( $which ) {
        global $mode;

        parent::pagination( $which );

        
$display_tabs = array();
        foreach ( (array) $tabs as $action => $text ) {
            $display_tabs[ 'plugin-install-' . $action ] = array(
                'url'     => self_admin_url( 'plugin-install.php?tab=' . $action ),
                'label'   => $text,
                'current' => $action === $tab,
            );
        }
        // No longer a real tab.         unset( $display_tabs['plugin-install-upload'] );

        return $this->get_views_links( $display_tabs );
    }

    /** * Overrides parent views so we can use the filter bar display. */
    public function views() {
        $views = $this->get_views();

        /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
        $views = apply_filters( "views_{$this->screen->id}", $views );

        
'url'     => esc_url( add_query_arg( $sticky_args, 'edit.php' ) ),
                    'label'   => $sticky_inner_html,
                    'current' => ! empty( $_REQUEST['show_sticky'] ),
                ),
            );

            // Sticky comes after Publish, or if not listed, after All.             $split        = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' )array_keys( $status_links ), true );
            $status_links = array_merge( array_slice( $status_links, 0, $split )$sticky_linkarray_slice( $status_links$split ) );
        }

        return $this->get_views_links( $status_links );
    }

    /** * @return array */
    protected function get_bulk_actions() {
        $actions       = array();
        $post_type_obj = get_post_type_object( $this->screen->post_type );

        if ( current_user_can( $post_type_obj->cap->edit_posts ) ) {
            if ( $this->is_trash ) {
                


            if ( 'search' !== $type ) {
                $status_links[ $type ] = array(
                    'url'     => add_query_arg( 'plugin_status', $type, 'plugins.php' ),
                    'label'   => sprintf( $textnumber_format_i18n( $count ) ),
                    'current' => $type === $status,
                );
            }
        }

        return $this->get_views_links( $status_links );
    }

    /** * @global string $status * @return array */
    protected function get_bulk_actions() {
        global $status;

        $actions = array();

        


        /** * Filters the comment status links. * * @since 2.5.0 * @since 5.1.0 The 'Mine' link was added. * * @param string[] $status_links An associative array of fully-formed comment status links. Includes 'All', 'Mine', * 'Pending', 'Approved', 'Spam', and 'Trash'. */
        return apply_filters( 'comment_status_links', $this->get_views_links( $status_links ) );
    }

    /** * @global string $comment_status * * @return array */
    protected function get_bulk_actions() {
        global $comment_status;

        $actions = array();

        
$name,
                number_format_i18n( $avail_roles['none'] )
            );

            $role_links['none'] = array(
                'url'     => esc_url( add_query_arg( 'role', 'none', $url ) ),
                'label'   => $name,
                'current' => 'none' === $role,
            );
        }

        return $this->get_views_links( $role_links );
    }

    /** * Retrieves an associative array of bulk actions available on this table. * * @since 3.1.0 * * @return array Array of bulk action labels keyed by their action. */
    protected function get_bulk_actions() {
        $actions = array();

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