Make WordPress Core

Ticket #26209: 26209.1.diff

File 26209.1.diff, 4.6 KB (added by kpdesign, 12 years ago)

Third pass

  • src/wp-admin/includes/class-wp-terms-list-table.php

     
    4646                $tags_per_page = $this->get_items_per_page( 'edit_' . $this->screen->taxonomy . '_per_page' );
    4747
    4848                if ( 'post_tag' == $this->screen->taxonomy ) {
     49                        /**
     50                         * Filter the number of tags displayed per page for the Tags list table.
     51                         *
     52                         * @since 2.8.0
     53                         *
     54                         * @param int $tags_per_page Number of tags to be displayed. Default 20.
     55                         */
    4956                        $tags_per_page = apply_filters( 'edit_tags_per_page', $tags_per_page );
    50                         $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page ); // Old filter
     57                        /**
     58                         * Filter the number of tags displayed per page for the Tags list table.
     59                         *
     60                         * @since 2.7.0
     61                         * @deprecated 2.8.0 Use edit_tags_per_page instead.
     62                         *
     63                         * @param int $tags_per_page Number of tags to be displayed. Default 20.
     64                         */
     65                        $tags_per_page = apply_filters( 'tagsperpage', $tags_per_page );
    5166                } elseif ( 'category' == $this->screen->taxonomy ) {
    52                         $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page ); // Old filter
     67                        /**
     68                         * Filter the number of tags displayed per page for the Categories list table.
     69                         *
     70                         * @since 2.8.0
     71                         *
     72                         * @param int $tags_per_page Number of categories to be displayed. Default 20.
     73                         */
     74                        $tags_per_page = apply_filters( 'edit_categories_per_page', $tags_per_page );
    5375                }
    5476
    5577                $search = !empty( $_REQUEST['s'] ) ? trim( wp_unslash( $_REQUEST['s'] ) ) : '';
     
    246268                $default_term = get_option( 'default_' . $taxonomy );
    247269
    248270                $pad = str_repeat( '— ', max( 0, $this->level ) );
     271                /**
     272                 * Filter the display of the term name.
     273                 *
     274                 * @since 2.5.0
     275                 *
     276                 * @param string $pad_tag_name Name of the term padded.
     277                 * @param obj    $tag          Term object.
     278                 */
    249279                $name = apply_filters( 'term_name', $pad . ' ' . $tag->name, $tag );
    250280                $qe_data = get_term( $tag->term_id, $taxonomy, OBJECT, 'edit' );
    251281                $edit_link = esc_url( get_edit_term_link( $tag->term_id, $taxonomy, $this->screen->post_type ) );
     
    262292                if ( $tax->public )
    263293                        $actions['view'] = '<a href="' . get_term_link( $tag ) . '">' . __( 'View' ) . '</a>';
    264294
     295                /**
     296                 * Filter the action links displayed for each tag in the Tags list table.
     297                 *
     298                 * @since 2.8.0
     299                 * @deprecated 3.0.0 Use {$taxonomy}_row_actions instead.
     300                 *
     301                 * @param array $actions An array of action links to be displayed. Default
     302                 *                       'Edit', 'Quick Edit', 'Delete', 'View'.
     303                 * @param obj   $tag     Term object.
     304                 */
    265305                $actions = apply_filters( 'tag_row_actions', $actions, $tag );
     306                /**
     307                 * Filter the action links displayed for each term in the terms list table.
     308                 *
     309                 * The dynamic portion of the hook name, $taxonomy, refers to the taxonomy slug.
     310                 *
     311                 * @since 3.0.0
     312                 *
     313                 * @param array $actions An array of action links to be displayed. Default
     314                 *                       'Edit', 'Quick Edit', 'Delete', 'View'.
     315                 * @param obj   $tag     Term object.
     316                 */
    266317                $actions = apply_filters( "{$taxonomy}_row_actions", $actions, $tag );
    267318
    268319                $out .= $this->row_actions( $actions );
    269320                $out .= '<div class="hidden" id="inline_' . $qe_data->term_id . '">';
    270321                $out .= '<div class="name">' . $qe_data->name . '</div>';
     322                /** This filter is documented in wp-admin/edit-tag-form.php */
    271323                $out .= '<div class="slug">' . apply_filters( 'editable_slug', $qe_data->slug ) . '</div>';
    272324                $out .= '<div class="parent">' . $qe_data->parent . '</div></div>';
    273325
     
    279331        }
    280332
    281333        function column_slug( $tag ) {
     334                /** This filter is documented in wp-admin/edit-tag-form.php */
    282335                return apply_filters( 'editable_slug', $tag->slug );
    283336        }
    284337
     
    314367        }
    315368
    316369        function column_default( $tag, $column_name ) {
     370                /**
     371                 * Filter the displayed columns in the terms list table.
     372                 *
     373                 * The dynamic portion of the hook name, $this->screen->taxonomy,
     374                 * refers to the taxonomy slug.
     375                 *
     376                 * @since 3.5.0
     377                 *
     378                 * @param string $string      Blank string.
     379                 * @param string $column_name Name of the column.
     380                 * @param int    $term_id     Term ID.
     381                 */
    317382                return apply_filters( "manage_{$this->screen->taxonomy}_custom_column", '', $column_name, $tag->term_id );
    318383        }
    319384
     
    356421                        if ( isset( $core_columns[$column_name] ) )
    357422                                continue;
    358423
     424                        /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
    359425                        do_action( 'quick_edit_custom_box', $column_name, 'edit-tags', $this->screen->taxonomy );
    360426                }
    361427