Пример #1
0
 public function onAction_widgets_init(tubepress_api_event_EventInterface $event)
 {
     if (!$event->hasArgument('unit-testing') && !class_exists('tubepress_wordpress_impl_wp_WpWidget')) {
         require TUBEPRESS_ROOT . '/src/add-ons/wordpress/classes/tubepress/wordpress/impl/wp/WpWidget.php';
     }
     $this->_wpFunctions->register_widget('tubepress_wordpress_impl_wp_WpWidget');
     /*
      * These next three lines are deprecated!
      */
     $widgetOps = array('classname' => 'widget_tubepress', 'description' => $this->_translator->trans('Displays YouTube or Vimeo videos with TubePress. Limited to a single instance per site. Use the other TubePress widget instead!'));
     //>(translatable)<
     $this->_wpFunctions->wp_register_sidebar_widget('tubepress', 'TubePress (legacy)', array($this, '__fireWidgetHtmlEvent'), $widgetOps);
     $this->_wpFunctions->wp_register_widget_control('tubepress', 'TubePress (legacy)', array($this, '__fireWidgetControlEvent'));
 }