Last active
March 8, 2020 04:11
-
-
Save wpmudev-sls/7aba5a8ee588546f11499c48ee5c81a4 to your computer and use it in GitHub Desktop.
[Smush Pro] - Fix Smush js issue on some custom post types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: [Smush Pro] - Fix js issue on some custom post type | |
* Description: [Smush Pro] - Fix js issue on some custom post type | |
* Task: 0/14491813218786/1163872180255562 - 0/11289012348292/1165043060257949 | |
* Author: Thobk @ WPMUDEV | |
* Author URI: https://premium.wpmudev.org | |
* License: GPLv2 or later | |
*/ | |
if ( ! defined( 'ABSPATH' ) ) { exit; } elseif ( defined( 'WP_CLI' ) && WP_CLI ) { return; } | |
add_action( 'wp_smush_enqueue', 'wpmudev_smush_fix_conflict_js_on_some_custom_post_type_func', 99 ); | |
function wpmudev_smush_fix_conflict_js_on_some_custom_post_type_func( $status ){ | |
global $post_type; | |
if( ! empty( $post_type ) && 'attachment' !== $post_type ){ | |
return false; | |
} | |
return $status; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment