Skip to content

Commit

Permalink
Update from vk-blocks-pro
Browse files Browse the repository at this point in the history
  • Loading branch information
vektorinc committed Dec 20, 2023
1 parent 679c430 commit b963e60
Show file tree
Hide file tree
Showing 18 changed files with 557 additions and 195 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"vektor-inc/vk-admin": "^0.4.1",
"vektor-inc/vk-color-palette-manager": "^0.4.0",
"vektor-inc/vk-breadcrumb": "^0.2.5",
"vektor-inc/vk-term-color": "^0.6.6",
"vektor-inc/vk-term-color": "^0.7.1",
"vektor-inc/vk-css-optimize": "^0.2.0"
},
"require-dev": {
Expand Down
177 changes: 117 additions & 60 deletions composer.lock

Large diffs are not rendered by default.

35 changes: 35 additions & 0 deletions inc/vk-blocks/App/RestAPI/BlockMeta/class-vk-blocks-entrypoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
* @package vk_blocks
*/

use VektorInc\VK_Term_Color\VkTermColor;

/**
* Vk_Blocks_EntryPoint
*/
Expand Down Expand Up @@ -42,6 +44,19 @@ public function vk_blocks_rest_api_init() {
),
)
);
register_rest_route(
'vk-blocks/v1',
'/get_post_single_term_info',
array(
array(
'methods' => 'POST',
'callback' => array( $this, 'get_post_single_term_info' ),
'permission_callback' => function () {
return current_user_can( 'edit_theme_options' );
},
),
)
);
}

/**
Expand Down Expand Up @@ -70,4 +85,24 @@ public function update_vk_blocks_options( $request ) {
)
);
}

/**
* VK Term Color Callback
*
* @param object $request — .
* @return \WP_REST_Response|\WP_Error
*/
public function get_post_single_term_info( $request ) {

$args = array();
if ( $request->get_param( 'taxonomy' ) ) {
$args['taxonomy'] = $request->get_param( 'taxonomy' );
}

$result = VkTermColor::get_post_single_term_info( $request->get_param( 'post_id' ), $args );
if ( is_null( $result ) ) {
return rest_ensure_response( array( 'error' => 'not found' ) );
}
return rest_ensure_response( $result );
}
}
4 changes: 4 additions & 0 deletions inc/vk-blocks/class-vk-blocks-global-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ public static function blocks() {
'name' => 'post-new-badge',
'is_pro' => true,
),
array(
'name' => 'post-category-badge',
'is_pro' => true,
),
array(
'name' => 'select-post-list',
'is_pro' => true,
Expand Down
2 changes: 1 addition & 1 deletion languages/vk-blocks-pro-ja-vk-blocks-admin-js.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion languages/vk-blocks-pro-ja-vk-blocks-build-js.json

Large diffs are not rendered by default.

Binary file modified languages/vk-blocks-pro-ja.mo
Binary file not shown.
Loading

0 comments on commit b963e60

Please sign in to comment.