| @@ -97,9 +97,9 @@ | ||
| 97 | 97 | // Handle save post. |
| 98 | 98 | add_action( 'save_post_' . $this->post_type, [ $this, 'save_post' ], 10, 2 ); |
| 99 | 99 | |
| 100 | 100 | // Clear the transient cache on upgraded. |
| 101 | - add_action( 'cbb_version_upgraded', [ $this, 'clear_transient_cache' ] ); | |
| 101 | + add_action( 'cbb/version_upgraded', [ $this, 'clear_transient_cache' ] ); | |
| 102 | 102 | |
| 103 | 103 | // Enqueue styles for the iframe editor. |
| 104 | 104 | add_filter( 'block_editor_settings_all', [ $this, 'enqueue_style_for_the_editor' ] ); |
| 105 | 105 | |
| @@ -123,10 +123,12 @@ | ||
| 123 | 123 | 'rest_base' => 'boldblocks-variations', |
| 124 | 124 | 'show_in_menu' => 'edit.php?post_type=boldblocks_block', |
| 125 | 125 | 'show_in_admin_bar' => false, |
| 126 | 126 | 'capabilities' => array( |
| 127 | - 'create_posts' => 'do_not_allow', | |
| 128 | - 'edit_posts' => 'manage_options', | |
| 127 | + 'create_posts' => 'do_not_allow', | |
| 128 | + 'edit_posts' => 'manage_options', | |
| 129 | + 'edit_others_posts' => 'manage_options', | |
| 130 | + 'delete_posts' => 'manage_options', | |
| 129 | 131 | ), |
| 130 | 132 | 'map_meta_cap' => true, |
| 131 | 133 | ], |
| 132 | 134 | [ |
| @@ -375,9 +377,9 @@ | ||
| 375 | 377 | |
| 376 | 378 | $custom_style_handler = $this->the_plugin_instance->get_component( CustomStyle::class ); |
| 377 | 379 | |
| 378 | 380 | $variation_posts = array_map( |
| 379 | - function( $item ) use ( $custom_style_handler ) { | |
| 381 | + function ( $item ) use ( $custom_style_handler ) { | |
| 380 | 382 | $variation_name = get_post_meta( $item->ID, 'boldblocks_variation_name', true ); |
| 381 | 383 | $variation_class = 'is-style-' . str_replace( '/', '-', $variation_name ); |
| 382 | 384 | |
| 383 | 385 | $custom_style = get_post_meta( $item->ID, 'boldblocks_variation_custom_style', true ); |
| @@ -392,16 +394,16 @@ | ||
| 392 | 394 | 'title' => $item->post_title, |
| 393 | 395 | 'postContent' => $item->post_content, |
| 394 | 396 | 'description' => get_post_meta( $item->ID, 'boldblocks_variation_description', true ), |
| 395 | 397 | 'blockIcon' => get_post_meta( $item->ID, 'boldblocks_variation_icon', true ), |
| 396 | - 'isDefault' => ! ! get_post_meta( $item->ID, 'boldblocks_variation_is_default', true ), | |
| 397 | - 'isTransformable' => ! ! get_post_meta( $item->ID, 'boldblocks_variation_is_transformable', true ), | |
| 398 | - 'hideFromInserter' => ! ! get_post_meta( $item->ID, 'boldblocks_variation_hide_from_inserter', true ), | |
| 398 | + 'isDefault' => (bool) get_post_meta( $item->ID, 'boldblocks_variation_is_default', true ), | |
| 399 | + 'isTransformable' => (bool) get_post_meta( $item->ID, 'boldblocks_variation_is_transformable', true ), | |
| 400 | + 'hideFromInserter' => (bool) get_post_meta( $item->ID, 'boldblocks_variation_hide_from_inserter', true ), | |
| 399 | 401 | 'variationData' => get_post_meta( $item->ID, 'boldblocks_variation_data', true ), |
| 400 | 402 | 'dependentBlocks' => get_post_meta( $item->ID, 'boldblocks_variation_dependent_blocks', true ), |
| 401 | 403 | 'variationClass' => $variation_class, |
| 402 | 404 | 'custom_style' => $custom_style, |
| 403 | - 'enable_block_style' => ! ! get_post_meta( $item->ID, 'boldblocks_variation_enable_style', true ), | |
| 405 | + 'enable_block_style' => (bool) get_post_meta( $item->ID, 'boldblocks_variation_enable_style', true ), | |
| 404 | 406 | ]; |
| 405 | 407 | }, |
| 406 | 408 | $raw_posts |
| 407 | 409 | ); |
| @@ -597,9 +599,8 @@ | ||
| 597 | 599 | default: |
| 598 | 600 | break; |
| 599 | 601 | } |
| 600 | 602 | } |
| 601 | - | |
| 602 | 603 | } |
| 603 | 604 | |
| 604 | 605 | /** |
| 605 | 606 | * Add filters for custom variation columns |