~canonical-sysadmins/wordpress/4.5.2

« back to all changes in this revision

Viewing changes to wp-admin/includes/widgets.php

  • Committer: Manuel Seelaus
  • Date: 2015-12-09 17:47:18 UTC
  • mfrom: (1.1.11 upstream)
  • Revision ID: manuel.seelaus@canonical.com-20151209174718-coxethm2swbeqksy
Merge WP4.4 from upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
67
67
 *
68
68
 * @since 2.5.0
69
69
 *
70
 
 * @param string $sidebar id slug of the sidebar
71
 
 * @param string optional $sidebar_name Include the HTML for the sidebar name
 
70
 * @param string $sidebar      Sidebar ID.
 
71
 * @param string $sidebar_name Optional. Sidebar name. Default empty.
72
72
 */
73
73
function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) {
74
74
        add_filter( 'dynamic_sidebar_params', 'wp_list_widget_controls_dynamic_sidebar' );
81
81
                ?>
82
82
                <div class="sidebar-name">
83
83
                        <div class="sidebar-name-arrow"><br /></div>
84
 
                        <h3><?php echo esc_html( $sidebar_name ); ?> <span class="spinner"></span></h3>
 
84
                        <h2><?php echo esc_html( $sidebar_name ); ?> <span class="spinner"></span></h2>
85
85
                </div>
86
86
                <?php
87
87
        }
88
88
 
89
 
        echo '<div class="sidebar-description">';
90
 
 
91
89
        if ( ! empty( $description ) ) {
92
 
                echo '<p class="description">' . $description . '</p>';
 
90
                ?>
 
91
                <div class="sidebar-description">
 
92
                        <p class="description"><?php echo $description; ?></p>
 
93
                </div>
 
94
                <?php
93
95
        }
94
96
 
95
 
        echo '</div>';
96
 
 
97
97
        dynamic_sidebar( $sidebar );
98
98
 
99
99
        echo '</div>';
100
100
}
101
101
 
102
102
/**
103
 
 * {@internal Missing Short Description}}
 
103
 * Retrieves the widget control arguments.
104
104
 *
105
105
 * @since 2.5.0
106
106
 *
181
181
        $multi_number = isset($sidebar_args['_multi_num']) ? $sidebar_args['_multi_num'] : '';
182
182
        $add_new = isset($sidebar_args['_add']) ? $sidebar_args['_add'] : '';
183
183
 
 
184
        $before_form = isset( $sidebar_args['before_form'] ) ? $sidebar_args['before_form'] : '<form method="post">';
 
185
        $after_form = isset( $sidebar_args['after_form'] ) ? $sidebar_args['after_form'] : '</form>';
 
186
        $before_widget_content = isset( $sidebar_args['before_widget_content'] ) ? $sidebar_args['before_widget_content'] : '<div class="widget-content">';
 
187
        $after_widget_content = isset( $sidebar_args['after_widget_content'] ) ? $sidebar_args['after_widget_content'] : '</div>';
 
188
 
184
189
        $query_arg = array( 'editwidget' => $widget['id'] );
185
190
        if ( $add_new ) {
186
191
                $query_arg['addnew'] = 1;
221
226
                        <span class="screen-reader-text"><?php echo $widget_title; ?></span>
222
227
                </a>
223
228
        </div>
224
 
        <div class="widget-title"><h4><?php echo $widget_title ?><span class="in-widget-title"></span></h4></div>
 
229
        <div class="widget-title"><h3><?php echo $widget_title; ?><span class="in-widget-title"></span></h3></div>
225
230
        </div>
226
231
 
227
232
        <div class="widget-inside">
228
 
        <form method="post">
229
 
        <div class="widget-content">
230
 
<?php
231
 
        if ( isset($control['callback']) )
 
233
        <?php echo $before_form; ?>
 
234
        <?php echo $before_widget_content; ?>
 
235
        <?php
 
236
        if ( isset( $control['callback'] ) ) {
232
237
                $has_form = call_user_func_array( $control['callback'], $control['params'] );
233
 
        else
234
 
                echo "\t\t<p>" . __('There are no options for this widget.') . "</p>\n"; ?>
235
 
        </div>
 
238
        } else {
 
239
                echo "\t\t<p>" . __('There are no options for this widget.') . "</p>\n";
 
240
        }
 
241
        ?>
 
242
        <?php echo $after_widget_content; ?>
236
243
        <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($id_format); ?>" />
237
244
        <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" />
238
245
        <input type="hidden" name="widget-width" class="widget-width" value="<?php if (isset( $control['width'] )) echo esc_attr($control['width']); ?>" />
252
259
                </div>
253
260
                <br class="clear" />
254
261
        </div>
255
 
        </form>
 
262
        <?php echo $after_form; ?>
256
263
        </div>
257
264
 
258
265
        <div class="widget-description">
263
270
 
264
271
        return $sidebar_args;
265
272
}
 
273
 
 
274
/**
 
275
 *
 
276
 * @param string $classes
 
277
 * @return string
 
278
 */
 
279
function wp_widgets_access_body_class($classes) {
 
280
        return "$classes widgets_access ";
 
281
}
 
 
b'\\ No newline at end of file'