Make WordPress Core

Ticket #25608: 25608.diff

File 25608.diff, 4.6 KB (added by ShinichiN, 10 years ago)
  • 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 to be displayed under each themes.
     299                 *
     300                 * @since 2.8.0
     301                 *
     302                 * @param array  $actions The links which user can take actions to the themes with.
     303                 * @param 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 to be displayed under a certain theme themes.
     309                 *
     310                 * @since 3.5.0
     311                 *
     312                 * @param array  $actions The links which user can take actions to the themes with.
     313                 * @param object $theme   The WP_Theme object.
     314                 * @param string $status  The status of the theme such as enabled, disabled, search, upgrade and so on.
     315                 */
    288316                $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, $context );
    289317
    290318                $class = ! $allowed ? 'inactive' : 'active';
     
    333361                                        if ( $theme->get('ThemeURI') )
    334362                                                $theme_meta[] = '<a href="' . $theme->display('ThemeURI') . '" title="' . esc_attr__( 'Visit theme homepage' ) . '">' . __( 'Visit Theme Site' ) . '</a>';
    335363
     364                                        /**
     365                                         * Filter the array of links of the meta data of the theme.
     366                                         *
     367                                         * @since 3.1.0
     368                                         *
     369                                         * @param array  $theme_meta The array of theme's meta such as the version, author and link text of the theme site.
     370                                         * @param string $stylesheet The directory name of the theme.
     371                                         * @param object $theme      The WP_Theme object.
     372                                         * @param string $status     The status of the theme such as enabled, disabled, search, upgrade and so on.
     373                                         */
    336374                                        $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );
    337375                                        echo implode( ' | ', $theme_meta );
    338376
     
    341379
    342380                                default:
    343381                                        echo "<td class='$column_name column-$column_name'$style>";
     382                                        /**
     383                                         * Fires in the custom column in the theme table.
     384                                         *
     385                                         * @since 3.1.0
     386                                         *
     387                                         * @param string $column_name The name of the column.
     388                                         * @param string $stylesheet  The directory name of the theme.
     389                                         * @param object $theme       The WP_Theme object.
     390                                         */
    344391                                        do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
    345392                                        echo "</td>";
    346393                        }
     
    350397
    351398                if ( $this->is_site_themes )
    352399                        remove_action( "after_theme_row_$stylesheet", 'wp_theme_update_row' );
     400                /**
     401                 * Fires when the row of each theme has been displayed and ended with </tr>.
     402                 *
     403                 * @since 3.1.0
     404                 *
     405                 * @param string $stylesheet  The directory name of the theme.
     406                 * @param object $theme       The WP_Theme object.
     407                 * @param string $status      The status of the theme such as enabled, disabled, search, upgrade and so on.
     408                 */
    353409                do_action( 'after_theme_row', $stylesheet, $theme, $status );
     410                /**
     411                 * Fires when the row of a certain theme has been displayed and ended with </tr>.
     412                 *
     413                 * @since 3.5.0
     414                 *
     415                 * @param string $stylesheet  The directory name of the theme.
     416                 * @param object $theme       The WP_Theme object.
     417                 * @param string $status      The status of the theme such as enabled, disabled, search, upgrade and so on.
     418                 */
    354419                do_action( "after_theme_row_$stylesheet", $stylesheet, $theme, $status );
    355420        }
    356421}