PluginProbe ʕ •ᴥ•ʔ
Custom Sidebars – Dynamic Sidebar Classic Widget Area Manager / 3.0.7.1
Custom Sidebars – Dynamic Sidebar Classic Widget Area Manager v3.0.7.1
trunk 2.1.2.0 3.0.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.3 3.31 3.32 3.35 3.36 3.37 3.38
custom-sidebars / inc / class-custom-sidebars-widgets.php
custom-sidebars / inc Last commit date
external 9 years ago class-custom-sidebars-checkup-notification.php 9 years ago class-custom-sidebars-cloning.php 9 years ago class-custom-sidebars-editor.php 9 years ago class-custom-sidebars-explain.php 9 years ago class-custom-sidebars-export.php 9 years ago class-custom-sidebars-replacer.php 9 years ago class-custom-sidebars-visibility.php 9 years ago class-custom-sidebars-widgets.php 9 years ago class-custom-sidebars.php 9 years ago
class-custom-sidebars-widgets.php
85 lines
1 <?php
2
3 add_action( 'cs_init', array( 'CustomSidebarsWidgets', 'instance' ) );
4
5 /**
6 * Extends the widgets section to add the custom sidebars UI elements.
7 */
8 class CustomSidebarsWidgets extends CustomSidebars {
9
10 /**
11 * Returns the singleton object.
12 *
13 * @since 2.0
14 */
15 public static function instance() {
16 static $Inst = null;
17
18 if ( null === $Inst ) {
19 $Inst = new CustomSidebarsWidgets();
20 }
21
22 return $Inst;
23 }
24
25 /**
26 * Constructor is private -> singleton.
27 *
28 * @since 2.0
29 */
30 private function __construct() {
31 if ( is_admin() ) {
32 add_action(
33 'widgets_admin_page',
34 array( $this, 'widget_sidebar_content' )
35 );
36
37 add_action(
38 'admin_head-widgets.php',
39 array( $this, 'init_admin_head' )
40 );
41 }
42 add_action( 'widgets_admin_page', array( $this, 'add_div_start' ) );
43 add_action( 'sidebar_admin_page', array( $this, 'add_div_end' ) );
44 }
45
46 public function add_div_start() {
47 echo '<div class="cs-wrap">';
48 }
49
50 public function add_div_end() {
51 echo '</div>';
52 }
53
54 /**
55 * Adds the additional HTML code to the widgets section.
56 */
57 public function widget_sidebar_content() {
58 if ( false === self::$accessibility_mode ) {
59 include CSB_VIEWS_DIR . 'widgets.php';
60 }
61 }
62
63 /**
64 * Initialize the admin-head for the widgets page.
65 *
66 * @since 2.0.9.7
67 */
68 public function init_admin_head( $classes ) {
69 add_filter(
70 'admin_body_class',
71 array( $this, 'admin_body_class' )
72 );
73 }
74
75 /**
76 * Add a class to the body tag.
77 *
78 * @since 2.0.9.7
79 */
80 public function admin_body_class( $classes ) {
81 $classes .= ' no-auto-init ';
82 return $classes;
83 }
84 };
85