Making WordPress.org

Ticket #2249: 2249.patch

File 2249.patch, 4.6 KB (added by SergeyBiryukov, 6 years ago)
  • wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/class-customizations.php

     
    3232                add_action( 'load-edit.php', array( $this, 'bulk_reject_plugins' ) );
    3333                add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_assets' ) );
    3434                add_filter( 'admin_head-edit.php', array( $this, 'plugin_posts_list_table' ) );
    35                 add_filter( 'post_row_actions', array( $this, 'plugin_row_actions' ) );
    3635                add_action( 'edit_form_top', array( $this, 'show_permalink' ) );
    3736                add_action( 'admin_notices', array( $this, 'add_post_status_notice' ) );
    3837                add_action( 'all_admin_notices', array( $this, 'admin_notices' ) );
     
    165164        }
    166165
    167166        /**
    168          * Disables Quick Edit for plugins.
    169          *
    170          * @param array $actions An array of row action links.
    171          * @return array Filtered array of row action links.
    172          */
    173         public function plugin_row_actions( $actions ) {
    174                 global $post_type;
    175 
    176                 if ( 'plugin' === $post_type ) {
    177                         unset( $actions['inline hide-if-no-js'] );
    178                 }
    179 
    180                 return $actions;
    181         }
    182 
    183         /**
    184167         * Rejects plugins in bulk.
    185168         */
    186169        public function bulk_reject_plugins() {
  • wordpress.org/public_html/wp-content/plugins/plugin-directory/admin/list-table/class-plugin-posts.php

     
    287287        }
    288288
    289289        /**
    290          * Remove the Quick/Bulk Edit hidden row.
     290         * Outputs the hidden row displayed when inline editing.
     291         *
     292         * @global string $mode List table view mode.
    291293         */
    292294        public function inline_edit() {
     295                global $mode;
     296
     297                $screen = $this->screen;
     298
     299                $taxonomy_names = get_object_taxonomies( $screen->post_type );
     300                $hierarchical_taxonomies = array();
     301
     302                foreach ( $taxonomy_names as $taxonomy_name ) {
     303
     304                        $taxonomy = get_taxonomy( $taxonomy_name );
     305
     306                        if ( ! $taxonomy->show_in_quick_edit ) {
     307                                continue;
     308                        }
     309
     310                        if ( $taxonomy->hierarchical ) {
     311                                $hierarchical_taxonomies[] = $taxonomy;
     312                        }
     313                }
     314
     315                $m = ( isset( $mode ) && 'excerpt' === $mode ) ? 'excerpt' : 'list';
     316        ?>
     317
     318        <form method="get"><table style="display: none"><tbody id="inlineedit">
     319
     320                <tr id="inline-edit"
     321                        class="inline-edit-row inline-edit-row-post inline-edit-<?php echo $screen->post_type; ?> quick-edit-row quick-edit-row-post"
     322                        style="display: none"><td colspan="<?php echo $this->get_column_count(); ?>" class="colspanchange">
     323
     324                <fieldset class="inline-edit-col-left">
     325                        <legend class="inline-edit-legend"><?php _e( 'Quick Edit', 'wporg-plugins' ); ?></legend>
     326                        <div class="inline-edit-col">
     327
     328                        <label>
     329                                <span class="title"><?php _e( 'Slug', 'wporg-plugins' ); ?></span>
     330                                <span class="input-text-wrap"><input type="text" name="post_name" value="" /></span>
     331                        </label>
     332
     333                </div></fieldset>
     334
     335        <?php if ( count( $hierarchical_taxonomies ) ) : ?>
     336
     337                <fieldset class="inline-edit-col-center inline-edit-categories"><div class="inline-edit-col">
     338
     339        <?php foreach ( $hierarchical_taxonomies as $taxonomy ) : ?>
     340
     341                        <span class="title inline-edit-categories-label"><?php echo esc_html( $taxonomy->labels->name ) ?></span>
     342                        <input type="hidden" name="tax_input[<?php echo esc_attr( $taxonomy->name ); ?>][]" value="0" />
     343                        <ul class="cat-checklist <?php echo esc_attr( $taxonomy->name )?>-checklist">
     344                                <?php wp_terms_checklist( null, array( 'taxonomy' => $taxonomy->name ) ) ?>
     345                        </ul>
     346
     347        <?php endforeach; // $hierarchical_taxonomies as $taxonomy ?>
     348
     349                </div></fieldset>
     350
     351        <?php endif; // count( $hierarchical_taxonomies ) ?>
     352
     353                <p class="submit inline-edit-save">
     354                        <button type="button" class="button cancel alignleft"><?php _e( 'Cancel', 'wporg-plugins' ); ?></button>
     355                        <?php wp_nonce_field( 'inlineeditnonce', '_inline_edit', false ); ?>
     356                        <button type="button" class="button button-primary save alignright"><?php _e( 'Update', 'wporg-plugins' ); ?></button>
     357                        <span class="spinner"></span>
     358                        <input type="hidden" name="post_view" value="<?php echo esc_attr( $m ); ?>" />
     359                        <input type="hidden" name="screen" value="<?php echo esc_attr( $screen->id ); ?>" />
     360                        <span class="error" style="display:none"></span>
     361                        <br class="clear" />
     362                </p>
     363                </td></tr>
     364
     365                </tbody></table></form>
     366<?php
    293367        }
    294368
    295369        /**