/** * 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()); }
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); }