• Marco Chiesi

    (@marcochiesi)


    Hi there,
    I noticed that the “Insert Shortcode” button only works with post “content” editors, but not for visual editor used for other types of wysiwyg content, i.e. provided by 3rd party plugins like widgets, custom fields, etc.
    That’s because of the hard coded content id. In other words the button method attached to the media_buttons hook in file generator.php doesn’t consider the input parameter passed by WordPress, which is a string with the textarea id. The method uses an array as input instead. I made a slight modification to handle correctly the targetting of the Insert Shortcode button, and that should work both with string and array inputs:

    $target = is_string( $args )? $args : 'content';
    // Prepare args
    $args = wp_parse_args( $args, array(
    	'target'    => $target,
    	'text'      => __( 'Insert shortcode', 'su' ),
    	'class'     => 'button',
    	'icon'      => plugins_url( 'assets/images/icon.png', SU_PLUGIN_FILE ),
    	'echo'      => true,
    	'shortcode' => false
    ) );

    I hope that you can include this fix, or something equivalent, in the next release. Thank you.

    https://wordpress.org/plugins/shortcodes-ultimate/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Enhance compatibility with other plugins’ is closed to new replies.