Custom button(from different plugin) in EA Advanced accordion widget
-
Hi!
Thank you for such an awesome plugin.
I was wondering if there is way to add a custom button in one of the widgets(EA Advanced Accordion widget)
I wanted to add a button( from a different plugin-document gallery) which appears in the classic editor but I want it in the EA Advanced accordion widget as well. From the support forums of the document gallery plugin, I found out that to insert that button in the classic editor, we need to paste the code in the functions.php file of the wordpress theme. But I don’t exactly know where to paste the code so that the button appears in the elementor addon widget. The code is as follows:function dg_specific_button_js() { ?> <script type="text/javascript"> function open_dg_tab() { if ( this.frame === undefined ) { if ( wp.media.frame !== undefined && jQuery.inArray(wp.media.frame.state().id, ['dg', 'dg-edit', 'dg-library'])<0 ) { wp.media.frame.setState('dg'); } var options = { frame: 'post', state: 'dg', title: DGl10n.dgMenuTitle, multiple: true }; this.frame = wp.media.editor.open(null, options); } else { if ( jQuery.inArray(this.frame.state().id, ['dg', 'dg-edit', 'dg-library'])<0 ) { this.frame.setState('dg'); } this.frame.open(); } return false; } jQuery(document).ready( function() { if ( typeof wp.media.collection !== 'function' ) return; jQuery('#dg-specific-button').removeAttr('disabled').click(open_dg_tab); } ); </script> <?php } function dg_check_page_type( $hook ) { if ( in_array( $hook, array( 'post.php', 'post-new.php' ), true ) ) { function dg_add_specific_button() { echo '<button id="dg-specific-button" class="button" disabled>'.__( 'Create Document Gallery', 'document-gallery' ).'</button>'; } add_action('media_buttons', 'dg_add_specific_button'); add_action('admin_print_footer_scripts', 'dg_specific_button_js'); } } add_action('admin_enqueue_scripts', 'dg_check_page_type');Thank you and sorry for the trouble.
The topic ‘Custom button(from different plugin) in EA Advanced accordion widget’ is closed to new replies.