Version Description
[ Add function ] Add role function
Download this release
Release Info
Developer | vektor-inc |
Plugin | VK Block Patterns |
Version | 0.1.0 |
Comparing to | |
See all releases |
Code changes from version 0.0.2 to 0.1.0
- admin/admin-role.php +42 -0
- admin/admin.php +83 -0
- admin/images/no-image.png +0 -0
- admin/images/vk-block-patterns-logo_ol.svg +121 -0
- inc/vk-admin/package/_scss/vk_admin.scss +372 -0
- inc/vk-admin/package/class-vk-admin.php +428 -0
- inc/vk-admin/package/config.rb +9 -0
- inc/vk-admin/package/css/vk_admin.css +1 -0
- inc/vk-admin/package/images/ExUnit_bnr.png +0 -0
- inc/vk-admin/package/images/admin_banner_recruit.jpg +0 -0
- inc/vk-admin/package/images/billvektor_banner.png +0 -0
- inc/vk-admin/package/images/fort-bnr.jpg +0 -0
- inc/vk-admin/package/images/job_banner-336_280-en.jpg +0 -0
- inc/vk-admin/package/images/job_banner-336_280-ja.jpg +0 -0
- inc/vk-admin/package/images/jpnstyle-bnr.jpg +0 -0
- inc/vk-admin/package/images/lightning-pro-bnr.jpg +0 -0
- inc/vk-admin/package/images/lightning_bnr_en.jpg +0 -0
- inc/vk-admin/package/images/lightning_bnr_ja.jpg +0 -0
- inc/vk-admin/package/images/no-image.png +0 -0
- inc/vk-admin/package/images/pale-bnr.jpg +0 -0
- inc/vk-admin/package/images/post_author_display_bnr_en.jpg +0 -0
- inc/vk-admin/package/images/post_author_display_bnr_ja.jpg +0 -0
- inc/vk-admin/package/images/variety-bnr.jpg +0 -0
- inc/vk-admin/package/images/vektor_logo.png +0 -0
- inc/vk-admin/package/images/vk-link-target-controller_bnr.jpg +0 -0
- inc/vk-admin/package/images/vk-link-target-controller_notxt_bnr.jpg +0 -0
- inc/vk-admin/package/js/vk_admin.js +159 -0
- inc/vk-admin/readme.md +5 -0
- inc/vk-admin/vk-admin-config.php +14 -0
- inc/vk-block-patterns/package/class-vk-block-patterns.php +37 -3
- languages/vk-block-patterns-ja.mo +0 -0
- languages/vk-block-patterns-ja.po +49 -0
- readme.txt +5 -1
- vk-block-patterns.php +6 -2
admin/admin-role.php
ADDED
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Role Option
|
4 |
+
*
|
5 |
+
* @package VK Block Patterns
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
$role_array = array(
|
13 |
+
array(
|
14 |
+
'label' => __( 'Contributor or higher', 'vk-block-patterns' ),
|
15 |
+
'value' => 'contributor',
|
16 |
+
),
|
17 |
+
array(
|
18 |
+
'label' => __( 'Author or higher', 'vk-block-patterns' ),
|
19 |
+
'value' => 'author',
|
20 |
+
),
|
21 |
+
array(
|
22 |
+
'label' => __( 'Editor or higher', 'vk-block-patterns' ),
|
23 |
+
'value' => 'editor',
|
24 |
+
),
|
25 |
+
array(
|
26 |
+
'label' => __( 'Administrator only', 'vk-block-patterns' ),
|
27 |
+
'value' => 'administrator',
|
28 |
+
),
|
29 |
+
);
|
30 |
+
?>
|
31 |
+
<section>
|
32 |
+
<h3 id="role-setting"><?php echo __( 'Role Setting', 'vk-block-patterns' ); ?></h3>
|
33 |
+
<?php $vbp_options = get_option( 'vk_block_patterns_options' ); ?>
|
34 |
+
<select name="vk_block_patterns_options[role]">
|
35 |
+
<?php foreach ( $role_array as $role ) : ?>
|
36 |
+
<option value="<?php echo $role['value']; ?>" <?php selected( $vbp_options['role'], $role['value'] ); ?>>
|
37 |
+
<?php echo $role['label']; ?>
|
38 |
+
</option>
|
39 |
+
<?php endforeach; ?>
|
40 |
+
</select>
|
41 |
+
<?php submit_button(); ?>
|
42 |
+
</section>
|
admin/admin.php
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Admin Page
|
4 |
+
*
|
5 |
+
* @package VK Block Patterns
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
if ( ! function_exists( 'vbp_setting' ) ) {
|
13 |
+
/**
|
14 |
+
* Admin Page Setting.
|
15 |
+
*/
|
16 |
+
function vbp_setting() {
|
17 |
+
$options = get_option( 'vk_block_patterns_options' );
|
18 |
+
?>
|
19 |
+
|
20 |
+
<form method="post" action="<?php echo esc_url( $_SERVER['REQUEST_URI'] ); ?>">
|
21 |
+
<?php
|
22 |
+
wp_nonce_field( 'vbp-nonce-key', 'vbp-setting-page' );
|
23 |
+
require_once dirname( __FILE__ ) . '/admin-role.php';
|
24 |
+
?>
|
25 |
+
</form>
|
26 |
+
<?php
|
27 |
+
}
|
28 |
+
}
|
29 |
+
|
30 |
+
$admin_pages = array( 'settings_page_vk_block_patterns_options' );
|
31 |
+
Vk_Admin::admin_scripts( $admin_pages );
|
32 |
+
|
33 |
+
/**
|
34 |
+
* Setting Menu
|
35 |
+
*/
|
36 |
+
function vbp_setting_menu() {
|
37 |
+
global $vbp_prefix;
|
38 |
+
$custom_page = add_options_page(
|
39 |
+
$vbp_prefix . __( 'Block Patterns setting', 'vk-block-patterns' ), // Name of page.
|
40 |
+
$vbp_prefix . _x( 'Block Patterns', 'label in admin menu', 'vk-block-patterns' ), // Label in menu.
|
41 |
+
'edit_theme_options', // Capability required このメニューページを閲覧・使用するために最低限必要なユーザーレベルまたはユーザーの種類と権限.
|
42 |
+
'vk_block_patterns_options', // ユニークなこのサブメニューページの識別子.
|
43 |
+
'vbp_setting_page' // メニューページのコンテンツを出力する関数.
|
44 |
+
);
|
45 |
+
if ( ! $custom_page ) {
|
46 |
+
return;
|
47 |
+
}
|
48 |
+
}
|
49 |
+
add_action( 'admin_menu', 'vbp_setting_menu' );
|
50 |
+
|
51 |
+
/**
|
52 |
+
* Setting Pqage
|
53 |
+
*/
|
54 |
+
function vbp_setting_page() {
|
55 |
+
global $vbp_prefix;
|
56 |
+
$get_page_title = $vbp_prefix . __( 'Block Patterns Setting', 'vk-block-patterns' );
|
57 |
+
|
58 |
+
$get_logo_html = '<img src="' . plugin_dir_url( __FILE__ ) . '/images/vk-block-patterns-logo_ol.svg" alt="VK Block Patterns" />';
|
59 |
+
$get_logo_html = apply_filters( 'vbp_logo_html', $get_logo_html );
|
60 |
+
|
61 |
+
$get_menu_html = '<li><a href="#role-setting">' . __( 'Role Setting', 'vk-block-patterns' ) . '</a></li>';
|
62 |
+
|
63 |
+
Vk_Admin::admin_page_frame( $get_page_title, 'vbp_setting', $get_logo_html, $get_menu_html );
|
64 |
+
}
|
65 |
+
|
66 |
+
/**
|
67 |
+
* Save Option
|
68 |
+
*/
|
69 |
+
function vbp_setting_option_save() {
|
70 |
+
if ( isset( $_POST['vk_block_patterns_options'] ) && $_POST['vk_block_patterns_options'] ) {
|
71 |
+
|
72 |
+
if ( check_admin_referer( 'vbp-nonce-key', 'vbp-setting-page' ) ) {
|
73 |
+
if ( isset( $_POST['vk_block_patterns_options'] ) && $_POST['vk_block_patterns_options'] ) {
|
74 |
+
update_option( 'vk_block_patterns_options', $_POST['vk_block_patterns_options'] );
|
75 |
+
} else {
|
76 |
+
update_option( 'vk_block_patterns_options', '' );
|
77 |
+
}
|
78 |
+
|
79 |
+
wp_safe_redirect( menu_page_url( 'vk_block_patterns_options', false ) );
|
80 |
+
}
|
81 |
+
}
|
82 |
+
}
|
83 |
+
add_action( 'admin_init', 'vbp_setting_option_save', 10, 2 );
|
admin/images/no-image.png
ADDED
Binary file
|
admin/images/vk-block-patterns-logo_ol.svg
ADDED
@@ -0,0 +1,121 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0" encoding="utf-8"?>
|
2 |
+
<!-- Generator: Adobe Illustrator 24.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
3 |
+
<svg version="1.1" id="レイヤー_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px"
|
4 |
+
y="0px" viewBox="0 0 718.3 144.9" style="enable-background:new 0 0 718.3 144.9;" xml:space="preserve">
|
5 |
+
<style type="text/css">
|
6 |
+
.st0{fill:#231815;}
|
7 |
+
.st1{fill:#D70C18;}
|
8 |
+
</style>
|
9 |
+
<g>
|
10 |
+
<g>
|
11 |
+
<path class="st0" d="M209,116c-0.2-3.6-0.4-7.9-0.3-11.7h-0.1c-0.9,3.4-2.1,7.2-3.3,10.7l-4.1,12h-3.9l-3.7-11.9
|
12 |
+
c-1.1-3.6-2.1-7.3-2.8-10.8h-0.1c-0.1,3.6-0.3,8.1-0.5,11.9l-0.6,11.2h-4.7l1.8-27.8h6.7l3.6,11.2c1,3.3,1.9,6.6,2.6,9.7h0.1
|
13 |
+
c0.7-3,1.7-6.4,2.8-9.7l3.9-11.1h6.6l1.6,27.8h-4.9L209,116z"/>
|
14 |
+
<path class="st0" d="M232.8,127.4l-0.3-2.2h-0.1c-1.2,1.6-3.3,2.7-5.9,2.7c-4.1,0-6.3-2.9-6.3-6c0-5.1,4.5-7.6,11.9-7.6v-0.3
|
15 |
+
c0-1.3-0.5-3.5-4.1-3.5c-2,0-4,0.6-5.4,1.5l-1-3.3c1.5-0.9,4.1-1.8,7.3-1.8c6.4,0,8.3,4.1,8.3,8.5v7.2c0,1.8,0.1,3.6,0.3,4.8
|
16 |
+
H232.8z M232.1,117.5c-3.6,0-7,0.7-7,3.8c0,2,1.3,2.9,2.9,2.9c2,0,3.5-1.3,4-2.8c0.1-0.4,0.1-0.8,0.1-1.1V117.5z"/>
|
17 |
+
<path class="st0" d="M249.6,116.1L249.6,116.1c0.6-0.8,1.1-1.6,1.7-2.4l4.9-6.4h6.1l-7.4,8.2l8.5,11.9h-6.2l-5.8-8.9l-1.7,2v6.8
|
18 |
+
h-5.1V98.1h5.1V116.1z"/>
|
19 |
+
<path class="st0" d="M271.1,118.7c0.1,3.6,3,5.2,6.2,5.2c2.3,0,4-0.4,5.5-0.9l0.8,3.5c-1.7,0.7-4.1,1.3-7,1.3
|
20 |
+
c-6.5,0-10.3-4-10.3-10.2c0-5.5,3.4-10.8,9.8-10.8c6.5,0,8.7,5.4,8.7,9.8c0,0.9-0.1,1.7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.3-8.2,6.3c-2.4,0-4.6-0.6-6.1-1.4L445.4,122.7z"/>
|
41 |
+
<path class="st0" d="M470.7,101.5v5.8h4.8v3.8h-4.8v8.9c0,2.5,0.7,3.7,2.6,3.7c0.9,0,1.5-0.1,2-0.2l0.1,3.9
|
42 |
+
c-0.8,0.3-2.1,0.5-3.7,0.5c-1.9,0-3.4-0.6-4.4-1.7c-1.1-1.2-1.6-3-1.6-5.6v-9.4h-2.9v-3.8h2.9v-4.5L470.7,101.5z"/>
|
43 |
+
<path class="st0" d="M500.5,117.1c0,7.4-5.2,10.7-10.3,10.7c-5.7,0-10-3.9-10-10.3c0-6.6,4.3-10.6,10.4-10.6
|
44 |
+
C496.6,106.8,500.5,111,500.5,117.1z M485.4,117.3c0,3.9,1.9,6.8,5,6.8c2.9,0,4.9-2.8,4.9-6.8c0-3.2-1.4-6.8-4.9-6.8
|
45 |
+
C486.9,110.5,485.4,114,485.4,117.3z"/>
|
46 |
+
<path class="st0" d="M506.8,113.3c0-2.3-0.1-4.2-0.2-6h4.3l0.2,2.9h0.1c1-1.6,2.8-3.4,6.2-3.4c2.7,0,4.7,1.5,5.6,3.7h0.1
|
47 |
+
c0.7-1.1,1.5-1.9,2.5-2.5c1.1-0.8,2.4-1.2,4.1-1.2c3.3,0,6.7,2.3,6.7,8.7v11.8h-5v-11.1c0-3.3-1.2-5.3-3.6-5.3
|
48 |
+
c-1.7,0-3,1.2-3.5,2.7c-0.2,0.5-0.3,1.1-0.3,1.7v12h-5v-11.6c0-2.8-1.1-4.8-3.5-4.8c-1.9,0-3.2,1.5-3.7,2.9
|
49 |
+
c-0.2,0.5-0.3,1.1-0.3,1.7v11.9h-5V113.3z"/>
|
50 |
+
<path class="st0" d="M553.6,113.9c0-2.6-0.1-4.8-0.2-6.7h4.5l0.2,3.1h0.1c1.5-2.3,3.8-3.5,6.9-3.5c4.6,0,8.4,3.9,8.4,10.2
|
51 |
+
c0,7.3-4.6,10.8-9.1,10.8c-2.5,0-4.6-1.1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9l0.8,3.5c-1.7,0.7-4.1,1.3-7,1.3
|
61 |
+
c-6.5,0-10.3-4-10.3-10.2c0-5.5,3.4-10.8,9.8-10.8c6.5,0,8.7,5.4,8.7,9.8c0,0.9-0.1,1.7-0.2,2.1H639.4z M648.3,115.2
|
62 |
+
c0-1.9-0.8-4.9-4.2-4.9c-3.1,0-4.4,2.8-4.7,4.9H648.3z"/>
|
63 |
+
<path class="st0" d="M659.2,113.7c0-2.7-0.1-4.7-0.2-6.5h4.4l0.2,3.8h0.1c1-2.8,3.3-4.3,5.5-4.3c0.5,0,0.8,0,1.2,0.1v4.8
|
64 |
+
c-0.4-0.1-0.9-0.1-1.5-0.1c-2.4,0-4.1,1.5-4.6,3.8c-0.1,0.4-0.1,1-0.1,1.5v10.4h-5.1V113.7z"/>
|
65 |
+
<path class="st0" d="M676,113.3c0-2.3-0.1-4.2-0.2-6h4.4l0.2,3h0.1c0.9-1.6,3.1-3.5,6.4-3.5c3.5,0,7.1,2.3,7.1,8.6v11.9H689V116
|
66 |
+
c0-2.9-1.1-5.1-3.8-5.1c-2,0-3.4,1.4-4,3c-0.2,0.4-0.2,1-0.2,1.6v11.8H676V113.3z"/>
|
67 |
+
<path class="st0" d="M701.4,122.7c1.1,0.7,3.3,1.5,5.1,1.5c2.2,0,3.2-0.9,3.2-2.3c0-1.4-0.8-2-3.3-2.9c-3.9-1.3-5.6-3.5-5.5-5.9
|
68 |
+
c0-3.5,2.9-6.3,7.6-6.3c2.2,0,4.1,0.6,5.3,1.2l-1,3.6c-0.8-0.5-2.5-1.2-4.2-1.2c-1.8,0-2.8,0.9-2.8,2.1c0,1.3,1,1.9,3.5,2.8
|
69 |
+
c3.7,1.3,5.3,3.2,5.4,6.1c0,3.7-2.9,6.3-8.2,6.3c-2.4,0-4.6-0.6-6.1-1.4L701.4,122.7z"/>
|
70 |
+
</g>
|
71 |
+
</g>
|
72 |
+
<g>
|
73 |
+
<g>
|
74 |
+
<path class="st0" d="M183.8,23.9c3.5-0.7,9.9-1.3,16.1-1.3c8.1,0,13.2,1.1,17.3,3.8c3.7,2.3,6.2,6.2,6.2,11.4
|
75 |
+
c0,5.6-3.5,10.6-10.1,13v0.2c6.4,1.6,12.3,6.7,12.3,15c0,5.4-2.3,9.6-5.8,12.5c-4.3,3.7-11.4,5.6-22.5,5.6
|
76 |
+
c-6.1,0-10.7-0.4-13.6-0.8V23.9z M194.7,47.8h5.7c7.7,0,11.9-3.6,11.9-8.7c0-5.7-4.3-8.3-11.3-8.3c-3.3,0-5.1,0.2-6.3,0.5V47.8z
|
77 |
+
M194.7,75.6c1.4,0.3,3.3,0.3,5.9,0.3c7.1,0,13.4-2.7,13.4-10.1c0-7-6.2-9.9-13.8-9.9h-5.5V75.6z"/>
|
78 |
+
<path class="st0" d="M233.3,19.9h11.1v63.8h-11.1V19.9z"/>
|
79 |
+
<path class="st0" d="M296.1,61.3c0,16.1-11.3,23.3-22.5,23.3c-12.3,0-21.9-8.5-21.9-22.5c0-14.3,9.4-23.2,22.6-23.2
|
80 |
+
C287.4,38.9,296.1,48.1,296.1,61.3z M263.2,61.8c0,8.4,4.2,14.8,10.9,14.8c6.3,0,10.7-6.1,10.7-14.9c0-6.9-3-14.7-10.7-14.7
|
81 |
+
C266.3,47,263.2,54.5,263.2,61.8z"/>
|
82 |
+
<path class="st0" d="M335.5,82.3c-2.3,1.1-6.9,2.3-12.3,2.3c-13.7,0-22.5-8.8-22.5-22.4c0-13.1,8.9-23.3,24.3-23.3
|
83 |
+
c4.1,0,8.2,0.9,10.7,2l-2,8.3c-1.8-0.9-4.4-1.7-8.4-1.7c-8.4,0-13.4,6.2-13.4,14.2c0,9,5.9,14.1,13.4,14.1c3.8,0,6.5-0.8,8.7-1.7
|
84 |
+
L335.5,82.3z"/>
|
85 |
+
<path class="st0" d="M354.4,59.1h0.2c1-1.7,2.3-3.6,3.4-5.1l10.7-14H382l-16.2,17.8l18.5,25.9h-13.6l-12.6-19.3l-3.7,4.4v14.9
|
86 |
+
h-11.1V19.9h11.1V59.1z"/>
|
87 |
+
<path class="st0" d="M408,23.9c4-0.7,9.5-1.2,16.9-1.2c8.1,0,14,1.7,17.8,5c3.6,3,5.9,7.7,5.9,13.4c0,5.7-1.8,10.5-5.2,13.7
|
88 |
+
c-4.4,4.4-11.3,6.5-19.1,6.5c-2.1,0-3.9-0.1-5.4-0.4v22.8h-11V23.9z M419,52.1c1.4,0.4,3.2,0.5,5.4,0.5c8.3,0,13.3-4.1,13.3-11.2
|
89 |
+
c0-6.7-4.7-10.3-12.3-10.3c-3,0-5.2,0.3-6.4,0.5V52.1z"/>
|
90 |
+
<path class="st0" d="M478.8,83.6l-0.8-4.9h-0.3c-2.7,3.5-7.2,5.9-12.9,5.9c-8.9,0-13.8-6.3-13.8-13c0-11,9.8-16.6,25.9-16.6v-0.7
|
91 |
+
c0-2.9-1.1-7.7-8.9-7.6c-4.3,0-8.8,1.4-11.8,3.3l-2.2-7.2c3.3-2,9-3.9,15.8-3.9c14,0,18,8.8,18,18.4v15.7c0,4,0.2,7.8,0.7,10.5
|
92 |
+
H478.8z M477.4,62.2c-7.8-0.1-15.3,1.5-15.3,8.2c0,4.3,2.8,6.3,6.3,6.3c4.4,0,7.6-2.8,8.7-6.1c0.2-0.8,0.3-1.6,0.3-2.4V62.2z"/>
|
93 |
+
<path class="st0" d="M510.7,27.4v12.5h10.5v8.2h-10.5v19.3c0,5.4,1.4,8.1,5.7,8.1c1.9,0,3.3-0.2,4.3-0.5l0.2,8.4
|
94 |
+
c-1.7,0.6-4.6,1.1-8,1.1c-4.1,0-7.4-1.4-9.5-3.6c-2.4-2.5-3.5-6.5-3.5-12.3V48.1h-6.2v-8.2h6.2V30L510.7,27.4z"/>
|
95 |
+
<path class="st0" d="M542.3,27.4v12.5h10.5v8.2h-10.5v19.3c0,5.4,1.4,8.1,5.7,8.1c1.9,0,3.3-0.2,4.3-0.5l0.2,8.4
|
96 |
+
c-1.7,0.6-4.6,1.1-8,1.1c-4.1,0-7.4-1.4-9.5-3.6c-2.4-2.5-3.5-6.5-3.5-12.3V48.1h-6.2v-8.2h6.2V30L542.3,27.4z"/>
|
97 |
+
<path class="st0" d="M568.9,64.8c0.3,7.9,6.4,11.4,13.5,11.4c5.1,0,8.7-0.8,12.1-2l1.6,7.6c-3.7,1.6-8.9,2.8-15.3,2.8
|
98 |
+
c-14.2,0-22.5-8.8-22.5-22.2c0-12.1,7.3-23.5,21.4-23.5c14.2,0,18.8,11.7,18.8,21.3c0,2.1-0.2,3.7-0.4,4.6H568.9z M588.1,57.1
|
99 |
+
c0-4-1.7-10.7-9.1-10.7c-6.8,0-9.6,6.2-10.1,10.7H588.1z"/>
|
100 |
+
<path class="st0" d="M605.7,54c0-5.9-0.1-10.2-0.4-14.1h9.6l0.4,8.3h0.3c2.2-6.2,7.3-9.3,12-9.3c1.1,0,1.7,0,2.6,0.2v10.4
|
101 |
+
c-0.9-0.2-1.9-0.3-3.2-0.3c-5.3,0-8.9,3.4-9.9,8.4c-0.2,1-0.3,2.1-0.3,3.3v22.7h-11.1V54z"/>
|
102 |
+
<path class="st0" d="M637.6,52.9c0-5.1-0.2-9.2-0.4-13h9.7l0.5,6.6h0.3c1.9-3.4,6.7-7.6,13.9-7.6c7.6,0,15.5,4.9,15.5,18.7v26
|
103 |
+
h-11.1V59c0-6.3-2.3-11.1-8.3-11.1c-4.4,0-7.4,3.1-8.6,6.5c-0.3,0.9-0.5,2.2-0.5,3.5v25.7h-11.1V52.9z"/>
|
104 |
+
<path class="st0" d="M686.2,73.5c2.4,1.5,7.2,3.2,11.2,3.2c4.9,0,7-2,7-4.9c0-3-1.8-4.5-7.2-6.4c-8.6-2.9-12.1-7.6-12.1-12.8
|
105 |
+
c0-7.7,6.4-13.7,16.6-13.7c4.8,0,9,1.2,11.6,2.6l-2.2,7.8c-1.8-1-5.4-2.5-9.2-2.5c-3.9,0-6.1,1.9-6.1,4.6c0,2.8,2.1,4.1,7.6,6.1
|
106 |
+
c8,2.8,11.6,6.9,11.7,13.3c0,8-6.2,13.7-17.8,13.7c-5.3,0-10.1-1.3-13.3-3.1L686.2,73.5z"/>
|
107 |
+
</g>
|
108 |
+
</g>
|
109 |
+
<g>
|
110 |
+
<path d="M148.4,23.4l-44.5,0.1c-0.6,0-1.2,0.4-1.4,1L99.1,34c-0.3,1,0.4,2,1.4,2l17.3,0c1.3,0,2,1.6,1.1,2.5L91.3,67.2l0.1,0
|
111 |
+
l14.2,44.7c0.3,1-0.4,1.9-1.4,1.9l-13.9,0c-0.7,0-1.2-0.4-1.4-1l-7.1-22.9c-0.4-1.4-2.3-1.4-2.8-0.1l-5.8,16.1
|
112 |
+
c-0.1,0.3-0.1,0.6,0,0.9l5.3,19.5c0.2,0.6,0.8,1.1,1.4,1.1h44.8c1,0,1.7-1,1.4-1.9L108,69.2c-0.2-0.5,0-1.1,0.4-1.5l41.1-41.8
|
113 |
+
C150.4,25,149.7,23.4,148.4,23.4z"/>
|
114 |
+
<g>
|
115 |
+
<polygon class="st1" points="43.9,65.1 43.9,65.1 43.9,65.1 "/>
|
116 |
+
<path class="st1" d="M95.7,0L68.6,0.1c-0.6,0-1.2,0.4-1.4,1l-3.5,9.5c-0.4,1,0.4,2,1.4,2l11.4,0c1,0,1.7,1,1.4,2L45.6,103
|
117 |
+
c-0.5,1.3-2.3,1.3-2.8,0L19.6,39.2c-0.4-1,0.4-2,1.4-2l11.7,0c0.6,0,1.2,0.4,1.4,1l8.4,23c0.5,1.3,2.3,1.3,2.8,0l13-35.8
|
118 |
+
c0.4-1-0.4-2-1.4-2l-55.4,0c-1,0-1.7,1-1.4,2l42.6,118.4c0.5,1.3,2.3,1.3,2.8,0L97.1,2C97.4,1,96.7,0,95.7,0z"/>
|
119 |
+
</g>
|
120 |
+
</g>
|
121 |
+
</svg>
|
inc/vk-admin/package/_scss/vk_admin.scss
ADDED
@@ -0,0 +1,372 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
@charset "utf-8";
|
2 |
+
// @import "compass";
|
3 |
+
|
4 |
+
.text-left {
|
5 |
+
text-align: left;
|
6 |
+
}
|
7 |
+
.text-center {
|
8 |
+
text-align: center;
|
9 |
+
}
|
10 |
+
.text-right {
|
11 |
+
text-align: right;
|
12 |
+
}
|
13 |
+
.text-warning {
|
14 |
+
color: #a94442;
|
15 |
+
}
|
16 |
+
|
17 |
+
#dashboard-widgets .vk-metabox-sub-title,
|
18 |
+
.vk-metabox-sub-title {
|
19 |
+
display: block;
|
20 |
+
overflow: hidden;
|
21 |
+
border-bottom: 1px solid #e5e5e5;
|
22 |
+
margin-top: 1em;
|
23 |
+
padding-bottom: 0.3em;
|
24 |
+
.dashicons {
|
25 |
+
position: relative;
|
26 |
+
top: -2px;
|
27 |
+
margin-left: 3px;
|
28 |
+
}
|
29 |
+
}
|
30 |
+
.vk-metabox-more-link {
|
31 |
+
float: right;
|
32 |
+
font-size: 12px;
|
33 |
+
}
|
34 |
+
.vk-metabox-post-list {
|
35 |
+
margin-bottom: 2em;
|
36 |
+
li {
|
37 |
+
border-bottom: 1px dotted #ccc;
|
38 |
+
padding-bottom: 3px;
|
39 |
+
display: flex;
|
40 |
+
.date {
|
41 |
+
font-size: 11px;
|
42 |
+
margin-right: 1em;
|
43 |
+
width: 75px;
|
44 |
+
white-space: nowrap;
|
45 |
+
}
|
46 |
+
a {
|
47 |
+
width: 100%;
|
48 |
+
}
|
49 |
+
}
|
50 |
+
}
|
51 |
+
|
52 |
+
.vk-admin-banner {
|
53 |
+
display: block;
|
54 |
+
overflow: hidden;
|
55 |
+
a.admin_banner {
|
56 |
+
display: block;
|
57 |
+
margin-bottom: 1em;
|
58 |
+
border: 1px solid #ccc;
|
59 |
+
box-shadow: inset 0px 0px 0px 1px rgba(255, 255, 255, 1);
|
60 |
+
img {
|
61 |
+
max-width: 100%;
|
62 |
+
height: auto;
|
63 |
+
display: block;
|
64 |
+
&:hover {
|
65 |
+
opacity: 0.7;
|
66 |
+
}
|
67 |
+
}
|
68 |
+
}
|
69 |
+
.vektor_logo {
|
70 |
+
margin-top: 1em;
|
71 |
+
img {
|
72 |
+
width: 150px;
|
73 |
+
float: right;
|
74 |
+
}
|
75 |
+
}
|
76 |
+
}
|
77 |
+
|
78 |
+
#vk_dashboard_widget {
|
79 |
+
.vk-admin-banner-grid {
|
80 |
+
width: 100%;
|
81 |
+
display: flex;
|
82 |
+
flex-wrap: wrap;
|
83 |
+
justify-content: space-between;
|
84 |
+
a.admin_banner {
|
85 |
+
width: 48%;
|
86 |
+
}
|
87 |
+
}
|
88 |
+
}
|
89 |
+
|
90 |
+
.wp-core-ui .button-block {
|
91 |
+
display: block;
|
92 |
+
width: 100%;
|
93 |
+
text-align: center;
|
94 |
+
}
|
95 |
+
|
96 |
+
.logo_exUnit {
|
97 |
+
display: block;
|
98 |
+
overflow: hidden;
|
99 |
+
text-align: center;
|
100 |
+
margin-bottom: 10px;
|
101 |
+
border-bottom: 1px solid #ccc;
|
102 |
+
img {
|
103 |
+
width: 150px;
|
104 |
+
max-width: 100%;
|
105 |
+
}
|
106 |
+
}
|
107 |
+
|
108 |
+
.vk_option_nav {
|
109 |
+
display: block !important;
|
110 |
+
overflow: hidden;
|
111 |
+
}
|
112 |
+
.vk_option_nav ul {
|
113 |
+
display: block;
|
114 |
+
overflow: hidden;
|
115 |
+
margin: 0;
|
116 |
+
padding: 0;
|
117 |
+
}
|
118 |
+
.vk_option_nav ul li {
|
119 |
+
display: block;
|
120 |
+
border: 1px solid #ccc;
|
121 |
+
margin-bottom: 0;
|
122 |
+
border-bottom: none;
|
123 |
+
background-color: #fff;
|
124 |
+
}
|
125 |
+
.vk_option_nav ul li:first-child {
|
126 |
+
border-top-left-radius: 3px;
|
127 |
+
border-top-right-radius: 3px;
|
128 |
+
}
|
129 |
+
.vk_option_nav ul li:last-child {
|
130 |
+
border-bottom-left-radius: 3px;
|
131 |
+
border-bottom-right-radius: 3px;
|
132 |
+
border-bottom: 1px solid #ccc;
|
133 |
+
}
|
134 |
+
.vk_option_nav ul li:hover {
|
135 |
+
background-color: #666;
|
136 |
+
}
|
137 |
+
.vk_option_nav ul li a {
|
138 |
+
display: block;
|
139 |
+
overflow: hidden;
|
140 |
+
padding: 0.5em;
|
141 |
+
text-decoration: none;
|
142 |
+
color: #666;
|
143 |
+
font-size: 12px;
|
144 |
+
}
|
145 |
+
.vk_option_nav ul li:hover a {
|
146 |
+
color: #fff;
|
147 |
+
border: none;
|
148 |
+
}
|
149 |
+
.vk_option_nav ul li.current {
|
150 |
+
background-color: #333;
|
151 |
+
color: #fff;
|
152 |
+
a {
|
153 |
+
color: #fff;
|
154 |
+
}
|
155 |
+
}
|
156 |
+
|
157 |
+
.vk_admin_page {
|
158 |
+
padding-top: 1em;
|
159 |
+
h2.page_title {
|
160 |
+
font-size: 16px;
|
161 |
+
text-align: center;
|
162 |
+
line-height: 140%;
|
163 |
+
margin: 10px 0 20px;
|
164 |
+
}
|
165 |
+
h3 {
|
166 |
+
background-color: #333;
|
167 |
+
color: #fff;
|
168 |
+
padding: 10px 15px;
|
169 |
+
font-size: 150%;
|
170 |
+
margin-top: 0;
|
171 |
+
border-left: 5px solid #e50000;
|
172 |
+
border-radius: 4px;
|
173 |
+
}
|
174 |
+
input[type="text"] {
|
175 |
+
width: 50%;
|
176 |
+
}
|
177 |
+
select {
|
178 |
+
width: 50%;
|
179 |
+
}
|
180 |
+
dl {
|
181 |
+
dt {
|
182 |
+
font-weight: bold;
|
183 |
+
margin-bottom: 5px;
|
184 |
+
}
|
185 |
+
dd {
|
186 |
+
margin-left: 0;
|
187 |
+
}
|
188 |
+
}
|
189 |
+
tr.dev_object {
|
190 |
+
display: none;
|
191 |
+
}
|
192 |
+
.pageLogo {
|
193 |
+
text-align: center;
|
194 |
+
img {
|
195 |
+
max-width: 150px;
|
196 |
+
margin: 0 auto;
|
197 |
+
}
|
198 |
+
}
|
199 |
+
.adminMain {
|
200 |
+
display: block;
|
201 |
+
overflow: hidden;
|
202 |
+
width: 74%;
|
203 |
+
float: left;
|
204 |
+
#adminContent_sub {
|
205 |
+
display: block;
|
206 |
+
overflow: hidden;
|
207 |
+
width: 23%;
|
208 |
+
float: left;
|
209 |
+
padding-bottom: 10px;
|
210 |
+
}
|
211 |
+
#adminContent_main {
|
212 |
+
display: block;
|
213 |
+
overflow: hidden;
|
214 |
+
width: 74%;
|
215 |
+
float: right;
|
216 |
+
min-height: 300px;
|
217 |
+
.form_horizontal_item {
|
218 |
+
margin-right: 1em;
|
219 |
+
}
|
220 |
+
}
|
221 |
+
&.column_2 {
|
222 |
+
#adminContent_main {
|
223 |
+
width: 100%;
|
224 |
+
}
|
225 |
+
}
|
226 |
+
}
|
227 |
+
|
228 |
+
.adminSub {
|
229 |
+
display: block;
|
230 |
+
overflow: hidden;
|
231 |
+
width: 24%;
|
232 |
+
float: right;
|
233 |
+
padding-bottom: 10px;
|
234 |
+
.infoBox {
|
235 |
+
display: block;
|
236 |
+
overflow: hidden;
|
237 |
+
padding: 1em;
|
238 |
+
margin-bottom: 1em;
|
239 |
+
background-color: #fff;
|
240 |
+
border-radius: 4px;
|
241 |
+
}
|
242 |
+
.vk-metabox-sub-title {
|
243 |
+
background-color: #ccc;
|
244 |
+
width: auto;
|
245 |
+
padding: 5px 10px;
|
246 |
+
border-radius: 3px;
|
247 |
+
margin-top: 0;
|
248 |
+
margin-bottom: 15px;
|
249 |
+
}
|
250 |
+
.vk-metabox-more-link {
|
251 |
+
display: none;
|
252 |
+
}
|
253 |
+
@media (max-width: 991px) {
|
254 |
+
.adminMain table.form-table {
|
255 |
+
th,
|
256 |
+
td {
|
257 |
+
display: block;
|
258 |
+
}
|
259 |
+
th {
|
260 |
+
background-color: #ccc;
|
261 |
+
width: auto;
|
262 |
+
padding: 10px;
|
263 |
+
border-radius: 3px;
|
264 |
+
}
|
265 |
+
}
|
266 |
+
}
|
267 |
+
}
|
268 |
+
}
|
269 |
+
|
270 |
+
/*-------------------------------------------*/
|
271 |
+
/* Widget css
|
272 |
+
/*-------------------------------------------*/
|
273 |
+
/*
|
274 |
+
.admin_widget_ は pr-content ウィジェットなどで利用されているので、
|
275 |
+
アップデートが浸透するまで消さない
|
276 |
+
2019.5 以降削除
|
277 |
+
*/
|
278 |
+
.admin_widget_section,
|
279 |
+
.admin-custom-section {
|
280 |
+
display: block;
|
281 |
+
overflow: hidden;
|
282 |
+
margin: 1.5em 0;
|
283 |
+
p {
|
284 |
+
margin-top: 0.5em;
|
285 |
+
}
|
286 |
+
}
|
287 |
+
.admin_widget_h2,
|
288 |
+
.admin-custom-h2 {
|
289 |
+
box-sizing: border-box;
|
290 |
+
margin: 1em 0 1em;
|
291 |
+
padding: 0.8em 1em;
|
292 |
+
width: 100%;
|
293 |
+
border: solid 1px #ddd;
|
294 |
+
border-radius: 5px;
|
295 |
+
background: #555;
|
296 |
+
color: #fff;
|
297 |
+
font-size: 1.1em;
|
298 |
+
}
|
299 |
+
.admin_widget_h3,
|
300 |
+
.admin-custom-h3 {
|
301 |
+
box-sizing: border-box;
|
302 |
+
padding: 0.4em 0;
|
303 |
+
margin-bottom: 0.3em;
|
304 |
+
width: 100%;
|
305 |
+
border-bottom: solid 1px #ddd;
|
306 |
+
// background: #EDEDED;
|
307 |
+
font-size: 1em;
|
308 |
+
}
|
309 |
+
input[type="text"],
|
310 |
+
input[type="search"],
|
311 |
+
input[type="radio"],
|
312 |
+
input[type="tel"],
|
313 |
+
input[type="time"],
|
314 |
+
input[type="url"],
|
315 |
+
input[type="week"],
|
316 |
+
input[type="password"],
|
317 |
+
input[type="checkbox"],
|
318 |
+
input[type="color"],
|
319 |
+
input[type="date"],
|
320 |
+
input[type="datetime"],
|
321 |
+
input[type="datetime-local"],
|
322 |
+
input[type="email"],
|
323 |
+
input[type="month"],
|
324 |
+
input[type="number"],
|
325 |
+
select,
|
326 |
+
textarea {
|
327 |
+
&.admin_widget_input,
|
328 |
+
&.admin-custom-input {
|
329 |
+
width: 100%;
|
330 |
+
margin: 0.3em 0;
|
331 |
+
}
|
332 |
+
}
|
333 |
+
|
334 |
+
.admin_widget_thumb_outer,
|
335 |
+
.admin-custom-thumb-outer {
|
336 |
+
position: relative;
|
337 |
+
overflow: hidden;
|
338 |
+
z-index: 2;
|
339 |
+
margin: 3px 0;
|
340 |
+
min-height: 70px;
|
341 |
+
border: 1px solid #e5e5e5;
|
342 |
+
background-color: #f5f5f5;
|
343 |
+
width: 100%;
|
344 |
+
}
|
345 |
+
.admin_widget_thumb_outer:before,
|
346 |
+
.admin-custom-thumb-outer:before {
|
347 |
+
position: absolute;
|
348 |
+
top: 50%;
|
349 |
+
left: 50%;
|
350 |
+
z-index: 1;
|
351 |
+
margin: -8px 0 0 -30px;
|
352 |
+
color: #999;
|
353 |
+
content: "No Image";
|
354 |
+
}
|
355 |
+
.admin_widget_thumb,
|
356 |
+
.admin-custom-thumb {
|
357 |
+
position: relative;
|
358 |
+
z-index: 3;
|
359 |
+
display: block;
|
360 |
+
width: 100%;
|
361 |
+
height: auto;
|
362 |
+
}
|
363 |
+
|
364 |
+
.vk_checklist_item {
|
365 |
+
&-style-vertical {
|
366 |
+
display: flex;
|
367 |
+
}
|
368 |
+
// & & にしないと指定が負けるため特別
|
369 |
+
& &_input {
|
370 |
+
marg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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
3 |
+
exit;
|
4 |
+
}
|
5 |
+
|
6 |
+
/*
|
7 |
+
このファイルの元ファイルは
|
8 |
+
https://github.com/vektor-inc/vektor-wp-libraries
|
9 |
+
にあります。
|
10 |
+
修正の際は上記リポジトリのデータを修正してください。
|
11 |
+
編集権限を持っていない方で何か修正要望などありましたら
|
12 |
+
各プラグインのリポジトリにプルリクエストで結構です。
|
13 |
+
*/
|
14 |
+
|
15 |
+
if ( ! class_exists( 'Vk_Admin' ) ) {
|
16 |
+
/*
|
17 |
+
congif.phpの方で既に ! class_exists( 'Vk_Admin' ) しているが、
|
18 |
+
今後読み込みファイルが増えた時にVk-Adminの中で別のファイルを読み込むために
|
19 |
+
このファイルにも更にclass_exists( 'Vk_Admin' ) がある。
|
20 |
+
*/
|
21 |
+
class Vk_Admin {
|
22 |
+
|
23 |
+
public static $version = '2.1.0';
|
24 |
+
|
25 |
+
static function init() {
|
26 |
+
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_common_css' ) );
|
27 |
+
add_action( 'customize_register', array( __CLASS__, 'admin_common_css' ) );
|
28 |
+
add_action( 'wp_dashboard_setup', array( __CLASS__, 'dashboard_widget' ), 1 );
|
29 |
+
}
|
30 |
+
|
31 |
+
static function admin_common_css() {
|
32 |
+
wp_enqueue_style( 'vk-admin-style', plugin_dir_url( __FILE__ ) . 'css/vk_admin.css', array(), self::$version, 'all' );
|
33 |
+
}
|
34 |
+
|
35 |
+
static function admin_enqueue_scripts() {
|
36 |
+
wp_enqueue_script( 'jquery' );
|
37 |
+
wp_enqueue_media();
|
38 |
+
wp_enqueue_script( 'vk-admin-js', plugin_dir_url( __FILE__ ) . 'js/vk_admin.js', array( 'jquery' ), self::$version );
|
39 |
+
}
|
40 |
+
|
41 |
+
// 管理画面用のjsを読み込むページを配列で指定する
|
42 |
+
// $admin_pages は vk-admin-config.php に記載
|
43 |
+
static function admin_scripts( $admin_pages ) {
|
44 |
+
foreach ( $admin_pages as $key => $value ) {
|
45 |
+
$hook = 'admin_print_styles-' . $value;
|
46 |
+
add_action( $hook, array( __CLASS__, 'admin_enqueue_scripts' ) );
|
47 |
+
}
|
48 |
+
}
|
49 |
+
|
50 |
+
/*
|
51 |
+
get_admin_banner
|
52 |
+
get_news_body_api
|
53 |
+
get_news_from_rss
|
54 |
+
admin _ Dashboard Widget
|
55 |
+
admin _ sub
|
56 |
+
admin _ page_frame
|
57 |
+
/*--------------------------------------------------*/
|
58 |
+
|
59 |
+
/*
|
60 |
+
get_admin_banner
|
61 |
+
/*--------------------------------------------------*/
|
62 |
+
public static function get_admin_banner() {
|
63 |
+
$banner = '';
|
64 |
+
$dir_url = plugin_dir_url( __FILE__ );
|
65 |
+
$lang = ( get_locale() == 'ja' ) ? 'ja' : 'en';
|
66 |
+
|
67 |
+
$banner .= '<div class="vk-admin-banner">';
|
68 |
+
if ( $lang == 'ja' ) {
|
69 |
+
// $banner .= '<a class="admin_banner" href="https://recruit.vektor-inc.co.jp/?rel=vkadmin" target="_blank">';
|
70 |
+
// $banner .= '<img src="' . $dir_url . 'images/admin_banner_recruit.jpg" alt="[ Vektor,Inc. 採用情報 ]" />';
|
71 |
+
// $banner .= '</a>';
|
72 |
+
} else {
|
73 |
+
$banner .= '<a href="https://lightning.nagoya/lightning_copyright_customizer/?rel=vkadmin" target="_blank" class="button button-primary button-primary button-block" style="margin-bottom:1em;">Lightning Copyright Customizer <span class="screen-reader-text">(opens in a new tab)</span><span aria-hidden="true" class="dashicons dashicons-external" style="position:relative;top:3px;"></span></a>';
|
74 |
+
}
|
75 |
+
|
76 |
+
$banner .= '<div class="vk-admin-banner-grid">';
|
77 |
+
|
78 |
+
// プラグイン Link Target Controller を有効化していない人にバナーを表示
|
79 |
+
if ( ! is_plugin_active( 'vk-link-target-controller/vk-link-target-controller.php' ) ) {
|
80 |
+
if ( $lang == 'ja' ) {
|
81 |
+
$bnr_file_name = 'vk-link-target-controller_bnr.jpg';
|
82 |
+
} else {
|
83 |
+
$bnr_file_name = 'vk-link-target-controller_notxt_bnr.jpg';
|
84 |
+
}
|
85 |
+
$banner .= '<a href="//wordpress.org/plugins/vk-link-target-controller/" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/' . $bnr_file_name . '" alt="Link Target Controller" /></a>';
|
86 |
+
}
|
87 |
+
|
88 |
+
// プラグイン VK Aost Author Display を有効化していない人にバナーを表示
|
89 |
+
if ( ! is_plugin_active( 'vk-post-author-display/post-author-display.php' ) ) {
|
90 |
+
if ( $lang == 'ja' ) {
|
91 |
+
$bnr_file_name = 'post_author_display_bnr_ja.jpg';
|
92 |
+
} else {
|
93 |
+
$bnr_file_name = 'post_author_display_bnr_en.jpg';
|
94 |
+
}
|
95 |
+
$banner .= '<a href="//wordpress.org/plugins/vk-post-author-display/" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/' . $bnr_file_name . '" alt="VK Post Author
|
96 |
+
Display" /></a>';
|
97 |
+
}
|
98 |
+
|
99 |
+
// プラグイン VK Job Posting Manager を有効化していない人にバナーを表示
|
100 |
+
if ( ! is_plugin_active( 'vk-google-job-posting-manager/vk-google-job-posting-manager.php' ) ) {
|
101 |
+
if ( $lang == 'ja' ) {
|
102 |
+
$bnr_file_name = 'job_banner-336_280-ja.jpg';
|
103 |
+
} else {
|
104 |
+
$bnr_file_name = 'job_banner-336_280-en.jpg';
|
105 |
+
}
|
106 |
+
$banner .= '<a href="//wordpress.org/plugins/vk-google-job-posting-manager/" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/' . $bnr_file_name . '" alt="VK Post Author
|
107 |
+
Display" /></a>';
|
108 |
+
}
|
109 |
+
|
110 |
+
// テーマがLightningじゃない場合にLighntingのバナーを表示
|
111 |
+
if ( ! function_exists( 'lightning_get_theme_name' ) ) {
|
112 |
+
if ( $lang == 'ja' ) {
|
113 |
+
$banner .= '<a href="//lightning.nagoya/ja/" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/lightning_bnr_ja.jpg" alt="lightning_bnr_ja" /></a>';
|
114 |
+
} else {
|
115 |
+
$banner .= '<a href="//lightning.nagoya/" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/lightning_bnr_en.jpg" alt="lightning_bnr_en" /></a>';
|
116 |
+
} // if ( $lang == 'ja' ) {
|
117 |
+
} // if ( $theme != 'lightning' ) {
|
118 |
+
|
119 |
+
$theme = get_template();
|
120 |
+
if ( $lang == 'ja' && $theme != 'bill-vektor' && $theme != 'bill-vektor-master' ) {
|
121 |
+
$banner .= '<a href="//billvektor.com" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/billvektor_banner.png" alt="見積書・請求書管理用WordPressテーマ" /></a>';
|
122 |
+
}
|
123 |
+
|
124 |
+
if (
|
125 |
+
$lang == 'ja' &&
|
126 |
+
$theme != 'Lightning-pro' &&
|
127 |
+
$theme != 'lightning-pro'
|
128 |
+
) {
|
129 |
+
$banner .= '<a href="https://lightning.nagoya/ja/expansion/lightning-pro" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/lightning-pro-bnr.jpg" alt="" /></a>';
|
130 |
+
}
|
131 |
+
|
132 |
+
if ( $lang == 'ja' && ! is_plugin_active( 'lightning-skin-jpnstyle/lightning_skin_jpnstyle.php' ) ) {
|
133 |
+
$banner .= '<a href="https://lightning.nagoya/ja/expansion/ex_plugin/lightning-jpnstyle/?rel=vkadmin" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/jpnstyle-bnr.jpg" alt="" /></a>';
|
134 |
+
}
|
135 |
+
|
136 |
+
if ( $lang == 'ja' && ! is_plugin_active( 'lightning-skin-fort/lightning-skin-fort.php' ) ) {
|
137 |
+
$banner .= '<a href="https://lightning.nagoya/ja/expansion/ex_plugin/lightning-fort/?rel=vkadmin" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/fort-bnr.jpg" alt="" /></a>';
|
138 |
+
}
|
139 |
+
|
140 |
+
if ( $lang == 'ja' && ! is_plugin_active( 'lightning-skin-pale/lightning-skin-pale.php' ) ) {
|
141 |
+
$banner .= '<a href="https://lightning.nagoya/ja/expansion/ex_plugin/lightning-pale/?rel=vkadmin" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/pale-bnr.jpg" alt="" /></a>';
|
142 |
+
}
|
143 |
+
|
144 |
+
if ( $lang == 'ja' && ! is_plugin_active( 'lightning-skin-pale/lightning-skin-variety.php' ) ) {
|
145 |
+
$banner .= '<a href="https://lightning.nagoya/ja/expansion/ex_plugin/lightning-variety/?rel=vkadmin" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/variety-bnr.jpg" alt="" /></a>';
|
146 |
+
}
|
147 |
+
|
148 |
+
if ( $lang == 'ja' && ! is_plugin_active( 'vk-all-in-one-expansion-unit/vkExUnit.php' ) ) {
|
149 |
+
$banner .= '<a href="https://ex-unit.nagoya/ja/" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/ExUnit_bnr.png" alt="" /></a>';
|
150 |
+
}
|
151 |
+
|
152 |
+
$banner .= '</div>';
|
153 |
+
|
154 |
+
$banner .= '<a href="//www.vektor-inc.co.jp" class="vektor_logo" target="_blank" class="admin_banner"><img src="' . $dir_url . 'images/vektor_logo.png" alt="Vektor,Inc." /></a>';
|
155 |
+
|
156 |
+
$banner .= '</div>';
|
157 |
+
|
158 |
+
return apply_filters( 'vk_admin_banner_html', $banner );
|
159 |
+
}
|
160 |
+
|
161 |
+
/*
|
162 |
+
get_news_body
|
163 |
+
/*--------------------------------------------------*/
|
164 |
+
public static function get_news_body() {
|
165 |
+
if ( 'ja' == get_locale() ) {
|
166 |
+
return self::get_news_from_rest_api();
|
167 |
+
}
|
168 |
+
// English
|
169 |
+
if ( 'ja' != get_locale() ) {
|
170 |
+
return self::get_news_from_rss();
|
171 |
+
}
|
172 |
+
}
|
173 |
+
|
174 |
+
/*
|
175 |
+
get_news_body_api
|
176 |
+
/*--------------------------------------------------*/
|
177 |
+
|
178 |
+
public static function get_news_from_rest_api() {
|
179 |
+
|
180 |
+
$html = '<h4 class="vk-metabox-sub-title">';
|
181 |
+
$html .= 'Vektor WordPress Information';
|
182 |
+
$html .= '<a href="https://www.vektor-inc.co.jp/info-cat/vk-wp-info/?rel=vkadmin" target="_blank" class="vk-metabox-more-link">記事一覧<span aria-hidden="true" class="dashicons dashicons-external"></span></a>';
|
183 |
+
$html .= '</h4>';
|
184 |
+
$html .= '<ul id="vk-wp-info" class="vk-metabox-post-list"></ul>';
|
185 |
+
|
186 |
+
$html .= '<h4 class="vk-metabox-sub-title">';
|
187 |
+
$html .= 'Vektor WordPress ブログ';
|
188 |
+
$html .= '<a href="https://www.vektor-inc.co.jp/category/wordpress-info/?rel=vkadmin" target="_blank" class="vk-metabox-more-link">記事一覧<span aria-hidden="true" class="dashicons dashicons-external"></span></a>';
|
189 |
+
$html .= '</h4>';
|
190 |
+
$html .= '<ul id="vk-wp-blog" class="vk-metabox-post-list"></ul>';
|
191 |
+
|
192 |
+
$html .= '<h4 class="vk-metabox-sub-title">';
|
193 |
+
$html .= 'Vektor WordPress フォーラム';
|
194 |
+
$html .= '<a href="https://vws.vektor-inc.co.jp/forums/?rel=vkadmin" target="_blank" class="vk-metabox-more-link">記事一覧<span aria-hidden="true" class="dashicons dashicons-external"></span></a>';
|
195 |
+
$html .= '</h4>';
|
196 |
+
$html .= '<ul id="vk-wp-forum" class="vk-metabox-post-list"></ul>';
|
197 |
+
|
198 |
+
$html = apply_filters( 'vk_admin_news_html', $html );
|
199 |
+
|
200 |
+
add_action( 'admin_footer', array( __CLASS__, 'load_rest_api_js' ) );
|
201 |
+
|
202 |
+
return $html;
|
203 |
+
?>
|
204 |
+
<?php
|
205 |
+
}
|
206 |
+
|
207 |
+
public static function load_rest_api_js() {
|
208 |
+
|
209 |
+
?>
|
210 |
+
<script>
|
211 |
+
/*-------------------------------------------*/
|
212 |
+
/* REST API でお知らせを取得
|
213 |
+
/*-------------------------------------------*/
|
214 |
+
;(function($){
|
215 |
+
jQuery(document).ready(function($){
|
216 |
+
|
217 |
+
// お知らせ
|
218 |
+
$.getJSON( "https://vektor-inc.co.jp/wp-json/wp/v2/info?info-cat=111&per_page=5",
|
219 |
+
function(results) {
|
220 |
+
// 取得したJSONの内容をループする
|
221 |
+
$.each(results, function(i, item) {
|
222 |
+
// 日付のデータを取得
|
223 |
+
var date = new Date(item.date_gmt);
|
224 |
+
var formate_date = date.toLocaleDateString();
|
225 |
+
// JSONの内容の要素を</ul>の前に出力する
|
226 |
+
$("ul#vk-wp-info").append('<li><span class="date">'+ formate_date +'</span><a href="' + item.link + '?rel=vkadmin" target="_blank">' + item.title.rendered + '</a></li>');
|
227 |
+
});
|
228 |
+
});
|
229 |
+
|
230 |
+
// ブログ
|
231 |
+
$.getJSON( "https://www.vektor-inc.co.jp/wp-json/wp/v2/posts/?categories=55&per_page=3",
|
232 |
+
function(results) {
|
233 |
+
// 取得したJSONの内容をループする
|
234 |
+
$.each(results, function(i, item) {
|
235 |
+
// 日付のデータを取得
|
236 |
+
var date = new Date(item.date_gmt);
|
237 |
+
var formate_date = date.toLocaleDateString();
|
238 |
+
// JSONの内容の要素を</ul>の前に出力する
|
239 |
+
$("ul#vk-wp-blog").append('<li><span class="date">'+ formate_date +'</span><a href="' + item.link + '?rel=vkadmin" target="_blank">' + item.title.rendered + '</a></li>');
|
240 |
+
});
|
241 |
+
});
|
242 |
+
|
243 |
+
// フォーラム
|
244 |
+
$.getJSON( "https://vws.vektor-inc.co.jp/wp-json/wp/v2/topics/?per_page=5",
|
245 |
+
function(results) {
|
246 |
+
$.each(results, function(i, item) {
|
247 |
+
var date = new Date(item.date_gmt);
|
248 |
+
var formate_date = date.toLocaleDateString();
|
249 |
+
$("ul#vk-wp-forum").append('<li><a href="' + item.link + '?rel=vkadmin" target="_blank">' + item.title.rendered + '</a></li>');
|
250 |
+
});
|
251 |
+
});
|
252 |
+
|
253 |
+
});
|
254 |
+
})(jQuery);
|
255 |
+
</script>
|
256 |
+
<?php
|
257 |
+
}
|
258 |
+
|
259 |
+
/*
|
260 |
+
get_news_from_rss
|
261 |
+
/* RSS方針で現在は日本語以外でのみ使用
|
262 |
+
/*--------------------------------------------------*/
|
263 |
+
public static function get_news_from_rss() {
|
264 |
+
$output = '';
|
265 |
+
|
266 |
+
include_once ABSPATH . WPINC . '/feed.php';
|
267 |
+
|
268 |
+
if ( 'ja' == get_locale() ) {
|
269 |
+
$exUnit_feed_url = apply_filters( 'vkAdmin_news_RSS_URL_ja', 'https://ex-unit.nagoya/ja/feed' );
|
270 |
+
// $exUnit_feed_url = apply_filters( 'vkAdmin_news_RSS_URL_ja', 'https://www.vektor-inc.co.jp/feed/?category_name=internship' );
|
271 |
+
} else {
|
272 |
+
$exUnit_feed_url = apply_filters( 'vkAdmin_news_RSS_URL', 'https://ex-unit.nagoya/feed' );
|
273 |
+
}
|
274 |
+
|
275 |
+
$my_feeds = array(
|
276 |
+
array( 'feed_url' => $exUnit_feed_url ),
|
277 |
+
);
|
278 |
+
|
279 |
+
foreach ( $my_feeds as $feed ) {
|
280 |
+
$rss = fetch_feed( $feed['feed_url'] );
|
281 |
+
|
282 |
+
if ( ! is_wp_error( $rss ) ) {
|
283 |
+
$output = '';
|
284 |
+
|
285 |
+
$maxitems = $rss->get_item_quantity( 5 ); // number of news to display (maximum)
|
286 |
+
$rss_items = $rss->get_items( 0, $maxitems );
|
287 |
+
$output .= '<div class="rss-widget">';
|
288 |
+
$output .= '<h4 class="vk-metabox-sub-title">' . apply_filters( 'vk-admin-sub-title-text', 'Information' ) . '</h4>';
|
289 |
+
$output .= '<ul>';
|
290 |
+
|
291 |
+
if ( $maxitems == 0 ) {
|
292 |
+
$output .= '<li>';
|
293 |
+
$output .= __( 'Sorry, there is no post', 'vk-block-patterns' );
|
294 |
+
$output .= '</li>';
|
295 |
+
} else {
|
296 |
+
foreach ( $rss_items as $item ) {
|
297 |
+
$test_date = $item->get_local_date();
|
298 |
+
$content = $item->get_content();
|
299 |
+
|
300 |
+
if ( isset( $test_date ) && ! is_null( $test_date ) ) {
|
301 |
+
$item_date = $item->get_date( get_option( 'date_format' ) ) . '<br />'; } else {
|
302 |
+
$item_date = ''; }
|
303 |
+
|
304 |
+
$output .= '<li style="color:#777;">';
|
305 |
+
$output .= $item_date;
|
306 |
+
$output .= '<a href="' . esc_url( $item->get_permalink() ) . '" title="' . $item_date . '" target="_blank">';
|
307 |
+
$output .= esc_html( $item->get_title() );
|
308 |
+
$output .= '</a>';
|
309 |
+
$output .= '</li>';
|
310 |
+
}
|
311 |
+
}
|
312 |
+
|
313 |
+
$output .= '</ul>';
|
314 |
+
$output .= '</div>';
|
315 |
+
}
|
316 |
+
} // if ( ! is_wp_error( $rss ) ) {
|
317 |
+
|
318 |
+
return $output;
|
319 |
+
}
|
320 |
+
|
321 |
+
public static function is_dashboard_active() {
|
322 |
+
$flag = false;
|
323 |
+
if ( 'ja' == get_locale() ) {
|
324 |
+
$flag = true;
|
325 |
+
}
|
326 |
+
if ( is_plugin_active( 'vk-all-in-one-expansion-unit/vkExUnit.php' ) ) {
|
327 |
+
$flag = true;
|
328 |
+
}
|
329 |
+
if ( ! is_plugin_active( 'vk-post-author-display/post-author-display.php' ) ) {
|
330 |
+
$flag = true;
|
331 |
+
}
|
332 |
+
$theme = wp_get_theme()->get( 'Template' );
|
333 |
+
if ( $theme != 'lightning' ) {
|
334 |
+
$flag = true;
|
335 |
+
}
|
336 |
+
|
337 |
+
return apply_filters( 'vk-admin-is-dashboard-active', $flag );
|
338 |
+
}
|
339 |
+
/*
|
340 |
+
admin _ Dashboard Widget
|
341 |
+
/*--------------------------------------------------*/
|
342 |
+
public static function dashboard_widget() {
|
343 |
+
|
344 |
+
if ( self::is_dashboard_active() ) {
|
345 |
+
wp_add_dashboard_widget(
|
346 |
+
'vk_dashboard_widget',
|
347 |
+
__( 'Vektor WordPress Information', 'vk-block-patterns' ),
|
348 |
+
array( __CLASS__, 'dashboard_widget_body' )
|
349 |
+
);
|
350 |
+
}
|
351 |
+
}
|
352 |
+
|
353 |
+
public static function dashboard_widget_body() {
|
354 |
+
if ( 'ja' == get_locale() ) {
|
355 |
+
echo self::get_news_body();
|
356 |
+
}
|
357 |
+
echo self::get_admin_banner();
|
358 |
+
}
|
359 |
+
|
360 |
+
/*
|
361 |
+
admin _ sub
|
362 |
+
/*--------------------------------------------------*/
|
363 |
+
// 2016.08.07 ExUnitの有効化ページでは直接 admin_subを呼び出しているので注意
|
364 |
+
public static function admin_sub() {
|
365 |
+
$display = apply_filters( 'vk_admin_sub_display', true );
|
366 |
+
if ( ! $display ) {
|
367 |
+
return;
|
368 |
+
}
|
369 |
+
$adminSub = '<div class="adminSub scrTracking">' . "\n";
|
370 |
+
if ( 'ja' == get_locale() ) {
|
371 |
+
$adminSub .= '<div class="infoBox">' . self::get_news_body() . '</div>' . "\n";
|
372 |
+
}
|
373 |
+
$adminSub .= '<div class="vk-admin-banner">' . self::get_admin_banner() . '</div>' . "\n";
|
374 |
+
|
375 |
+
$adminSub .= '</div><!-- [ /.adminSub ] -->' . "\n";
|
376 |
+
return $adminSub;
|
377 |
+
}
|
378 |
+
|
379 |
+
/*
|
380 |
+
admin _ page_frame
|
381 |
+
/*--------------------------------------------------*/
|
382 |
+
public static function admin_page_frame( $get_page_title, $the_body_callback, $get_logo_html = '', $get_menu_html = '', $get_layout = 'column_3' ) {
|
383 |
+
?>
|
384 |
+
<div class="wrap vk_admin_page">
|
385 |
+
|
386 |
+
<div class="adminMain <?php echo $get_layout; ?>">
|
387 |
+
|
388 |
+
<?php if ( $get_layout == 'column_3' ) : ?>
|
389 |
+
<div id="adminContent_sub" class="scrTracking">
|
390 |
+
<div class="pageLogo"><?php echo $get_logo_html; ?></div>
|
391 |
+
<?php if ( $get_page_title ) : ?>
|
392 |
+
<h2 class="page_title"><?php echo $get_page_title; ?></h2>
|
393 |
+
<?php endif; ?>
|
394 |
+
<div class="vk_option_nav">
|
395 |
+
<ul>
|
396 |
+
<?php echo $get_menu_html; ?>
|
397 |
+
</ul>
|
398 |
+
</div>
|
399 |
+
</div><!-- [ /#adminContent_sub ] -->
|
400 |
+
<?php endif; ?>
|
401 |
+
|
402 |
+
<?php if ( $get_layout == 'column_2' ) : ?>
|
403 |
+
<div class="pageLogo"><?php echo $get_logo_html; ?></div>
|
404 |
+
<?php if ( $get_page_title ) : ?>
|
405 |
+
<h1 class="page_title"><?php echo $get_page_title; ?></h1>
|
406 |
+
<?php endif; ?>
|
407 |
+
<?php endif; ?>
|
408 |
+
|
409 |
+
<div id="adminContent_main">
|
410 |
+
<?php call_user_func_array( $the_body_callback, array() ); ?>
|
411 |
+
</div><!-- [ /#adminContent_main ] -->
|
412 |
+
|
413 |
+
</div><!-- [ /.adminMain ] -->
|
414 |
+
|
415 |
+
<?php echo self::admin_sub(); ?>
|
416 |
+
|
417 |
+
</div><!-- [ /.vkExUnit_admin_page ] -->
|
418 |
+
<?php
|
419 |
+
}
|
420 |
+
|
421 |
+
public function __construct() {
|
422 |
+
|
423 |
+
}
|
424 |
+
}
|
425 |
+
} // if ( ! class_exists( 'Vk_Admin' ) )
|
426 |
+
|
427 |
+
Vk_Admin::init();
|
428 |
+
$Vk_Admin = new Vk_Admin();
|
inc/vk-admin/package/config.rb
ADDED
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
http_path = "/"
|
2 |
+
css_dir = "css"
|
3 |
+
sass_dir = "_scss"
|
4 |
+
images_dir = "images"
|
5 |
+
javascripts_dir = "js"
|
6 |
+
# output_style = :compact
|
7 |
+
output_style = :compressed
|
8 |
+
line_comments = false
|
9 |
+
# sass_options = {:debug_info => false}
|
inc/vk-admin/package/css/vk_admin.css
ADDED
@@ -0,0 +1 @@
|
|
|
1 |
+
.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.text-warning{color:#a94442}#dashboard-widgets .vk-metabox-sub-title,.vk-metabox-sub-title{display:block;overflow:hidden;border-bottom:1px solid #e5e5e5;margin-top:1em;padding-bottom:.3em}#dashboard-widgets .vk-metabox-sub-title .dashicons,.vk-metabox-sub-title .dashicons{position:relative;top:-2px;margin-left:3px}.vk-metabox-more-link{float:right;font-size:12px}.vk-metabox-post-list{margin-bottom:2em}.vk-metabox-post-list li{border-bottom:1px dotted #ccc;padding-bottom:3px;display:flex}.vk-metabox-post-list li .date{font-size:11px;margin-right:1em;width:75px;white-space:nowrap}.vk-metabox-post-list li a{width:100%}.vk-admin-banner{display:block;overflow:hidden}.vk-admin-banner a.admin_banner{display:block;margin-bottom:1em;border:1px solid #ccc;box-shadow:inset 0 0 0 1px #fff}.vk-admin-banner a.admin_banner img{max-width:100%;height:auto;display:block}.vk-admin-banner a.admin_banner img:hover{opacity:.7}.vk-admin-banner .vektor_logo{margin-top:1em}.vk-admin-banner .vektor_logo img{width:150px;float:right}#vk_dashboard_widget .vk-admin-banner-grid{width:100%;display:flex;flex-wrap:wrap;justify-content:space-between}#vk_dashboard_widget .vk-admin-banner-grid a.admin_banner{width:48%}.wp-core-ui .button-block{display:block;width:100%;text-align:center}.logo_exUnit{display:block;overflow:hidden;text-align:center;margin-bottom:10px;border-bottom:1px solid #ccc}.logo_exUnit img{width:150px;max-width:100%}.vk_option_nav{display:block!important;overflow:hidden}.vk_option_nav ul{display:block;overflow:hidden;margin:0;padding:0}.vk_option_nav ul li{display:block;border:1px solid #ccc;margin-bottom:0;border-bottom:none;background-color:#fff}.vk_option_nav ul li:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.vk_option_nav ul li:last-child{border-bottom-left-radius:3px;border-bottom-right-radius:3px;border-bottom:1px solid #ccc}.vk_option_nav ul li:hover{background-color:#666}.vk_option_nav ul li a{display:block;overflow:hidden;padding:.5em;text-decoration:none;color:#666;font-size:12px}.vk_option_nav ul li:hover a{color:#fff;border:none}.vk_option_nav ul li.current{background-color:#333;color:#fff}.vk_option_nav ul li.current a{color:#fff}.vk_admin_page{padding-top:1em}.vk_admin_page h2.page_title{font-size:16px;text-align:center;line-height:140%;margin:10px 0 20px}.vk_admin_page h3{background-color:#333;color:#fff;padding:10px 15px;font-size:150%;margin-top:0;border-left:5px solid #e50000;border-radius:4px}.vk_admin_page input[type=text]{width:50%}.vk_admin_page select{width:50%}.vk_admin_page dl dt{font-weight:700;margin-bottom:5px}.vk_admin_page dl dd{margin-left:0}.vk_admin_page tr.dev_object{display:none}.vk_admin_page .pageLogo{text-align:center}.vk_admin_page .pageLogo img{max-width:150px;margin:0 auto}.vk_admin_page .adminMain{display:block;overflow:hidden;width:74%;float:left}.vk_admin_page .adminMain #adminContent_sub{display:block;overflow:hidden;width:23%;float:left;padding-bottom:10px}.vk_admin_page .adminMain #adminContent_main{display:block;overflow:hidden;width:74%;float:right;min-height:300px}.vk_admin_page .adminMain #adminContent_main .form_horizontal_item{margin-right:1em}.vk_admin_page .adminMain.column_2 #adminContent_main{width:100%}.vk_admin_page .adminSub{display:block;overflow:hidden;width:24%;float:right;padding-bottom:10px}.vk_admin_page .adminSub .infoBox{display:block;overflow:hidden;padding:1em;margin-bottom:1em;background-color:#fff;border-radius:4px}.vk_admin_page .adminSub .vk-metabox-sub-title{background-color:#ccc;width:auto;padding:5px 10px;border-radius:3px;margin-top:0;margin-bottom:15px}.vk_admin_page .adminSub .vk-metabox-more-link{display:none}.admin-custom-section,.admin_widget_section{display:block;overflow:hidden;margin:1.5em 0}.admin-custom-section p,.admin_widget_section p{margin-top:.5em}.admin-custom-h2,.admin_widget_h2{box-sizing:border-box;margin:1em 0 1em;padding:.8em 1em;width:100%;border:solid 1px #ddd;border-radius:5px;background:#555;color:#fff;font-size:1.1em}.admin-custom-h3,.admin_widget_h3{box-sizing:border-box;padding:.4em 0;margin-bottom:.3em;width:100%;border-bottom:solid 1px #ddd;font-size:1em}input[type=checkbox].admin-custom-input,input[type=checkbox].admin_widget_input,input[type=color].admin-custom-input,input[type=color].admin_widget_input,input[type=date].admin-custom-input,input[type=date].admin_widget_input,input[type=datetime-local].admin-custom-input,input[type=datetime-local].admin_widget_input,input[type=datetime].admin-custom-input,input[type=datetime].admin_widget_input,input[type=email].admin-custom-input,input[type=email].admin_widget_input,input[type=month].admin-custom-input,input[type=month].admin_widget_input,input[type=number].admin-custom-input,input[type=number].admin_widget_input,input[type=password].admin-custom-input,input[type=password].admin_widget_input,input[type=radio].admin-custom-input,input[type=radio].admin_widget_input,input[type=search].admin-custom-input,input[type=search].admin_widget_input,input[type=tel].admin-custom-input,input[type=tel].admin_widget_input,input[type=text].admin-custom-input,input[type=text].admin_widget_input,input[type=time].admin-custom-input,input[type=time].admin_widget_input,input[type=url].admin-custom-input,input[type=url].admin_widget_input,input[type=week].admin-custom-input,input[type=week].admin_widget_input,select.admin-custom-input,select.admin_widget_input,textarea.admin-custom-input,textarea.admin_widget_input{width:100%;margin:.3em 0}.admin-custom-thumb-outer,.admin_widget_thumb_outer{position:relative;overflow:hidden;z-index:2;margin:3px 0;min-height:70px;border:1px solid #e5e5e5;background-color:#f5f5f5;width:100%}.admin-custom-thumb-outer:before,.admin_widget_thumb_outer:before{position:absolute;top:50%;left:50%;z-index:1;margin:-8px 0 0 -30px;color:#999;content:"No Image"}.admin-custom-thumb,.admin_widget_thumb{position:relative;z-index:3;display:block;width:100%;height:auto}.vk_checklist_item-style-vertical{display:flex}.vk_checklist_item .vk_checklist_item_input{margin-top:0}@media (max-width:991px){.vk_admin_page .adminSub .adminMain table.form-table td,.vk_admin_page .adminSub .adminMain table.form-table th{display:block}.vk_admin_page .adminSub .adminMain table.form-table th{background-color:#ccc;width:auto;padding:10px;border-radius:3px}}
|
inc/vk-admin/package/images/ExUnit_bnr.png
ADDED
Binary file
|
inc/vk-admin/package/images/admin_banner_recruit.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/billvektor_banner.png
ADDED
Binary file
|
inc/vk-admin/package/images/fort-bnr.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/job_banner-336_280-en.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/job_banner-336_280-ja.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/jpnstyle-bnr.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/lightning-pro-bnr.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/lightning_bnr_en.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/lightning_bnr_ja.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/no-image.png
ADDED
Binary file
|
inc/vk-admin/package/images/pale-bnr.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/post_author_display_bnr_en.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/post_author_display_bnr_ja.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/variety-bnr.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/vektor_logo.png
ADDED
Binary file
|
inc/vk-admin/package/images/vk-link-target-controller_bnr.jpg
ADDED
Binary file
|
inc/vk-admin/package/images/vk-link-target-controller_notxt_bnr.jpg
ADDED
Binary file
|
inc/vk-admin/package/js/vk_admin.js
ADDED
@@ -0,0 +1,159 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
/*-------------------------------------------*/
|
2 |
+
/* メディアアップローダー
|
3 |
+
/*-------------------------------------------*/
|
4 |
+
jQuery(document).ready(function($){
|
5 |
+
var custom_uploader;
|
6 |
+
// var media_id = new Array(2); //配列の宣言
|
7 |
+
// media_id[0] = "head_logo";
|
8 |
+
// media_id[1] = "foot_logo";
|
9 |
+
|
10 |
+
//for (i = 0; i < media_id.length; i++) { //iという変数に0をいれループ一回ごとに加算する
|
11 |
+
|
12 |
+
// var media_btn = '#media_' + media_id[i];
|
13 |
+
// var media_target = '#' + media_id[i];
|
14 |
+
jQuery('.media_btn').click(function(e) {
|
15 |
+
|
16 |
+
// 画像URLで値を返す場合
|
17 |
+
media_target_src = jQuery(this).attr('id').replace(/media_src_/g,'#');
|
18 |
+
// id で値を返す場合
|
19 |
+
media_target = jQuery(this).attr('id').replace(/media_/g,'#');
|
20 |
+
thumb_src = jQuery(this).attr('id').replace(/media_/g,'#thumb_');
|
21 |
+
|
22 |
+
e.preventDefault();
|
23 |
+
if (custom_uploader) {
|
24 |
+
custom_uploader.open();
|
25 |
+
return;
|
26 |
+
}
|
27 |
+
custom_uploader = wp.media({
|
28 |
+
// title: 'Choose Image',
|
29 |
+
// 以下のコメントアウトを解除すると画像のみに限定される。 → されないみたい
|
30 |
+
library: {
|
31 |
+
type: 'image'
|
32 |
+
},
|
33 |
+
// button: {
|
34 |
+
// text: 'Choose Image'
|
35 |
+
// },
|
36 |
+
multiple: false, // falseにすると画像を1つしか選択できなくなる
|
37 |
+
});
|
38 |
+
custom_uploader.on('select', function() {
|
39 |
+
var images = custom_uploader.state().get('selection');
|
40 |
+
images.each(function(file){
|
41 |
+
// urlを返す場合
|
42 |
+
jQuery(media_target_src).attr('value', file.toJSON().url );
|
43 |
+
// idを返す場合
|
44 |
+
jQuery(media_target).attr('value', file.toJSON().id );
|
45 |
+
jQuery(thumb_src).attr('src', file.toJSON().url );
|
46 |
+
});
|
47 |
+
});
|
48 |
+
custom_uploader.open();
|
49 |
+
});
|
50 |
+
//}
|
51 |
+
|
52 |
+
});
|
53 |
+
|
54 |
+
/*-------------------------------------------*/
|
55 |
+
/* ページ内の表示/非表示切り替えセクションの追加
|
56 |
+
/*-------------------------------------------*/
|
57 |
+
jQuery(document).ready(function($){
|
58 |
+
jQuery('.showHideSection .showHideBtn').on("click", function() {
|
59 |
+
jQuery(this).next().slideToggle();
|
60 |
+
});
|
61 |
+
});
|
62 |
+
|
63 |
+
/*-------------------------------------------*/
|
64 |
+
/* スクロール時の位置固定
|
65 |
+
/*-------------------------------------------*/
|
66 |
+
jQuery(document).ready(function(){
|
67 |
+
|
68 |
+
// サイドバー要素のデフォルトの絶対位置
|
69 |
+
var default_offset = jQuery('.scrTracking').offset();
|
70 |
+
|
71 |
+
// コンテンツエリアの高さを取得
|
72 |
+
var contentHeight = jQuery('.adminMain').height();
|
73 |
+
|
74 |
+
navMove( default_offset, contentHeight );
|
75 |
+
|
76 |
+
// スクロールしたら
|
77 |
+
jQuery(window).scroll(function () {
|
78 |
+
navMove( default_offset, contentHeight );
|
79 |
+
});
|
80 |
+
jQuery(window).resize(function(){
|
81 |
+
navMove( default_offset, contentHeight );
|
82 |
+
});
|
83 |
+
});
|
84 |
+
|
85 |
+
function navMove( default_offset, contentHeight ){
|
86 |
+
|
87 |
+
// ウィンドウの高さを取得
|
88 |
+
var windowHeight = jQuery(window).height();
|
89 |
+
|
90 |
+
// スクロール量
|
91 |
+
var scrollHeight = jQuery(this).scrollTop();
|
92 |
+
|
93 |
+
var marginBottom = 15;
|
94 |
+
|
95 |
+
jQuery('.scrTracking').each(function(i){
|
96 |
+
|
97 |
+
// サイドバー要素の高さ
|
98 |
+
var itemHeight = jQuery(this).height();
|
99 |
+
|
100 |
+
// ウィンドウサイズからはみ出すサイズ
|
101 |
+
if ( itemHeight < windowHeight ){
|
102 |
+
var overHeight = 0;
|
103 |
+
} else {
|
104 |
+
var overHeight = itemHeight - windowHeight;
|
105 |
+
}
|
106 |
+
|
107 |
+
if ( scrollHeight < contentHeight ){ // これがないと延々とスクロールする
|
108 |
+
|
109 |
+
if ( windowHeight < itemHeight ) {
|
110 |
+
// アイテムがウィンドウサイズより高い場合
|
111 |
+
|
112 |
+
if ( scrollHeight > overHeight ) {
|
113 |
+
// はみ出してる高さよりスクロールが大きい場合
|
114 |
+
// スクロール量からはみ出してる高さを引いた余白を追加
|
115 |
+
var marginTop = scrollHeight - overHeight - default_offset['top'] - marginBottom;
|
116 |
+
jQuery(this).css({"margin-top":marginTop});
|
117 |
+
} else {
|
118 |
+
// はみ出してる高さよりスクロールが小さい場合
|
119 |
+
jQuery(this).css({"margin-top":0});
|
120 |
+
}
|
121 |
+
|
122 |
+
} else {
|
123 |
+
// アイテムがウィンドウサイズより低い場合
|
124 |
+
jQuery(this).css({ "margin-top" : scrollHeight });
|
125 |
+
}
|
126 |
+
}
|
127 |
+
|
128 |
+
});
|
129 |
+
}
|
130 |
+
|
131 |
+
|
132 |
+
/*-------------------------------------------*/
|
133 |
+
/* ページ内リンクで頭出しの余白を適切にする
|
134 |
+
/*-------------------------------------------*/
|
135 |
+
jQuery(document).ready(function(){
|
136 |
+
if(!jQuery('body').hasClass('exunit_page_vkExUnit_main_setting')){ return; }
|
137 |
+
// 一つ目のセクションの位置を取得
|
138 |
+
var default_offset = jQuery('.adminMain section:first-child').offset();
|
139 |
+
|
140 |
+
// 全てのセクションの上に余白を追加(頭出しがきれいになるようにするため)
|
141 |
+
jQuery('.adminMain section').each(function(i){
|
142 |
+
if (i != 0){ // 読み込んだ時、一つ目は余白要らない
|
143 |
+
jQuery(this).css({"padding-top":default_offset["top"]});
|
144 |
+
}
|
145 |
+
});
|
146 |
+
|
147 |
+
jQuery(window).scroll(function () {
|
148 |
+
// スクロール量を取得
|
149 |
+
var scroll = jQuery(this).scrollTop();
|
150 |
+
|
151 |
+
if ( scroll < default_offset["top"] ){
|
152 |
+
// スクロールが少ない場合は最初のセクションに余白を入れない
|
153 |
+
jQuery('.adminMain section:first-child').css({"padding-top":0});
|
154 |
+
} else {
|
155 |
+
// ある程度スクロールしている状態ならば余白を入れる
|
156 |
+
jQuery('.adminMain section:first-child').css({"padding-top":default_offset["top"]});
|
157 |
+
}
|
158 |
+
});
|
159 |
+
});
|
inc/vk-admin/readme.md
ADDED
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
1 |
+
## 使い方
|
2 |
+
|
3 |
+
1. vk-admin-config.php を vk-admin を使用するプラグインディレクトリに複製
|
4 |
+
1. vk-admin-config.php の中身をプラグインの情報にあわせて書き換える
|
5 |
+
1. プラグインが最初に読み込むPHPファイルなどから require_once( 'inc/vk-admin-config.php' ); などで読み込む
|
inc/vk-admin/vk-admin-config.php
ADDED
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* VK Admin Config
|
4 |
+
*
|
5 |
+
* @package VK Admin
|
6 |
+
*/
|
7 |
+
|
8 |
+
if ( ! defined( 'ABSPATH' ) ) {
|
9 |
+
exit;
|
10 |
+
}
|
11 |
+
|
12 |
+
if ( ! class_exists( 'Vk_Admin' ) ) {
|
13 |
+
require_once plugin_dir_path( __FILE__ ) . '/vk-admin/class-vk-admin.php';
|
14 |
+
}
|
inc/vk-block-patterns/package/class-vk-block-patterns.php
CHANGED
@@ -22,15 +22,14 @@ if ( ! class_exists( 'VK_Block_Patterns' ) ) {
|
|
22 |
public function __construct() {
|
23 |
add_action( 'init', array( __CLASS__, 'register_block_patterns' ), 20 );
|
24 |
add_action( 'init', array( __CLASS__, 'register_post_type' ), 11 );
|
|
|
25 |
}
|
26 |
|
27 |
/**
|
28 |
* Register Post Type for Block Patterns
|
29 |
*/
|
30 |
public static function register_post_type() {
|
31 |
-
|
32 |
global $vbp_prefix;
|
33 |
-
|
34 |
register_post_type(
|
35 |
'vk-block-patterns',
|
36 |
array(
|
@@ -38,6 +37,10 @@ if ( ! class_exists( 'VK_Block_Patterns' ) ) {
|
|
38 |
'public' => false,
|
39 |
'show_ui' => true,
|
40 |
'show_in_menu' => true,
|
|
|
|
|
|
|
|
|
41 |
'has_archive' => false,
|
42 |
'menu_icon' => 'dashicons-screenoptions',
|
43 |
'show_in_rest' => true,
|
@@ -60,6 +63,37 @@ if ( ! class_exists( 'VK_Block_Patterns' ) ) {
|
|
60 |
);
|
61 |
}
|
62 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
63 |
/**
|
64 |
* Register Block Patterns
|
65 |
*/
|
@@ -129,8 +163,8 @@ if ( ! class_exists( 'VK_Block_Patterns' ) ) {
|
|
129 |
}
|
130 |
|
131 |
wp_reset_postdata();
|
132 |
-
|
133 |
}
|
|
|
134 |
}
|
135 |
new VK_Block_Patterns();
|
136 |
}
|
22 |
public function __construct() {
|
23 |
add_action( 'init', array( __CLASS__, 'register_block_patterns' ), 20 );
|
24 |
add_action( 'init', array( __CLASS__, 'register_post_type' ), 11 );
|
25 |
+
add_action( 'admin_init', array( __CLASS__, 'admin_init' ) );
|
26 |
}
|
27 |
|
28 |
/**
|
29 |
* Register Post Type for Block Patterns
|
30 |
*/
|
31 |
public static function register_post_type() {
|
|
|
32 |
global $vbp_prefix;
|
|
|
33 |
register_post_type(
|
34 |
'vk-block-patterns',
|
35 |
array(
|
37 |
'public' => false,
|
38 |
'show_ui' => true,
|
39 |
'show_in_menu' => true,
|
40 |
+
'capabilities' => array(
|
41 |
+
'edit_posts' => 'create_vk_block_patterns',
|
42 |
+
),
|
43 |
+
'map_meta_cap' => true,
|
44 |
'has_archive' => false,
|
45 |
'menu_icon' => 'dashicons-screenoptions',
|
46 |
'show_in_rest' => true,
|
63 |
);
|
64 |
}
|
65 |
|
66 |
+
/**
|
67 |
+
* Role Setting
|
68 |
+
*/
|
69 |
+
public static function admin_init() {
|
70 |
+
|
71 |
+
global $wp_roles;
|
72 |
+
$vbp_options = get_option( 'vk_block_patterns_options' );
|
73 |
+
|
74 |
+
if ( isset( $vbp_options['role'] ) && 'contributor' === $vbp_options['role'] ) {
|
75 |
+
$wp_roles->add_cap( 'administrator', 'create_vk_block_patterns' );
|
76 |
+
$wp_roles->add_cap( 'editor', 'create_vk_block_patterns' );
|
77 |
+
$wp_roles->add_cap( 'author', 'create_vk_block_patterns' );
|
78 |
+
$wp_roles->add_cap( 'contributor', 'create_vk_block_patterns' );
|
79 |
+
} elseif ( isset( $vbp_options['role'] ) && 'author' === $vbp_options['role'] ) {
|
80 |
+
$wp_roles->add_cap( 'administrator', 'create_vk_block_patterns' );
|
81 |
+
$wp_roles->add_cap( 'editor', 'create_vk_block_patterns' );
|
82 |
+
$wp_roles->add_cap( 'author', 'create_vk_block_patterns' );
|
83 |
+
$wp_roles->remove_cap( 'contributor', 'create_vk_block_patterns' );
|
84 |
+
} elseif ( isset( $vbp_options['role'] ) && 'editor' === $vbp_options['role'] ) {
|
85 |
+
$wp_roles->add_cap( 'administrator', 'create_vk_block_patterns' );
|
86 |
+
$wp_roles->add_cap( 'editor', 'create_vk_block_patterns' );
|
87 |
+
$wp_roles->remove_cap( 'author', 'create_vk_block_patterns' );
|
88 |
+
$wp_roles->remove_cap( 'contributor', 'create_vk_block_patterns' );
|
89 |
+
} else {
|
90 |
+
$wp_roles->add_cap( 'administrator', 'create_vk_block_patterns' );
|
91 |
+
$wp_roles->remove_cap( 'editor', 'create_vk_block_patterns' );
|
92 |
+
$wp_roles->remove_cap( 'author', 'create_vk_block_patterns' );
|
93 |
+
$wp_roles->remove_cap( 'contributor', 'create_vk_block_patterns' );
|
94 |
+
}
|
95 |
+
}
|
96 |
+
|
97 |
/**
|
98 |
* Register Block Patterns
|
99 |
*/
|
163 |
}
|
164 |
|
165 |
wp_reset_postdata();
|
|
|
166 |
}
|
167 |
+
|
168 |
}
|
169 |
new VK_Block_Patterns();
|
170 |
}
|
languages/vk-block-patterns-ja.mo
ADDED
Binary file
|
languages/vk-block-patterns-ja.po
ADDED
@@ -0,0 +1,49 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
msgid ""
|
2 |
+
msgstr ""
|
3 |
+
"Project-Id-Version: VK Block Patterns\n"
|
4 |
+
"POT-Creation-Date: 2020-08-19 13:31+0900\n"
|
5 |
+
"PO-Revision-Date: 2020-08-19 13:31+0900\n"
|
6 |
+
"Last-Translator: \n"
|
7 |
+
"Language-Team: \n"
|
8 |
+
"Language: ja\n"
|
9 |
+
"MIME-Version: 1.0\n"
|
10 |
+
"Content-Type: text/plain; charset=UTF-8\n"
|
11 |
+
"Content-Transfer-Encoding: 8bit\n"
|
12 |
+
"X-Generator: Poedit 2.4.1\n"
|
13 |
+
"X-Poedit-Basepath: ..\n"
|
14 |
+
"Plural-Forms: nplurals=1; plural=0;\n"
|
15 |
+
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
|
16 |
+
"X-Poedit-WPHeader: vk-block-patterns.php\n"
|
17 |
+
"X-Poedit-SourceCharset: UTF-8\n"
|
18 |
+
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
19 |
+
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
|
20 |
+
"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
21 |
+
"X-Poedit-SearchPath-0: .\n"
|
22 |
+
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
|
23 |
+
|
24 |
+
#: inc/vk-block-patterns/package/class-vk-block-patterns.php:31
|
25 |
+
msgid "Block Patterns"
|
26 |
+
msgstr "ブロックパターン"
|
27 |
+
|
28 |
+
#. Plugin Name of the plugin/theme
|
29 |
+
msgid "VK Block Patterns"
|
30 |
+
msgstr "VK Block Patterns"
|
31 |
+
|
32 |
+
#. Plugin URI of the plugin/theme
|
33 |
+
#. Author URI of the plugin/theme
|
34 |
+
msgid "https://lightning.nagoya/"
|
35 |
+
msgstr "https://lightning.nagoya/"
|
36 |
+
|
37 |
+
#. Description of the plugin/theme
|
38 |
+
msgid "You can make and register your original custom block patterns."
|
39 |
+
msgstr "オリジナルのカスタムブロックパターンを作って登録できます。"
|
40 |
+
|
41 |
+
#. Author of the plugin/theme
|
42 |
+
msgid "Vektor,Inc."
|
43 |
+
msgstr "Vektor,Inc."
|
44 |
+
|
45 |
+
#~ msgid "Category"
|
46 |
+
#~ msgstr "カテゴリー"
|
47 |
+
|
48 |
+
#~ msgid "Block Patterns Category"
|
49 |
+
#~ msgstr "ブロックパターンカテゴリー"
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: Guternberg, Block Pattern
|
5 |
Requires at least: 5.5
|
6 |
Tested up to: 5.5
|
7 |
-
Stable tag: 0.0
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
@@ -14,3 +14,7 @@ You can make and register your original custom block patterns.
|
|
14 |
== Description ==
|
15 |
When you activate this plugin that create new custom post type for custom block patterns. If you register custom patterns that you can select registered block patterns on edit screen.
|
16 |
|
|
|
|
|
|
|
|
4 |
Tags: Guternberg, Block Pattern
|
5 |
Requires at least: 5.5
|
6 |
Tested up to: 5.5
|
7 |
+
Stable tag: 0.1.0
|
8 |
Requires PHP: 5.6
|
9 |
License: GPLv2 or later
|
10 |
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
14 |
== Description ==
|
15 |
When you activate this plugin that create new custom post type for custom block patterns. If you register custom patterns that you can select registered block patterns on edit screen.
|
16 |
|
17 |
+
== Changelog ==
|
18 |
+
|
19 |
+
= 0.1.0 =
|
20 |
+
[ Add function ] Add role function
|
vk-block-patterns.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: VK Block Patterns
|
4 |
* Plugin URI: https://github.com/vektor-inc/vk-block-patterns
|
5 |
* Description: You can make and register your original custom block patterns.
|
6 |
-
* Version: 0.0
|
7 |
* Author: Vektor,Inc.
|
8 |
* Author URI: https://vektor-inc.co.jp
|
9 |
* Text Domain: vk-block-patterns
|
@@ -41,7 +41,11 @@ $vbp_prefix = apply_filters( 'vbp_prefix', 'VK ' );
|
|
41 |
function vbp_plugin_loaded() {
|
42 |
|
43 |
// Load Main File.
|
44 |
-
require_once VBP_PATH . '
|
|
|
|
|
|
|
|
|
45 |
}
|
46 |
add_action( 'plugins_loaded', 'vbp_plugin_loaded' );
|
47 |
|
3 |
* Plugin Name: VK Block Patterns
|
4 |
* Plugin URI: https://github.com/vektor-inc/vk-block-patterns
|
5 |
* Description: You can make and register your original custom block patterns.
|
6 |
+
* Version: 0.1.0
|
7 |
* Author: Vektor,Inc.
|
8 |
* Author URI: https://vektor-inc.co.jp
|
9 |
* Text Domain: vk-block-patterns
|
41 |
function vbp_plugin_loaded() {
|
42 |
|
43 |
// Load Main File.
|
44 |
+
require_once VBP_PATH . 'inc/vk-block-patterns/vk-block-patterns-config.php';
|
45 |
+
// Load VKAdmin.
|
46 |
+
require_once VBP_PATH . 'inc/vk-admin/vk-admin-config.php';
|
47 |
+
// Load Admin Options.
|
48 |
+
require_once VBP_PATH . 'admin/admin.php';
|
49 |
}
|
50 |
add_action( 'plugins_loaded', 'vbp_plugin_loaded' );
|
51 |
|