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(); } } /** * @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/page/left-column', array( $this, 'box_display' ), 5, 2 ); add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_styles' ), 10, 2 ); add_action( 'advanced-sidebar-menu/widget/page/left-column', array( $this, 'box_order' ), 15, 2 ); add_action( 'advanced-sidebar-menu/widget/page/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 ) { ?>
set_instance( $instance, self::$defaults ); do_action( 'advanced-sidebar-menu/widget/page/before-form', $instance, $this ); ?>render(); } }