Skip to content

Commit

Permalink
fix rest
Browse files Browse the repository at this point in the history
  • Loading branch information
matipojo committed Jan 26, 2025
1 parent 49b02e7 commit 44df0ec
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions modules/wp-rest/classes/elementor-post-meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ public function register(): void {
$post_types = get_post_types_by_support( 'elementor' );

foreach ( $post_types as $post_type ) {
register_meta( $post_type, '_elementor_edit_mode', [
register_meta( 'post', '_elementor_edit_mode', [
'single' => true,
'object_subtype' => $post_type,
'show_in_rest' => [
'schema' => [
'title' => 'Elementor edit mode',
Expand All @@ -32,8 +33,9 @@ public function register(): void {

$document_types = Plugin::$instance->documents->get_document_types();

register_meta( $post_type, '_elementor_template_type', [
register_meta( 'post', '_elementor_template_type', [
'single' => true,
'object_subtype' => $post_type,
'show_in_rest' => [
'schema' => [
'title' => 'Elementor template type',
Expand All @@ -47,8 +49,9 @@ public function register(): void {
'auth_callback' => [ $this, 'check_edit_permission' ],
]);

register_meta( $post_type, '_elementor_data', [
register_meta( 'post', '_elementor_data', [
'single' => true,
'object_subtype' => $post_type,
'show_in_rest' => [
'schema' => [
'title' => 'Elementor data',
Expand All @@ -61,8 +64,9 @@ public function register(): void {
'auth_callback' => [ $this, 'check_edit_permission' ],
]);

register_meta( $post_type, '_elementor_page_settings', [
register_meta( 'post', '_elementor_page_settings', [
'single' => true,
'object_subtype' => $post_type,
'show_in_rest' => [
'schema' => [
'title' => 'Elementor page settings',
Expand All @@ -84,7 +88,8 @@ public function register(): void {
]);

if ( Utils::has_pro() ) {
register_meta( $post_type, '_elementor_conditions', [
register_meta( 'post', '_elementor_conditions', [
'object_subtype' => $post_type,
'type' => 'object',
'title' => 'Elementor conditions',
'description' => 'Elementor conditions',
Expand Down

0 comments on commit 44df0ec

Please sign in to comment.