Make WordPress Core

Ticket #25608: 25608-2.diff

File 25608-2.diff, 4.8 KB (added by ShinichiN, 10 years ago)

Changed according to the reviews. Thank you.

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

     
    4848
    4949                wp_reset_vars( array( 'orderby', 'order', 's' ) );
    5050
     51                $all_themes = wp_get_themes();
     52                /**
     53                 * Filter the array of WP_Theme objects.
     54                 *
     55                 * @since 3.1.0
     56                 *
     57                 * @param array $all_themes The array of WP_Theme objects.
     58                 */
     59                $all_themes = apply_filters( 'all_themes', $all_themes );
    5160                $themes = array(
    52                         'all' => apply_filters( 'all_themes', wp_get_themes() ),
     61                        'all' => $all_themes,
    5362                        'search' => array(),
    5463                        'enabled' => array(),
    5564                        'disabled' => array(),
     
    284293                if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) )
    285294                        $actions['delete'] = '<a href="' . esc_url( wp_nonce_url( 'themes.php?action=delete-selected&amp;checked[]=' . $theme_key . '&amp;theme_status=' . $context . '&amp;paged=' . $page . '&amp;s=' . $s, 'bulk-themes' ) ) . '" title="' . esc_attr__( 'Delete this theme' ) . '" class="delete">' . __( 'Delete' ) . '</a>';
    286295
    287                 $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme, $context );
     296                $actions = array_filter( $actions );
     297                /**
     298                 * Filter the action links displayed under each theme in the theme list table.
     299                 *
     300                 * @since 2.8.0
     301                 *
     302                 * @param array           $actions Action links array.
     303                 * @param WP_Theme object $theme   The WP_Theme object.
     304                 * @param string          $status  The status of the theme such as enabled, disabled, search, upgrade and so on.
     305                 */
     306                $actions = apply_filters( 'theme_action_links', $actions, $theme, $context );
     307                /**
     308                 * Filter the action links of a specified theme in the theme list table.
     309                 *
     310                 * You can use $stylesheet to specify which theme's action links you want to filter.
     311                 *
     312                 * @since 3.5.0
     313                 *
     314                 * @param array           $actions Action links array.
     315                 * @param WP_Theme object $theme   The WP_Theme object.
     316                 * @param string          $status  The status of the theme such as enabled, disabled, search, upgrade and so on.
     317                 */
    288318                $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, $context );
    289319
    290320                $class = ! $allowed ? 'inactive' : 'active';
     
    333363                                        if ( $theme->get('ThemeURI') )
    334364                                                $theme_meta[] = '<a href="' . $theme->display('ThemeURI') . '" title="' . esc_attr__( 'Visit theme homepage' ) . '">' . __( 'Visit Theme Site' ) . '</a>';
    335365
     366                                        /**
     367                                         * Filter the array of links of the meta data of the theme.
     368                                         *
     369                                         * @since 3.1.0
     370                                         *
     371                                         * @param array    $theme_meta Array of theme's meta such as the version, author and so on.
     372                                         * @param string   $stylesheet Directory name of the theme.
     373                                         * @param WP_Theme $theme      WP_Theme object.
     374                                         * @param string   $status     Status of the theme such as enabled, disabled, search, upgrade and so on.
     375                                         */
    336376                                        $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );
    337377                                        echo implode( ' | ', $theme_meta );
    338378
     
    341381
    342382                                default:
    343383                                        echo "<td class='$column_name column-$column_name'$style>";
     384                                        /**
     385                                         * Fires in the custom column in the theme table.
     386                                         *
     387                                         * @since 3.1.0
     388                                         *
     389                                         * @param string   $column_name Name of the column.
     390                                         * @param string   $stylesheet  Directory name of the theme.
     391                                         * @param WP_Theme $theme       WP_Theme object.
     392                                         */
    344393                                        do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
    345394                                        echo "</td>";
    346395                        }
     
    350399
    351400                if ( $this->is_site_themes )
    352401                        remove_action( "after_theme_row_$stylesheet", 'wp_theme_update_row' );
     402                /**
     403                 * Fires when the row of each theme has been displayed and the tr ends.
     404                 *
     405                 * @since 3.1.0
     406                 *
     407                 * @param string   $stylesheet Directory name of the theme.
     408                 * @param WP_Theme $theme      WP_Theme object.
     409                 * @param string   $status     Status of the theme such as enabled, disabled, search, upgrade and so on.
     410                 */
    353411                do_action( 'after_theme_row', $stylesheet, $theme, $status );
     412                /**
     413                 * Fires when the row of a certain theme has been displayed and the tr ends.
     414                 *
     415                 * You can use $stylesheet to specify in which theme's row you want to take action.
     416                 *
     417                 * @since 3.5.0
     418                 *
     419                 * @param string   $stylesheet Directory name of the theme.
     420                 * @param WP_Theme $theme      WP_Theme object.
     421                 * @param string   $status     Status of the theme such as enabled, disabled, search, upgrade and so on.
     422                 */
    354423                do_action( "after_theme_row_$stylesheet", $stylesheet, $theme, $status );
    355424        }
    356425}