diff -r 490d5cc509ed -r cf61fcea0001 wp/wp-admin/includes/class-wp-themes-list-table.php --- a/wp/wp-admin/includes/class-wp-themes-list-table.php Tue Jun 09 11:14:17 2015 +0000 +++ b/wp/wp-admin/includes/class-wp-themes-list-table.php Mon Oct 14 17:39:30 2019 +0200 @@ -1,11 +1,19 @@ true ) ); @@ -67,26 +80,29 @@ ) ); } + /** + */ public function no_items() { if ( $this->search_terms || $this->features ) { _e( 'No items found.' ); return; } + $blog_id = get_current_blog_id(); if ( is_multisite() ) { if ( current_user_can( 'install_themes' ) && current_user_can( 'manage_network_themes' ) ) { - printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to enable or install more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ), network_admin_url( 'theme-install.php' ) ); + printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to enable or install more themes.' ), network_admin_url( 'site-themes.php?id=' . $blog_id ), network_admin_url( 'theme-install.php' ) ); return; } elseif ( current_user_can( 'manage_network_themes' ) ) { - printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to enable more themes.' ), network_admin_url( 'site-themes.php?id=' . $GLOBALS['blog_id'] ) ); + printf( __( 'You only have one theme enabled for this site right now. Visit the Network Admin to enable more themes.' ), network_admin_url( 'site-themes.php?id=' . $blog_id ) ); return; } // Else, fallthrough. install_themes doesn't help if you can't enable it. } else { if ( current_user_can( 'install_themes' ) ) { - printf( __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress.org Theme Directory at any time: just click on the Install Themes tab above.' ), admin_url( 'theme-install.php' ) ); + printf( __( 'You only have one theme installed right now. Live a little! You can choose from over 1,000 free themes in the WordPress Theme Directory at any time: just click on the Install Themes tab above.' ), admin_url( 'theme-install.php' ) ); return; } @@ -97,7 +113,6 @@ /** * @param string $which - * @return null */ public function tablenav( $which = 'top' ) { if ( $this->get_pagination_arg( 'total_pages' ) <= 1 ) @@ -111,6 +126,8 @@ @@ -124,10 +141,16 @@ has_items() ) { $this->display_rows(); @@ -138,6 +161,8 @@ } } + /** + */ public function display_rows() { $themes = $this->items; @@ -152,17 +177,10 @@ $activate_link = wp_nonce_url( "themes.php?action=activate&template=" . urlencode( $template ) . "&stylesheet=" . urlencode( $stylesheet ), 'switch-theme_' . $stylesheet ); - $preview_link = esc_url( add_query_arg( - array( 'preview' => 1, 'template' => urlencode( $template ), 'stylesheet' => urlencode( $stylesheet ), 'preview_iframe' => true, 'TB_iframe' => 'true' ), - home_url( '/' ) ) ); - $actions = array(); $actions['activate'] = '' . __( 'Activate' ) . ''; - $actions['preview'] = '' . __( 'Preview' ) . ''; - if ( current_user_can( 'edit_theme_options' ) && current_user_can( 'customize' ) ) { $actions['preview'] .= '' . __( 'Live Preview' ) . ''; @@ -174,20 +192,20 @@ . "' );" . '">' . __( 'Delete' ) . ''; /** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */ - $actions = apply_filters( 'theme_action_links', $actions, $theme ); + $actions = apply_filters( 'theme_action_links', $actions, $theme, 'all' ); /** This filter is documented in wp-admin/includes/class-wp-ms-themes-list-table.php */ - $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme ); + $actions = apply_filters( "theme_action_links_$stylesheet", $actions, $theme, 'all' ); $delete_action = isset( $actions['delete'] ) ? '
' . $actions['delete'] . '
' : ''; unset( $actions['delete'] ); ?> - + get_screenshot() ) : ?> - + get_screenshot() ) : ?> @@ -262,7 +280,6 @@ * Send required variables to JavaScript land * * @since 3.4.0 - * @access public * * @param array $extra_args */