Last active
May 25, 2018 05:37
-
-
Save aiiddqd/b99ef36aabab1ff641414e593e73d040 to your computer and use it in GitHub Desktop.
Disable Gutenberg support for CPT 'product' in WooCommerce
This file contains hidden or 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: Gutenberg - disable CPT | |
Description: Отключаем поддержку Gutenberg для постов типа Продукт | |
Author: uptimizt | |
Version: 1.0 | |
Author URI: http://wpcraft.ru | |
*/ | |
// Use hook return apply_filters( 'gutenberg_can_edit_post_type', $can_edit, $post_type ); | |
function u7_gutenberg_disable_cpt($can_edit, $post_type){ | |
if($post_type == 'product'){ | |
$can_edit = false; | |
} | |
return $can_edit; | |
} | |
add_filter('gutenberg_can_edit_post_type', 'u7_gutenberg_disable_cpt', 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment