WordPress.org

Make WordPress Core

Changeset 40251


Ignore:
Timestamp:
03/08/2017 06:24:16 PM (17 months ago)
Author:
westonruter
Message:

Customize: Show title input placeholders for widgets that have default titles when rendered.

Fixes #39909.
Props bor0, dlh, westonruter.

Location:
trunk/src/wp-includes
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/widgets.php

    r39892 r40251  
    13531353<?php endif; if ( $inputs['title'] ) : ?>
    13541354    <p><label for="rss-title-<?php echo $esc_number; ?>"><?php _e( 'Give the feed a title (optional):' ); ?></label>
    1355     <input class="widefat" id="rss-title-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][title]" type="text" value="<?php echo esc_attr( $args['title'] ); ?>" /></p>
     1355    <input class="widefat" id="rss-title-<?php echo $esc_number; ?>" name="widget-rss[<?php echo $esc_number; ?>][title]" type="text" value="<?php echo esc_attr( $args['title'] ); ?>" placeholder="<?php esc_attr_e( '(Title from feed)' ) ?>" /></p>
    13561356<?php endif; if ( $inputs['items'] ) : ?>
    13571357    <p><label for="rss-items-<?php echo $esc_number; ?>"><?php _e( 'How many items would you like to display?' ); ?></label>
  • trunk/src/wp-includes/widgets/class-wp-widget-archives.php

    r37489 r40251  
    155155        $title = sanitize_text_field( $instance['title'] );
    156156        ?>
    157         <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
     157        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" placeholder="<?php esc_attr_e( 'Archives' ); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
    158158        <p>
    159159            <input class="checkbox" type="checkbox"<?php checked( $instance['dropdown'] ); ?> id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>" /> <label for="<?php echo $this->get_field_id('dropdown'); ?>"><?php _e('Display as dropdown'); ?></label>
  • trunk/src/wp-includes/widgets/class-wp-widget-categories.php

    r37489 r40251  
    159159        ?>
    160160        <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e( 'Title:' ); ?></label>
    161         <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
     161        <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" placeholder="<?php esc_attr_e( 'Categories' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
    162162
    163163        <p><input type="checkbox" class="checkbox" id="<?php echo $this->get_field_id('dropdown'); ?>" name="<?php echo $this->get_field_name('dropdown'); ?>"<?php checked( $dropdown ); ?> />
  • trunk/src/wp-includes/widgets/class-wp-widget-meta.php

    r37489 r40251  
    109109        $title = sanitize_text_field( $instance['title'] );
    110110?>
    111             <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
     111            <p><label for="<?php echo $this->get_field_id('title'); ?>"><?php _e('Title:'); ?></label> <input class="widefat" id="<?php echo $this->get_field_id('title'); ?>" name="<?php echo $this->get_field_name('title'); ?>" placeholder="<?php esc_attr_e( 'Meta' ); ?>" type="text" value="<?php echo esc_attr($title); ?>" /></p>
    112112<?php
    113113    }
  • trunk/src/wp-includes/widgets/class-wp-widget-pages.php

    r37489 r40251  
    130130        <p>
    131131            <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title:' ); ?></label>
    132             <input class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
     132            <input class="widefat" id="<?php echo esc_attr( $this->get_field_id('title') ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" placeholder="<?php esc_attr_e( 'Pages' ); ?>" type="text" value="<?php echo esc_attr( $instance['title'] ); ?>" />
    133133        </p>
    134134        <p>
  • trunk/src/wp-includes/widgets/class-wp-widget-recent-comments.php

    r37985 r40251  
    158158        ?>
    159159        <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
    160         <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
     160        <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" placeholder="<?php esc_attr_e( 'Recent Comments' ); ?>" type="text" value="<?php echo esc_attr( $title ); ?>" /></p>
    161161
    162162        <p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of comments to show:' ); ?></label>
  • trunk/src/wp-includes/widgets/class-wp-widget-recent-posts.php

    r37489 r40251  
    131131?>
    132132        <p><label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ); ?></label>
    133         <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
     133        <input class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" placeholder="<?php esc_attr_e( 'Recent Posts' ); ?>" type="text" value="<?php echo $title; ?>" /></p>
    134134
    135135        <p><label for="<?php echo $this->get_field_id( 'number' ); ?>"><?php _e( 'Number of posts to show:' ); ?></label>
  • trunk/src/wp-includes/widgets/class-wp-widget-tag-cloud.php

    r39053 r40251  
    121121
    122122        echo '<p><label for="' . $title_id .'">' . __( 'Title:' ) . '</label>
    123             <input type="text" class="widefat" id="' . $title_id .'" name="' . $this->get_field_name( 'title' ) .'" value="' . $instance['title'] .'" />
     123            <input type="text" class="widefat" id="' . $title_id .'" name="' . $this->get_field_name( 'title' ) .'" value="' . $instance['title'] .'" placeholder="' . esc_attr__( '(Selected taxonomy name)' ) . '" />
    124124        </p>';
    125125
Note: See TracChangeset for help on using the changeset viewer.