WC_Plugins_Screen_Updates::plugin_screen_modal_js()
JS for the modal window on the plugins screen.
Contents
Description Description
Source Source
File: includes/admin/plugin-updates/class-wc-plugins-screen-updates.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.click(); }); $( '#wc_untested_extensions_modal .cancel' ).on( 'click', function( evt ) { evt.preventDefault(); tb_remove(); }); })( jQuery ); </script> <?php $this->generic_modal_js(); }