Make WordPress Core

Ticket #25608: 25608.3.diff

File 25608.3.diff, 6.7 KB (added by kpdesign, 10 years ago)

Fourth pass

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

     
    4949                wp_reset_vars( array( 'orderby', 'order', 's' ) );
    5050
    5151                $themes = array(
     52                        /**
     53                         * Filter the array of WP_Theme objects to list in the Multisite
     54                         * themes list table.
     55                         *
     56                         * @since 3.1.0
     57                         *
     58                         * @param array $all An array of WP_Theme objects to display in the list table.
     59                         */
    5260                        'all' => apply_filters( 'all_themes', wp_get_themes() ),
    5361                        'search' => array(),
    5462                        'enabled' => array(),
     
    284292                if ( ! $allowed && current_user_can( 'delete_themes' ) && ! $this->is_site_themes && $stylesheet != get_option( 'stylesheet' ) && $stylesheet != get_option( 'template' ) )
    285293                        $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>';
    286294
     295                /**
     296                 * Filter the action links displayed for each theme in the Multisite
     297                 * themes list table.
     298                 *
     299                 * The action links displayed are determined by the theme's status, and
     300                 * which Multisite themes list table is being displayed - the Network
     301                 * themes list table (themes.php), which displays all installed themes,
     302                 * or the Site themes list table (site-themes.php), which displays the
     303                 * non-network enabled themes when editing a site in the Network admin.
     304                 *
     305                 * The default action links for the Network themes list table include
     306                 * 'Network Enable', 'Network Disable', 'Edit', and 'Delete'.
     307                 *
     308                 * The default action links for the Site themes list table include
     309                 * 'Enable', 'Disable', and 'Edit'.
     310                 *
     311                 * @since 2.8.0
     312                 *
     313                 * @param array    $actions An array of action links.
     314                 * @param WP_Theme $theme   The WP_Theme object.
     315                 * @param string   $context Status of the theme.
     316                 */
    287317                $actions = apply_filters( 'theme_action_links', array_filter( $actions ), $theme, $context );
    288                 $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, $context );
    289318
     319                /**
     320                 * Filter the action links of a specific theme in the Multisite themes
     321                 * list table.
     322                 *
     323                 * The dynamic portion of the hook name, $stylesheet, refers to the
     324                 * directory name of the theme, which in most cases is synonymous
     325                 * with the template name.
     326                 *
     327                 * @since 3.5.0
     328                 *
     329                 * @param array    $actions An array of action links.
     330                 * @param WP_Theme $theme   The WP_Theme object.
     331                 * @param string   $context Status of the theme.
     332                 */
     333                $actions = apply_filters( "theme_action_links_{$stylesheet}", $actions, $theme, $context );
     334
    290335                $class = ! $allowed ? 'inactive' : 'active';
    291336                $checkbox_id = "checkbox_" . md5( $theme->get('Name') );
    292337                $checkbox = "<input type='checkbox' name='checked[]' value='" . esc_attr( $stylesheet ) . "' id='" . $checkbox_id . "' /><label class='screen-reader-text' for='" . $checkbox_id . "' >" . __('Select') . " " . $theme->display('Name') . "</label>";
     
    333378                                        if ( $theme->get('ThemeURI') )
    334379                                                $theme_meta[] = '<a href="' . $theme->display('ThemeURI') . '" title="' . esc_attr__( 'Visit theme homepage' ) . '">' . __( 'Visit Theme Site' ) . '</a>';
    335380
     381                                        /**
     382                                         * Filter the array of row meta for each theme in the Multisite themes
     383                                         * list table.
     384                                         *
     385                                         * @since 3.1.0
     386                                         *
     387                                         * @param array    $theme_meta An array of the theme's metadata,
     388                                         *                             including the version, author, and
     389                                         *                             theme URI.
     390                                         * @param string   $stylesheet Directory name of the theme.
     391                                         * @param WP_Theme $theme      WP_Theme object.
     392                                         * @param string   $status     Status of the theme.
     393                                         */
    336394                                        $theme_meta = apply_filters( 'theme_row_meta', $theme_meta, $stylesheet, $theme, $status );
    337395                                        echo implode( ' | ', $theme_meta );
    338396
     
    341399
    342400                                default:
    343401                                        echo "<td class='$column_name column-$column_name'$style>";
     402
     403                                        /**
     404                                         * Fires inside each custom column of the Multisite themes list table.
     405                                         *
     406                                         * @since 3.1.0
     407                                         *
     408                                         * @param string   $column_name Name of the column.
     409                                         * @param string   $stylesheet  Directory name of the theme.
     410                                         * @param WP_Theme $theme       WP_Theme object.
     411                                         */
    344412                                        do_action( 'manage_themes_custom_column', $column_name, $stylesheet, $theme );
    345413                                        echo "</td>";
    346414                        }
     
    350418
    351419                if ( $this->is_site_themes )
    352420                        remove_action( "after_theme_row_$stylesheet", 'wp_theme_update_row' );
     421
     422                /**
     423                 * Fires after each row in the Multisite themes list table.
     424                 *
     425                 * @since 3.1.0
     426                 *
     427                 * @param string   $stylesheet Directory name of the theme.
     428                 * @param WP_Theme $theme      WP_Theme object.
     429                 * @param string   $status     Status of the theme.
     430                 */
    353431                do_action( 'after_theme_row', $stylesheet, $theme, $status );
    354                 do_action( "after_theme_row_$stylesheet", $stylesheet, $theme, $status );
     432
     433                /**
     434                 * Fires after each specific row in the Multisite themes list table.
     435                 *
     436                 * The dynamic portion of the hook name, $stylesheet, refers to the
     437                 * directory name of the theme, most often synonymous with the template
     438                 * name of the theme.
     439                 *
     440                 * @since 3.5.0
     441                 *
     442                 * @param string   $stylesheet Directory name of the theme.
     443                 * @param WP_Theme $theme      WP_Theme object.
     444                 * @param string   $status     Status of the theme.
     445                 */
     446                do_action( "after_theme_row_{$stylesheet}", $stylesheet, $theme, $status );
    355447        }
    356448}
  • src/wp-admin/includes/class-wp-themes-list-table.php

     
    158158                                        . '" onclick="' . "return confirm( '" . esc_js( sprintf( __( "You are about to delete this theme '%s'\n  'Cancel' to stop, 'OK' to delete." ), $title ) )
    159159                                        . "' );" . '">' . __( 'Delete' ) . '</a>';
    160160
     161                        /** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
    161162                        $actions       = apply_filters( 'theme_action_links', $actions, $theme );
     163
     164                        /** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */
    162165                        $actions       = apply_filters( "theme_action_links_$stylesheet", $actions, $theme );
    163166                        $delete_action = isset( $actions['delete'] ) ? '<div class="delete-theme">' . $actions['delete'] . '</div>' : '';
    164167                        unset( $actions['delete'] );