Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpmudev-sls/7aba5a8ee588546f11499c48ee5c81a4 to your computer and use it in GitHub Desktop.
Save wpmudev-sls/7aba5a8ee588546f11499c48ee5c81a4 to your computer and use it in GitHub Desktop.
[Smush Pro] - Fix Smush js issue on some custom post types
<?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