false, self::INCLUDE_PARENT => false, self::INCLUDE_CHILDLESS_PARENT => false, self::ORDER_BY => 'menu_order', self::USE_PLUGIN_STYLES => false, self::EXCLUDE => false, self::DISPLAY_ALL => false, self::LEVELS => 1, ); protected static $hooked = false; public function __construct() { $widget_ops = array( 'classname' => 'advanced-sidebar-menu', 'description' => __( 'Creates a menu of all the pages using the child/parent relationship', 'advanced-sidebar-menu' ), ); $control_ops = array( 'width' => 620, ); parent::__construct( 'advanced_sidebar_menu', __( 'Advanced Sidebar Pages Menu', 'advanced-sidebar-menu' ), $widget_ops, $control_ops ); if ( ! self::$hooked ) { self::$hooked = true; $this->hook(); } } protected function hook() { add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_display' ), 5, 1 ); add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_styles' ), 10, 1 ); add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_order' ), 15, 1 ); add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_exclude' ), 20, 1 ); } public function box_display( array $instance ) { ?>
set_instance( $instance, self::$defaults ); do_action( 'advanced-sidebar-menu/widget/page/before-form', $instance, $this ); ?>render(); } }