Making WordPress.org


Ignore:
Timestamp:
05/20/2016 09:01:31 PM (9 years ago)
Author:
obenland
Message:

Plugin Directory: Tighten up Widget setup and styles.

  • Removes the use of dynamic sidebars and makes information strings translatable.
  • Unifies widget styles across front page and single plugin pages.

See #1719.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php

    r3196 r3200  
    6161
    6262/**
    63  * Register widget area.
    64  *
    65  * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
    66  */
    67 function widgets_init() {
    68 
    69     register_sidebar( array(
    70         'name'          => esc_html__( 'Front Page Sidebar', 'wporg-plugins' ),
    71         'id'            => 'sidebar-front-page',
    72         'description'   => esc_html__( 'Appears on the bottom of the front page.', 'wporg-plugins' ),
    73         'before_widget' => '<div id="%1$s" class="widget %2$s">',
    74         'after_widget'  => '</div>',
    75         'before_title'  => '<h4 class="widget-title">',
    76         'after_title'   => '</h4>',
    77     ) );
    78 
    79     register_sidebar( array(
    80         'name'          => esc_html__( 'Sidebar', 'wporg-plugins' ),
    81         'id'            => 'sidebar-1',
    82         'description'   => esc_html__( 'Add widgets here.', 'wporg-plugins' ),
    83         'before_widget' => '<div id="%1$s" class="widget %2$s">',
    84         'after_widget'  => '</div>',
    85         'before_title'  => '<h3 class="widget-title">',
    86         'after_title'   => '</h3>',
    87     ) );
    88 }
    89 add_action( 'widgets_init', __NAMESPACE__ . '\widgets_init' );
    90 
    91 /**
    9263 * Enqueue scripts and styles.
    9364 */
Note: See TracChangeset for help on using the changeset viewer.