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, ); 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' => 290, ); parent::__construct( 'advanced_sidebar_menu', __( 'Advanced Sidebar Pages Menu', 'advanced-sidebar-menu' ), $widget_ops, $control_ops ); } /** * Output a simple widget Form * * Not of ton of options here but who needs them * Most of the magic happens automatically * * @filters do_action('advanced_sidebar_menu_page_widget_form', $instance, $this->get_field_name('parent_only'), * $this->get_field_id('parent_only')); * * @param array $instance * * @return void */ public function form( $instance ) { $instance = wp_parse_args( $instance, self::$defaults ); ?>
: />
: />
:
: />
:
: />
'; do_action( 'advanced_sidebar_menu_page_widget_form', $instance, $this->get_field_name( 'parent_only' ), $this->get_field_id( 'parent_only' ), $this ); do_action( 'advanced_sidebar_menu_after_widget_form', $instance, $this ); } /** * Handles the saving of the widget * * @filters apply_filters('advanced_sidebar_menu_page_widget_update', $newInstance, $oldInstance ); * * @since 4.26.13 */ public function update( $newInstance, $oldInstance ) { $newInstance[ 'exclude' ] = strip_tags( $newInstance[ 'exclude' ] ); $newInstance = apply_filters( 'advanced_sidebar_menu_page_widget_update', $newInstance, $oldInstance ); return $newInstance; } /** * Widget Output * * @since 7.0.0 * * @see \Advanced_Sidebar_Menu_Menus_Page * * @param array $args * @param array $instance * * @return void */ public function widget( $args, $instance ) { $instance = wp_parse_args( $instance, self::$defaults ); $asm = Advanced_Sidebar_Menu_Menus_Page::factory( $instance, $args ); do_action( 'advanced_sidebar_menu_widget_pre_render', $asm, $this ); $asm->render(); } }