• Shortcodes used in widgets in a panel cannot be fixed (stripping extra <p> and
    tags) via the “the_content” filter.

    Please consider incorporating the following code to the plugin as an optional setting:

    /* Page builder shortcode fix in widget text */
    add_filter( 'siteorigin_panels_data', 'mysite_fix_shortcodes', 1, 2 );
    function mysite_fix_shortcodes( $panels_data, $post_id ){
    	$array = array (
    		'<p>[' => '[',
    		']</p>' => ']',
    		']<br />' => ']'
    	);
    
    	if( is_array( $panels_data ) and !empty( $panels_data ) ) {
    		foreach( $panels_data['widgets'] as &$widget ) {
    			$widget['text'] = strtr( $widget['text'], $array );
    		}
    	}
    
    	return $panels_data;
    }

    https://ww.wp.xz.cn/plugins/siteorigin-panels/

The topic ‘Shortcode fix for widget text’ is closed to new replies.