Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1324619

    Hi

    I checked this topic for adding item https://kriesi.at/support/topic/modify-the-shortcodes-list-in-a-text-block/?login_error#top
    But I cannot find a way to deregister an existing/default item on this magic wand.

    Some one maybe have already answer this request.

    Thanks

    #1324705

    Hey Erdrol,

    Thank you for the inquiry.

    This is possible but you will have to modify the config-templatebuilder/avia-template-builder/php/class-template-builder.php file and look this code around line 1713.

    	//create tiny mce button
    			$tiny = array(
    						'id'				=> 'avia_builder_button',
    						'title'				=> __( 'Insert Theme Shortcode', 'avia_framework' ),
    						'image'				=> $this->paths['imagesURL'] . 'tiny-button.png',
    						'js_plugin_file'	=> $this->paths['assetsURL'] . 'js/avia-tinymce-buttons.js',
    						'shortcodes'		=> array_map( array( $this, 'fetch_configs' ), $this->shortcode_class )
    					);
    

    To remove a specific shortcode, just use the unset function to remove an entry in the $tiny[“shortcodes”] array. Add this line below the code.

    unset($tiny["shortcodes"]["avia_sc_button"]);
    

    This will remove the button element from the shortcode magic wand.

    Best regards,
    Ismael

    #1324875

    Hi
    Thank you, I’have checked. My request is to unset some of the item, not the magic wand. Any solution ?

    #1324877

    Hi!

    Thank you for the update.

    The modification above should only unset or remove the button element, not the magic wand. Did you try it? You may need to toggle or temporarily disable the Performance > File Compression settings after adding the code.

    Best regards,
    Ismael

    #1324887

    Hi, I tried, doesn’t work.
    To remove the shortcode I do this

    
    function remove_shortcodes() {
    /**
     * Array of shortcodes you want to remove
     * The values of this array should match the shortcode under which the elements are registered
     * Usually, you can find them in your shortcode files under $this->config['shortcode'].
     */
    $shortcodes = array('av_button');
    $shortcodes = array('av_blog');
    
    /**
     * Accepts an array of shortcodes and whether to remove these shortcodes (true) or not (false)
     */
    if( class_exists('ShortcodeHelper') ) {
      ShortcodeHelper::allowed_shortcodes($shortcodes, true); 
    }
    }
    add_action('init', 'remove_shortcodes');

    But i’m looking to trigger this only when TinyMCE is loaded. Currently is completely removed even in ALB.

    Regards

    #1324973

    I proceed by removing default toolbar and add cutom button to rebuild avia shortcode inserter.

    #1325313

    Hi,
    Thank you for the update perhaps others will also find this modification helpful. If you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.

    Best regards,
    Mike

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Remove the shortcodes list in TinyMCE’ is closed to new replies.