'', self::INCLUDE_PARENT => false, self::INCLUDE_CHILDLESS_PARENT => false, self::USE_PLUGIN_STYLES => false, self::DISPLAY_ON_SINGLE => false, self::EACH_CATEGORY_DISPLAY => 'widget', self::EXCLUDE => '', self::DISPLAY_ALL => false, self::LEVELS => 1, ); protected static $hooked = false; public function __construct() { $widget_ops = array( 'classname' => 'advanced-sidebar-menu advanced-sidebar-category', 'description' => __( 'Creates a menu of all the categories using the child/parent relationship', 'advanced-sidebar-menu' ), ); $control_ops = array( 'width' => 620 ); parent::__construct( 'advanced_sidebar_menu_category', __( 'Advanced Sidebar Categories Menu', 'advanced-sidebar-menu' ), $widget_ops, $control_ops ); if ( ! self::$hooked ) { self::$hooked = true; $this->hook(); } } /** * @notice Anything using the column actions must use the $widget class passed * via do_action instead of $this * * @return void */ protected function hook() { add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_display' ), 5, 2 ); add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_styles' ), 10, 2 ); add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_singles' ), 15, 2 ); add_action( 'advanced-sidebar-menu/widget/category/left-column', array( $this, 'box_exclude' ), 20, 2 ); } /** * * @param array $instance * @param \Advanced_Sidebar_Menu__Widget__Widget $widget * * @return void */ public function box_display( array $instance, $widget ) { ?>

checkbox( self::INCLUDE_PARENT ); ?>

checkbox( self::INCLUDE_CHILDLESS_PARENT ); ?>

checkbox( self::DISPLAY_ALL, self::LEVELS ); ?>

hide_element( self::DISPLAY_ALL, self::LEVELS ); ?>>

checkbox( self::USE_PLUGIN_STYLES ); ?>

checkbox( self::DISPLAY_ON_SINGLE, self::EACH_CATEGORY_DISPLAY ); ?>

hide_element( self::DISPLAY_ON_SINGLE, self::EACH_CATEGORY_DISPLAY ); ?>>

set_instance( $instance, self::$defaults ); do_action( 'advanced-sidebar-menu/widget/category/before-form', $instance, $this ); ?>

set_instance( $instance, self::$defaults ); $asm = Advanced_Sidebar_Menu_Menus_Category::factory( $instance, $args ); do_action( 'advanced_sidebar_menu_widget_pre_render', $asm, $this ); $asm->render(); } }