Open goxmedia opened 4 years ago
When placing a shortcode within a text widget, it always executed regardless of whether or not the configuration is set to false:
Shortcode.php
public function renderCallback($attributes, $content = null) { if (is_admin()) { return null; } $this->attributes = shortcode_atts($this->config->defaults, $attributes, $this->config->shortcode); $this->content = $this->config->doShortcodeWithinContent === true ? do_shortcode($content) : $content; return $this->render(); }
Custom Shortcode
return [ 'autoload' => true, 'classname' => '', 'config' => [ 'shortcode' => 'section', 'defaults' => [ 'link' => '#', 'thumbnail' => '#', 'header_tag' => 'h3', 'title' => '', 'button_title' => 'Access Now', ], 'doShortcodeWithinContent' => false, 'view' => $rootPath . 'src/Shortcode/views/section.php', ], ];
SidebarRegister.php
protected function initEvents() { add_action('init', [$this, 'run'], 20); //add_filter('widget_text', 'do_shortcode'); }
Is this behavior expected since WP 4.9?
https://make.wordpress.org/core/2017/10/24/widget-improvements-in-wordpress-4-9/
@hellofromtonya
When placing a shortcode within a text widget, it always executed regardless of whether or not the configuration is set to false:
Shortcode.php
Custom Shortcode
SidebarRegister.php
Is this behavior expected since WP 4.9?
https://make.wordpress.org/core/2017/10/24/widget-improvements-in-wordpress-4-9/