WC_Plugins_Screen_Updates::plugin_screen_modal_js() public WC 1.0
JS for the modal window on the plugins screen.
{} Это метод класса: WC_Plugins_Screen_Updates{}
Хуков нет.
Возвращает
Null. Ничего.
Использование
$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 WC 5.0.0
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();
}