Making WordPress.org


Ignore:
Timestamp:
12/19/2017 04:22:37 PM (7 years ago)
Author:
obenland
Message:

PLugins: Clean up formatting with phpcbf

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php

    r5797 r6287  
    11<?php
    22namespace WordPressdotorg\Plugin_Directory\Admin\List_Table;
     3
    34use \WordPressdotorg\Plugin_Directory\Tools;
    45use \WordPressdotorg\Plugin_Directory\Template;
     
    2122
    2223        $post_type = $this->screen->post_type;
    23         $per_page = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
     24        $per_page  = $this->get_items_per_page( 'edit_' . $post_type . '_per_page' );
    2425
    2526        /** This filter is documented in wp-admin/includes/post.php */
     
    3334            $post_counts = (array) wp_count_posts( $post_type, 'readable' );
    3435
    35             if ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'] , $avail_post_stati ) ) {
     36            if ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'], $avail_post_stati ) ) {
    3637                $total_items = $post_counts[ $_REQUEST['post_status'] ];
    3738            } elseif ( isset( $_REQUEST['show_sticky'] ) && $_REQUEST['show_sticky'] ) {
     
    6061        $this->set_pagination_args( array(
    6162            'total_items' => $total_items,
    62             'per_page' => $per_page
     63            'per_page'    => $per_page,
    6364        ) );
    6465    }
     
    6970     */
    7071    protected function get_bulk_actions() {
    71         $actions = array();
     72        $actions       = array();
    7273        $post_type_obj = get_post_type_object( $this->screen->post_type );
    7374
     
    9293        $post_type     = $this->screen->post_type;
    9394        $posts_columns = array(
    94             'cb'        => '<input type="checkbox" />',
     95            'cb'     => '<input type="checkbox" />',
    9596            /* translators: manage posts column name */
    96             'title'     => _x( 'Title', 'column name', 'wporg-plugins' ),
    97             'author'    => __( 'Submitter', 'wporg-plugins' ),
     97            'title'  => _x( 'Title', 'column name', 'wporg-plugins' ),
     98            'author' => __( 'Submitter', 'wporg-plugins' ),
    9899        );
    99100
     
    104105
    105106        foreach ( $taxonomies as $taxonomy ) {
    106             $column_key = 'taxonomy-' . $taxonomy;
     107            $column_key                   = 'taxonomy-' . $taxonomy;
    107108            $posts_columns[ $column_key ] = get_taxonomy( $taxonomy )->labels->name;
    108109        }
    109110
    110111        $posts_columns['comments'] = '<span class="vers comment-grey-bubble" title="' . esc_attr__( 'Internal Notes', 'wporg-plugins' ) . '"><span class="screen-reader-text">' . __( 'Internal Notes', 'wporg-plugins' ) . '</span></span>';
    111         $posts_columns['date'] = __( 'Date', 'wporg-plugins' );
     112        $posts_columns['date']     = __( 'Date', 'wporg-plugins' );
    112113
    113114        /**
     
    133134     *
    134135     * @param int|\WP_Post $post
    135      * @param int         $level
     136     * @param int          $level
    136137     */
    137138    public function single_row( $post, $level = 0 ) {
    138139        $global_post = get_post();
    139140
    140         $post = get_post( $post );
     141        $post                = get_post( $post );
    141142        $this->current_level = $level;
    142143
     
    155156
    156157        if ( $post->post_parent ) {
    157             $count = count( get_post_ancestors( $post->ID ) );
     158            $count     = count( get_post_ancestors( $post->ID ) );
    158159            $classes[] = 'level-' . $count;
    159160        } else {
     
    184185
    185186        $post_type_object = get_post_type_object( $post->post_type );
    186         $can_edit_post = current_user_can( 'edit_post', $post->ID );
    187         $actions = array();
    188         $title = _draft_or_post_title();
     187        $can_edit_post    = current_user_can( 'edit_post', $post->ID );
     188        $actions          = array();
     189        $title            = _draft_or_post_title();
    189190
    190191        if ( $can_edit_post && 'trash' != $post->post_status ) {
     
    260261        $screen = $this->screen;
    261262
    262         $taxonomy_names = get_object_taxonomies( $screen->post_type );
     263        $taxonomy_names          = get_object_taxonomies( $screen->post_type );
    263264        $hierarchical_taxonomies = array();
    264265
    265266        foreach ( $taxonomy_names as $taxonomy_name ) {
    266 
    267267            $taxonomy = get_taxonomy( $taxonomy_name );
    268268
     
    302302    <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
    303303
    304             <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ) ?></span>
     304            <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ); ?></span>
    305305            <input type="hidden" name="tax_input[<?php echo esc_attr( $taxonomy->name ); ?>][]" value="0" />
    306             <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist">
    307                 <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?>
     306            <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name ); ?>-checklist">
     307                <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ); ?>
    308308            </ul>
    309309
     
    355355        $mine            = '';
    356356
    357         $plugins = Tools::get_users_write_access_plugins( $current_user_id );
    358         $plugins = array_map( 'sanitize_title_for_query', $plugins );
    359         $exclude_states   = get_post_stati( array(
     357        $plugins        = Tools::get_users_write_access_plugins( $current_user_id );
     358        $plugins        = array_map( 'sanitize_title_for_query', $plugins );
     359        $exclude_states = get_post_stati( array(
    360360            'show_in_admin_all_list' => false,
    361361        ) );
     
    378378
    379379        if ( ! empty( $plugins ) ) {
    380             $user_post_count_query = str_replace('AND post_author = %d', "AND ( post_author = %d OR post_name IN ( '" . implode( "','", $plugins ) . "' ) )", $user_post_count_query );
     380            $user_post_count_query = str_replace( 'AND post_author = %d', "AND ( post_author = %d OR post_name IN ( '" . implode( "','", $plugins ) . "' ) )", $user_post_count_query );
    381381        }
    382382
     
    395395            $mine_args = array(
    396396                'post_type' => $post_type,
    397                 'author'    => $current_user_id
     397                'author'    => $current_user_id,
    398398            );
    399399
     
    410410
    411411            if ( ! current_user_can( 'plugin_review' ) ) {
    412                 $status_links['mine'] = $this->get_edit_link( $mine_args, $mine_inner_html, 'current' );;
     412                $status_links['mine'] = $this->get_edit_link( $mine_args, $mine_inner_html, 'current' );
     413
    413414                return $status_links;
    414415            } else {
     
    417418
    418419            $all_args['all_posts'] = 1;
    419             $class = '';
     420            $class                 = '';
    420421        }
    421422
     
    440441        }
    441442
    442         foreach ( get_post_stati(array('show_in_admin_status_list' => true), 'objects') as $status ) {
     443        foreach ( get_post_stati( array( 'show_in_admin_status_list' => true ), 'objects' ) as $status ) {
    443444            $class = '';
    444445
     
    453454            }
    454455
    455             if ( isset($_REQUEST['post_status']) && $status_name === $_REQUEST['post_status'] ) {
     456            if ( isset( $_REQUEST['post_status'] ) && $status_name === $_REQUEST['post_status'] ) {
    456457                $class = 'current';
    457458            }
     
    459460            $status_args = array(
    460461                'post_status' => $status_name,
    461                 'post_type' => $post_type,
     462                'post_type'   => $post_type,
    462463            );
    463464
     
    474475
    475476            $sticky_args = array(
    476                 'post_type' => $post_type,
    477                 'show_sticky' => 1
     477                'post_type'   => $post_type,
     478                'show_sticky' => 1,
    478479            );
    479480
     
    490491
    491492            $sticky_link = array(
    492                 'sticky' => $this->get_edit_link( $sticky_args, $sticky_inner_html, $class )
     493                'sticky' => $this->get_edit_link( $sticky_args, $sticky_inner_html, $class ),
    493494            );
    494495
    495496            // Sticky comes after Publish, or if not listed, after All.
    496             $split = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ) );
     497            $split        = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ) );
    497498            $status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) );
    498499        }
Note: See TracChangeset for help on using the changeset viewer.