define_constants(); add_filter( 'gutenberg_can_edit_post_type', array( $this, 'can_edit_post_type' ), 10, 2 ); } /** * Define constants. */ private function define_constants() { if ( !defined( 'SP_GUTENBERG_VERSION' ) ) define( 'SP_GUTENBERG_VERSION', '2.6.9' ); if ( !defined( 'SP_GUTENBERG_URL' ) ) define( 'SP_GUTENBERG_URL', plugin_dir_url( __FILE__ ) ); if ( !defined( 'SP_GUTENBERG_DIR' ) ) define( 'SP_GUTENBERG_DIR', plugin_dir_path( __FILE__ ) ); } /** * Modify Gutenberg behavior for custom post types. */ function can_edit_post_type( $enabled, $post_type ) { return is_sp_post_type( $post_type ) ? false : $enabled; } } endif; new SportsPress_Gutenberg();