| 1 |
<?php |
| 2 |
|
| 3 |
/* |
| 4 |
* This file is part of the WindPress package. |
| 5 |
* |
| 6 |
* (c) Joshua Gugun Siagian <suabahasa@gmail.com> |
| 7 |
* |
| 8 |
* For the full copyright and license information, please view the LICENSE |
| 9 |
* file that was distributed with this source code. |
| 10 |
*/ |
| 11 |
declare (strict_types=1); |
| 12 |
namespace WindPress\WindPress\Integration\GreenShift; |
| 13 |
|
| 14 |
/** |
| 15 |
* @author Joshua Gugun Siagian <suabahasa@gmail.com> |
| 16 |
*/ |
| 17 |
class Compile |
| 18 |
{ |
| 19 |
public function __invoke() |
| 20 |
{ |
| 21 |
if (!\defined('GREENSHIFT_DIR_PATH')) { |
| 22 |
return; |
| 23 |
} |
| 24 |
\add_filter('f!windpress/integration/gutenberg/compile:get_contents.post_types', fn(array $post_types): array => $this->get_post_types($post_types)); |
| 25 |
} |
| 26 |
/** |
| 27 |
* @param array $post_types |
| 28 |
*/ |
| 29 |
public function get_post_types($post_types) : array |
| 30 |
{ |
| 31 |
$post_types[] = 'wp_block'; |
| 32 |
return $post_types; |
| 33 |
} |
| 34 |
} |
| 35 |
|