WordPress.org

Make WordPress Core

Ticket #21789: dashboard_filter.patch

File dashboard_filter.patch, 2.0 KB (added by markoheijnen, 20 months ago)
  • wp-content/themes/twentyeleven/functions.php

     
    611611} 
    612612add_filter( 'body_class', 'twentyeleven_body_classes' ); 
    613613 
     614/** 
     615 * Adds a customize link to the welcome panel to show the user they can switch color scheme 
     616 * 
     617 * @since Twenty Eleven 1.5 
     618 */ 
     619function twentyeleven_customize_links( $customize_links ) { 
     620        array_unshift( $customize_links, sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) ) ); 
     621        return $customize_links; 
     622} 
     623add_filter( 'theme_customize_links', 'twentyeleven_customize_links' ); 
  • wp-admin/includes/dashboard.php

     
    12861286                        echo '</p>'; 
    12871287                else: 
    12881288                        $customize_links = array(); 
    1289                         if ( 'twentyeleven' == $theme->get_stylesheet() ) 
    1290                                 $customize_links[] = sprintf( __( '<a href="%s">Choose light or dark</a>' ), esc_url( admin_url( 'themes.php?page=theme_options' ) ) ); 
    1291  
    12921289                        if ( current_theme_supports( 'custom-background' ) ) 
    12931290                                $customize_links[] = sprintf( __( '<a href="%s">Set a background color</a>' ), esc_url( admin_url( 'themes.php?page=custom-background' ) ) ); 
    12941291 
     
    12981295                        if ( current_theme_supports( 'widgets' ) ) 
    12991296                                $customize_links[] = sprintf( __( '<a href="%s">Add some widgets</a>' ), esc_url( admin_url( 'widgets.php' ) ) ); 
    13001297 
     1298                        $customize_links = apply_filters( 'theme_customize_links', $customize_links, $theme->get_stylesheet() ); 
     1299 
    13011300                        if ( ! empty( $customize_links ) ) { 
    13021301                                echo '<p>'; 
    13031302                                printf( __( 'Use the current theme &mdash; %1$s &mdash; or <a href="%2$s">choose a new one</a>. If you stick with %1$s, here are a few ways to make your site look unique.' ), $theme->display('Name'), esc_url( admin_url( 'themes.php' ) ) );