| 1 |
<?php |
| 2 |
/** |
| 3 |
* Cooked Gutenberg Functions |
| 4 |
* |
| 5 |
* @package Cooked |
| 6 |
* @subpackage Gutenberg Functions |
| 7 |
* @since 1.5.2 |
| 8 |
*/ |
| 9 |
|
| 10 |
// Exit if accessed directly |
| 11 |
if ( ! defined( 'ABSPATH' ) ) exit; |
| 12 |
|
| 13 |
/** |
| 14 |
* Cooked_Gutenberg Class |
| 15 |
* |
| 16 |
* This class handles the Cooked Recipe Meta Box creation. |
| 17 |
* |
| 18 |
* @since 1.5.2 |
| 19 |
*/ |
| 20 |
class Cooked_Gutenberg { |
| 21 |
|
| 22 |
public function __construct() { |
| 23 |
add_filter( 'use_block_editor_for_post_type', [&$this, 'gutenberg_support'], 10, 2 ); |
| 24 |
add_filter( 'gutenberg_can_edit_post_type', [&$this, 'gutenberg_support'], 10, 2 ); |
| 25 |
} |
| 26 |
|
| 27 |
public function gutenberg_support( $can_edit, $post_type ) { |
| 28 |
if ( $post_type == 'cp_recipe' ) |
| 29 |
return false; |
| 30 |
|
| 31 |
return $can_edit; |
| 32 |
} |
| 33 |
|
| 34 |
} |