Skip to content

Commit

Permalink
Merge pull request #1197 from vektor-inc/develop
Browse files Browse the repository at this point in the history
[ Change version ] 1.33.0.0
  • Loading branch information
kurudrive authored May 3, 2022
2 parents f4f7b31 + df21ad6 commit fe1cfe2
Show file tree
Hide file tree
Showing 13 changed files with 596 additions and 523 deletions.
21 changes: 21 additions & 0 deletions inc/vk-blocks/admin/admin-license.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php
/**
* VK Blocks License Setting
*
* @package VK Blocks
*/

$vk_blocks_options = vk_blocks_get_options();
?>

<section>
<h3 id="license-setting"><?php esc_html_e( 'License key', 'vk-blocks' ); ?></h3>
<p><?php esc_html_e( 'Enter a valid Lightning G3 Pro Pack or Lightning Pro license key.', 'vk-blocks' ); ?></p>
<p><?php esc_html_e( 'Once you enter the license key you will be able to do a one click update from the administration screen.', 'vk-blocks' ); ?></p>
<label for="vk-blocks-pro-license-key">
<strong><?php echo esc_html_e( 'License key', 'vk-blocks' ); ?></strong>
</label>
<input type="text" id="vk-blocks-pro-license-key" name="vk_blocks_options[vk_blocks_pro_license_key]" size="10" value="<?php echo esc_html( isset( $vk_blocks_options['vk_blocks_pro_license_key'] ) ? $vk_blocks_options['vk_blocks_pro_license_key'] : '' ); ?>">

<?php submit_button(); ?>
</section>
33 changes: 25 additions & 8 deletions inc/vk-blocks/admin/admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,18 @@
*/

if ( ! function_exists( 'vk_blocks_setting' ) ) {

/**
* Check need license environment
*
* @return bool
*/
function vk_blocks_is_license_setting() {
if ( vk_blocks_is_pro() && wp_get_theme()->Template !== 'katawara' ) {
return true;
}
}

/**
* VK Blocks Setting
*
Expand All @@ -21,6 +33,9 @@ function vk_blocks_setting() {
<form method="post" action="">
<?php wp_nonce_field( 'vkb-nonce-key', 'vkb-setting-page' ); ?>
<?php
if ( vk_blocks_is_license_setting() ) {
require_once dirname( __FILE__ ) . '/admin-license.php';
}
require_once dirname( __FILE__ ) . '/admin-balloon.php';
require_once dirname( __FILE__ ) . '/admin-margin.php';
require_once dirname( __FILE__ ) . '/admin-load-separate.php';
Expand All @@ -45,11 +60,11 @@ function vk_blocks_setting() {
function vk_blocks_setting_menu() {
global $vk_blocks_prefix;
$custom_page = add_options_page(
$vk_blocks_prefix . ' ' . __( 'Blocks setting', 'vk-blocks' ), // Name of page
$vk_blocks_prefix . ' ' . _x( 'Blocks', 'label in admin menu', 'vk-blocks' ), // Label in menu
'edit_theme_options', // Capability required このメニューページを閲覧・使用するために最低限必要なユーザーレベルまたはユーザーの種類と権限
'vk_blocks_options', // ユニークなこのサブメニューページの識別子
'vk_blocks_setting_page' // メニューページのコンテンツを出力する関数
$vk_blocks_prefix . ' ' . __( 'Blocks setting', 'vk-blocks' ), // Name of page.
$vk_blocks_prefix . ' ' . _x( 'Blocks', 'label in admin menu', 'vk-blocks' ), // Label in menu.
'edit_theme_options', // Capability required このメニューページを閲覧・使用するために最低限必要なユーザーレベルまたはユーザーの種類と権限.
'vk_blocks_options', // ユニークなこのサブメニューページの識別子.
'vk_blocks_setting_page' // メニューページのコンテンツを出力する関数.
);
if ( ! $custom_page ) {
return;
Expand All @@ -67,7 +82,10 @@ function vk_blocks_setting_page() {
$get_logo_html = '<img src="' . plugin_dir_url( __FILE__ ) . '/images/vk-blocks-logo_ol.svg" alt="VK Blocks" />';
$get_logo_html = apply_filters( 'vk_blocks_logo_html', $get_logo_html );

$get_menu_html = '';
$get_menu_html = '';
if ( vk_blocks_is_license_setting() ) {
$get_menu_html .= '<li><a href="#license-setting">' . __( 'License Key', 'vk-blocks' ) . '</a></li>';
}
$get_menu_html .= '<li><a href="#balloon-setting">' . __( 'Balloon Block Setting', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#margin-setting">' . __( 'Common Margin Setting', 'vk-blocks' ) . '</a></li>';
$get_menu_html .= '<li><a href="#load-separete-setting">' . __( 'Load Separete Setting', 'vk-blocks' ) . '</a></li>';
Expand All @@ -85,7 +103,7 @@ function vk_blocks_setting_option_save() {
&& wp_verify_nonce( sanitize_key( $_POST['vkb-setting-page'] ), 'vkb-nonce-key' )
) {
if ( check_admin_referer( 'vkb-nonce-key', 'vkb-setting-page' ) ) {
// 保存処理
// 保存処理.
if (
isset( $_POST['vk_blocks_balloon_meta'], $_POST['vkb-setting-page'] )
&& wp_verify_nonce( sanitize_key( $_POST['vkb-setting-page'] ), 'vkb-nonce-key' )
Expand All @@ -112,7 +130,6 @@ function vk_blocks_setting_option_save() {
}
}
}
// wp_safe_redirect( menu_page_url( 'vk_blocks_options', false ) );
}
add_action( 'admin_init', 'vk_blocks_setting_option_save', 10, 2 );

Expand Down

Large diffs are not rendered by default.

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

0 comments on commit fe1cfe2

Please sign in to comment.