mirror of
https://gh.wpcy.net/https://github.com/mainwp/Code-Snippets-Functions.git
synced 2026-05-02 12:02:25 +08:00
18 lines
574 B
Text
18 lines
574 B
Text
add_action( 'wp_enqueue_scripts', 'aws_wp_enqueue_scripts', 999 );
|
|
function aws_wp_enqueue_scripts() {
|
|
|
|
$script = '
|
|
function aws_show_modal_layout( show, options ) {
|
|
var width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
|
|
if ( width <= 1024 ) {
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
AwsHooks.add_filter( "aws_show_modal_layout", aws_show_modal_layout );
|
|
';
|
|
|
|
wp_add_inline_script( 'aws-script', $script);
|
|
wp_add_inline_script( 'aws-pro-script', $script);
|
|
|
|
}
|