/** * */ public function setUp() { global $flex_widget; add_filter('is_flex_widget_legacy', '__return_true'); parent::setUp(); $flex_widget->register_widget(); require_once FW_DIR_TESTDATA . '/../includes/class-flex-widget-test.php'; register_widget('Flex_Widget_Test'); $compat = new Flex_Widget_Legacy(); $compat->load(); }
/** * Set up the widget. * * @since 1.0.0 */ public function load() { self::load_textdomain(); add_action('widgets_init', array($this, 'register_widget')); $compat = new Flex_Widget_Legacy(); $compat->load(); if (is_flex_widget_legacy()) { return; } add_action('init', array($this, 'register_assets')); add_action('sidebar_admin_setup', array($this, 'enqueue_admin_assets')); add_filter('screen_settings', array($this, 'widgets_screen_settings'), 10, 2); add_action('wp_ajax_flex_widget_preferences', array($this, 'ajax_save_user_preferences')); }