function enlightenment_edit_dynamic_sidebar($args, $echo = true) { $defaults = array('class' => '', 'id' => '', 'value' => '', 'placeholder' => '', 'size' => '', 'description' => ''); $args = wp_parse_args($args, $defaults); $args = apply_filters('enlightenment_edit_dynamic_sidebar_args', $args); $description = $args['description']; unset($args['description']); $output = '<p>'; $args['name'] .= '[name]'; $args['value'] = $args['atts']['name']; $output .= enlightenment_text_input($args, false); if (current_theme_supports('enlightenment-grid-loop')) { $output .= ' '; $args['value'] = $args['atts']['grid']; $output .= enlightenment_dynamic_sidebar_grid($args, false); } $args['name'] = str_replace('[name]', '[delete]', $args['name']); $output .= ' '; $output .= enlightenment_submit_button(array('name' => $args['name'], 'class' => 'button delete-sidebar', 'value' => __('Delete Sidebar', 'enlightenment')), false); $output .= '</p>'; $output .= empty($description) ? '' : '<p class="description">' . strip_tags($description, '<a><abbr><img>') . '</p>'; $output = apply_filters('enlightenment_edit_dynamic_sidebar', $output, $args); if (!$echo) { return $output; } echo $output; }
function enlightenment_edit_dynamic_sidebar_buttons($args, $echo = true) { $defaults = array('class' => '', 'id' => '', 'value' => '', 'placeholder' => '', 'size' => '', 'description' => ''); $args = wp_parse_args($args, $defaults); $args = apply_filters('enlightenment_edit_dynamic_sidebar_args', $args); $description = $args['description']; unset($args['description']); $output = '<p>'; global $pagenow; $link = admin_url('themes.php?page=' . current_theme_supports('enlightenment-theme-settings', 'menu_slug') . '&tab=sidebars&sidebar=' . $args['name']); $output .= sprintf('<a href="%1$s" class="button">%2$s</a>', esc_url($link), __('Edit Sidebar', 'enlightenment')); $args['name'] = 'sidebars[' . $args['name'] . '][delete]'; $output .= ' '; $output .= enlightenment_submit_button(array('name' => $args['name'], 'class' => 'button delete-sidebar', 'value' => __('Delete Sidebar', 'enlightenment')), false); $output .= '</p>'; $output .= empty($description) ? '' : '<p class="description">' . strip_tags($description, '<a><abbr><img>') . '</p>'; $output = apply_filters('enlightenment_edit_dynamic_sidebar', $output, $args); if (!$echo) { return $output; } echo $output; }