Tagged: magic wand, shortcode
-
AuthorPosts
-
October 12, 2021 at 4:20 pm #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
October 13, 2021 at 9:59 am #1324705Hey 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,
IsmaelOctober 14, 2021 at 9:26 am #1324875Hi
Thank you, I’have checked. My request is to unset some of the item, not the magic wand. Any solution ?October 14, 2021 at 9:35 am #1324877Hi!
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,
IsmaelOctober 14, 2021 at 10:06 am #1324887Hi, I tried, doesn’t work.
To remove the shortcode I do thisfunction 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
October 14, 2021 at 4:47 pm #1324973I proceed by removing default toolbar and add cutom button to rebuild avia shortcode inserter.
October 17, 2021 at 4:41 pm #1325313Hi,
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 -
AuthorPosts
- The topic ‘Remove the shortcodes list in TinyMCE’ is closed to new replies.