wp_sidebar_description example


function wp_list_widget_controls( $sidebar$sidebar_name = '' ) {
    add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );

    $description = wp_sidebar_description( $sidebar );

    echo '<div id="' . esc_attr( $sidebar ) . '" class="widgets-sortables">';

    if ( $sidebar_name ) {
        $add_to = sprintf(
            /* translators: %s: Widgets sidebar name. */
            __( 'Add to: %s' ),
            $sidebar_name
        );
        ?> <div class="sidebar-name" data-add-to="<?php echo esc_attr( $add_to ); ?>"> <button type="button" class="handlediv hide-if-no-js" aria-expanded="true"> <span class="screen-reader-text">
// Restores the more descriptive, specific name for use within this method.         $raw_sidebar = $item;
        $id          = $raw_sidebar['id'];
        $sidebar     = array( 'id' => $id );

        if ( isset( $wp_registered_sidebars[ $id ] ) ) {
            $registered_sidebar = $wp_registered_sidebars[ $id ];

            $sidebar['status']        = 'active';
            $sidebar['name']          = isset( $registered_sidebar['name'] ) ? $registered_sidebar['name'] : '';
            $sidebar['description']   = isset( $registered_sidebar['description'] ) ? wp_sidebar_description( $id ) : '';
            $sidebar['class']         = isset( $registered_sidebar['class'] ) ? $registered_sidebar['class'] : '';
            $sidebar['before_widget'] = isset( $registered_sidebar['before_widget'] ) ? $registered_sidebar['before_widget'] : '';
            $sidebar['after_widget']  = isset( $registered_sidebar['after_widget'] ) ? $registered_sidebar['after_widget'] : '';
            $sidebar['before_title']  = isset( $registered_sidebar['before_title'] ) ? $registered_sidebar['before_title'] : '';
            $sidebar['after_title']   = isset( $registered_sidebar['after_title'] ) ? $registered_sidebar['after_title'] : '';
        } else {
            $sidebar['status']      = 'inactive';
            $sidebar['name']        = $raw_sidebar['name'];
            $sidebar['description'] = '';
            $sidebar['class']       = '';
        }

        
Home | Imprint | This part of the site doesn't use cookies.