WC_Plugins_Screen_Updates::plugin_screen_modal_js()
JS for the modal window on the plugins screen.
Method of the class: WC_Plugins_Screen_Updates{}
No Hooks.
Return
null
. Nothing (null).
Usage
$WC_Plugins_Screen_Updates = new WC_Plugins_Screen_Updates(); $WC_Plugins_Screen_Updates->plugin_screen_modal_js();
WC_Plugins_Screen_Updates::plugin_screen_modal_js() WC Plugins Screen Updates::plugin screen modal js code WC 9.6.1
<?php public function plugin_screen_modal_js() { ?> <script> ( function( $ ) { var $update_box = $( '#woocommerce-update' ); var $update_link = $update_box.find('a.update-link').first(); var update_url = $update_link.attr( 'href' ); // Set up thickbox. $update_link.removeClass( 'update-link' ); $update_link.addClass( 'wc-thickbox' ); $update_link.attr( 'href', '#TB_inline?height=600&width=550&inlineId=wc_untested_extensions_modal' ); // Trigger the update if the user accepts the modal's warning. $( '#wc_untested_extensions_modal .accept' ).on( 'click', function( evt ) { evt.preventDefault(); tb_remove(); $update_link.removeClass( 'wc-thickbox open-plugin-details-modal' ); $update_link.addClass( 'update-link' ); $update_link.attr( 'href', update_url ); $update_link.trigger( 'click' ); }); $( '#wc_untested_extensions_modal .cancel' ).on( 'click', function( evt ) { evt.preventDefault(); tb_remove(); }); })( jQuery ); </script> <?php $this->generic_modal_js(); }