Ejemplo n.º 1
0
 function test_debug_output_omits_wpdb()
 {
     global $wpdb;
     $utcw = $this->mockFactory->getUTCWNotAuthenticated();
     $utcw->set('wpdb', $wpdb);
     $utcw->set('renderConfig', new UTCW_RenderConfig(array('debug' => true), $utcw));
     $utcw->set('dataConfig', new UTCW_DataConfig(array(), $utcw));
     $utcw->set('data', new UTCW_Data($utcw));
     $render = new UTCW_Render($utcw);
     $cloud = $render->getCloud();
     $this->assertNotContains('wpdb', $cloud, $ignoreCase = true);
 }
Ejemplo n.º 2
0
 /**
  * Short code handler for 'utcw' hook
  *
  * @param array $args
  *
  * @return string
  * @since 2.4
  */
 public function render(array $args)
 {
     global $wpdb;
     if (isset($args['load_config'])) {
         $loaded = $this->plugin->loadConfiguration($args['load_config']);
         if (is_array($loaded)) {
             $args = $loaded;
         }
     }
     $this->plugin->set('wpdb', $wpdb);
     $this->plugin->set('dataConfig', new UTCW_DataConfig($args, $this->plugin));
     $this->plugin->set('renderConfig', new UTCW_RenderConfig($args, $this->plugin));
     $this->plugin->set('data', new UTCW_Data($this->plugin));
     $render = new UTCW_Render($this->plugin);
     do_action('utcw_shortcode', $args);
     return apply_filters('filter_shortcode', $render->getCloud());
 }
Ejemplo n.º 3
0
 /**
  * Function for rendering the widget
  *
  * @param array $args
  *
  * @param array $instance
  */
 public function widget($args, $instance)
 {
     global $wpdb;
     $input = array_merge($instance, $args);
     $this->plugin->set('wpdb', $wpdb);
     $this->plugin->set('dataConfig', new UTCW_DataConfig($input, $this->plugin));
     $this->plugin->set('renderConfig', new UTCW_RenderConfig($input, $this->plugin));
     $this->plugin->set('data', new UTCW_Data($this->plugin));
     $render = new UTCW_Render($this->plugin);
     $render->render();
 }