| 1 |
<?php |
| 2 |
/** |
| 3 |
* Custom css block. |
| 4 |
* |
| 5 |
* @package ghostkit |
| 6 |
*/ |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; |
| 10 |
} |
| 11 |
|
| 12 |
/** |
| 13 |
* Class GhostKit_Custom_CSS_Block |
| 14 |
*/ |
| 15 |
class GhostKit_Custom_CSS_Block { |
| 16 |
/** |
| 17 |
* GhostKit_Custom_CSS_Block constructor. |
| 18 |
*/ |
| 19 |
public function __construct() { |
| 20 |
add_action( 'init', array( $this, 'register_meta' ) ); |
| 21 |
} |
| 22 |
|
| 23 |
/** |
| 24 |
* Register meta. |
| 25 |
*/ |
| 26 |
public function register_meta() { |
| 27 |
register_meta( 'post', 'ghostkit_custom_css', array( |
| 28 |
'show_in_rest' => true, |
| 29 |
'single' => true, |
| 30 |
'type' => 'string', |
| 31 |
) ); |
| 32 |
} |
| 33 |
} |
| 34 |
new GhostKit_Custom_CSS_Block(); |
| 35 |
|