| 1 |
<?php |
| 2 |
/** |
| 3 |
* Deprecated Extensions. |
| 4 |
* |
| 5 |
* @since v3.1.0 |
| 6 |
* |
| 7 |
* @package ghostkit |
| 8 |
*/ |
| 9 |
|
| 10 |
if ( ! defined( 'ABSPATH' ) ) { |
| 11 |
exit; |
| 12 |
} |
| 13 |
|
| 14 |
/** |
| 15 |
* Class GhostKit_Deprecated_Extensions |
| 16 |
*/ |
| 17 |
class GhostKit_Deprecated_Extensions { |
| 18 |
/** |
| 19 |
* GhostKit_Deprecated_Extensions constructor. |
| 20 |
*/ |
| 21 |
public function __construct() { |
| 22 |
add_action( 'init', array( $this, 'register_attributes' ), 20 ); |
| 23 |
} |
| 24 |
|
| 25 |
/** |
| 26 |
* Register deprecated attributes in all blocks. |
| 27 |
*/ |
| 28 |
public function register_attributes() { |
| 29 |
$block_registry = WP_Block_Type_Registry::get_instance(); |
| 30 |
$registered_block_types = $block_registry->get_all_registered(); |
| 31 |
|
| 32 |
foreach ( $registered_block_types as $block_type ) { |
| 33 |
if ( ! ( $block_type instanceof WP_Block_Type ) ) { |
| 34 |
continue; |
| 35 |
} |
| 36 |
if ( ! $block_type->attributes ) { |
| 37 |
$block_type->attributes = array(); |
| 38 |
} |
| 39 |
|
| 40 |
$block_type->attributes['ghostkitId'] = array( |
| 41 |
'type' => 'string', |
| 42 |
); |
| 43 |
|
| 44 |
$block_type->attributes['ghostkitClassname'] = array( |
| 45 |
'type' => 'string', |
| 46 |
); |
| 47 |
|
| 48 |
$block_type->attributes['ghostkitStyles'] = array( |
| 49 |
'type' => 'object', |
| 50 |
); |
| 51 |
|
| 52 |
$block_type->attributes['ghostkitSR'] = array( |
| 53 |
'type' => 'string', |
| 54 |
); |
| 55 |
|
| 56 |
$block_type->attributes['ghostkitCustomCSS'] = array( |
| 57 |
'type' => 'string', |
| 58 |
); |
| 59 |
|
| 60 |
$block_type->attributes['ghostkitPosition'] = array( |
| 61 |
'type' => 'object', |
| 62 |
); |
| 63 |
|
| 64 |
$block_type->attributes['ghostkitSpacings'] = array( |
| 65 |
'type' => 'object', |
| 66 |
); |
| 67 |
|
| 68 |
$block_type->attributes['ghostkitFrame'] = array( |
| 69 |
'type' => 'object', |
| 70 |
); |
| 71 |
} |
| 72 |
} |
| 73 |
} |
| 74 |
|
| 75 |
new GhostKit_Deprecated_Extensions(); |
| 76 |
|
| 77 |
|
| 78 |
require_once ghostkit()->plugin_path . 'gutenberg/extend/deprecated/styles/index.php'; |
| 79 |
require_once ghostkit()->plugin_path . 'gutenberg/extend/deprecated/custom-css/index.php'; |
| 80 |
require_once ghostkit()->plugin_path . 'gutenberg/extend/deprecated/scroll-reveal/index.php'; |
| 81 |
|