PluginProbe
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts / trunk
Woody Code Snippets – Insert PHP, CSS, JS, and Header/Footer Scripts vtrunk
2.7.7 2.7.6 2.7.5 2.7.4 trunk 1.3 2.0.4 2.0.6 2.1.91 2.2.4 2.2.7 2.2.9 2.3.1 2.3.10 2.4.10 2.4.2 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.6.0 2.6.1 2.7.0 All 28 releases
← All changes | includes/shortcodes/shortcodes.php +12 -3 2.7.4trunk View file →
@@ -80,11 +80,20 @@
80 80 *
81 81 * @return string
82 82 */
83 83 public function render( $attr, $content, $tag ) {
84 + if ( WINP_Helper::is_safe_mode() ) {
85 + return '';
86 + }
87 +
84 88 ob_start();
85 - $this->html( $attr, $content ?? '', $tag );
86 - $html = ob_get_clean();
89 + $result = $this->html( $attr, $content ?? '', $tag );
90 + $html = ob_get_clean();
91 +
92 + if ( is_string( $result ) ) {
93 + $html = ( false !== $html ? $html : '' ) . $result;
94 + }
95 +
87 96 return false !== $html ? $html : '';
88 97 }
89 98
90 99 /**
@@ -226,9 +235,9 @@
226 235 * @param array<string, mixed> $attr Shortcode attributes.
227 236 * @param string $content Shortcode content.
228 237 * @param string $tag Shortcode tag.
229 238 *
230 - * @return void
239 + * @return mixed Rendered content when returned directly, if any.
231 240 */
232 241 public function html( $attr, $content, $tag ) {
233 242 }
234 243 }