Version Description
- [ Bug fix ] Fixed add common attributes ( attribute from VK Blocks 1.29 - )
- [ Specification Change ] Use composer vk-term-color
Download this release
Release Info
Developer | kurudrive |
Plugin | VK All in One Expansion Unit |
Version | 9.74.2.0 |
Comparing to | |
See all releases |
Code changes from version 9.74.1.0 to 9.74.2.0
- inc/child-page-index/child-page-index.php +2 -2
- inc/common-block.php +16 -2
- inc/contact-section/contact-section.php +2 -2
- inc/other-widget/widget-new-posts.php +4 -1
- inc/page-list-ancestor/page-list-ancestor.php +2 -2
- inc/sitemap-page/sitemap-page.php +3 -3
- inc/sns/function-sns-btns.php +2 -2
- inc/term-color/package/class.term-color.php +0 -312
- inc/term-color/term-color-config.php +0 -29
- initialize.php +0 -1
- readme.txt +4 -0
- vendor/autoload.php +1 -1
- vendor/composer/autoload_classmap.php +1 -0
- vendor/composer/autoload_psr4.php +1 -0
- vendor/composer/autoload_real.php +4 -4
- vendor/composer/autoload_static.php +10 -4
- vendor/composer/installed.json +40 -0
- vendor/composer/installed.php +15 -6
- vendor/vektor-inc/vk-term-color/LICENSE +339 -0
- vendor/vektor-inc/vk-term-color/src/VkTermColor.php +310 -0
- vkExUnit.php +1 -1
inc/child-page-index/child-page-index.php
CHANGED
@@ -40,8 +40,8 @@ function veu_childPageIndex_block_callback( $attributes = array() ) {
|
|
40 |
$classes .= ' ' . $attributes['className'];
|
41 |
}
|
42 |
|
43 |
-
if ( function_exists( '
|
44 |
-
$classes .= ' ' .
|
45 |
}
|
46 |
|
47 |
$postId = ( $attributes['postId'] > 0 ) ? $attributes['postId'] : get_the_ID();
|
40 |
$classes .= ' ' . $attributes['className'];
|
41 |
}
|
42 |
|
43 |
+
if ( function_exists( 'veu_add_common_attributes_class' ) ) {
|
44 |
+
$classes .= ' ' . veu_add_common_attributes_class( $classes, $attributes );
|
45 |
}
|
46 |
|
47 |
$postId = ( $attributes['postId'] > 0 ) ? $attributes['postId'] : get_the_ID();
|
inc/common-block.php
CHANGED
@@ -94,17 +94,25 @@ function veu_common_attributes() {
|
|
94 |
'type' => 'boolean',
|
95 |
'default' => false,
|
96 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
97 |
);
|
98 |
return $common_attributes;
|
99 |
}
|
100 |
|
101 |
/**
|
102 |
-
*
|
103 |
*
|
104 |
* @param string $classes added classes.
|
105 |
* @param string $attributes attributes.
|
106 |
*/
|
107 |
-
function
|
108 |
|
109 |
if ( isset( $attributes['vkb_hidden'] ) && $attributes['vkb_hidden'] ) {
|
110 |
$classes .= ' vk_hidden';
|
@@ -127,6 +135,12 @@ function veu_add_hidden_class( $classes, $attributes ) {
|
|
127 |
if ( isset( $attributes['vkb_hidden_xs'] ) && $attributes['vkb_hidden_xs'] ) {
|
128 |
$classes .= ' vk_hidden-xs';
|
129 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
130 |
|
131 |
return $classes;
|
132 |
}
|
94 |
'type' => 'boolean',
|
95 |
'default' => false,
|
96 |
),
|
97 |
+
'marginTop' => array(
|
98 |
+
'type' => 'string',
|
99 |
+
'default' => '',
|
100 |
+
),
|
101 |
+
'marginBottom' => array(
|
102 |
+
'type' => 'string',
|
103 |
+
'default' => '',
|
104 |
+
),
|
105 |
);
|
106 |
return $common_attributes;
|
107 |
}
|
108 |
|
109 |
/**
|
110 |
+
* Common Class Options
|
111 |
*
|
112 |
* @param string $classes added classes.
|
113 |
* @param string $attributes attributes.
|
114 |
*/
|
115 |
+
function veu_add_common_attributes_class( $classes, $attributes ) {
|
116 |
|
117 |
if ( isset( $attributes['vkb_hidden'] ) && $attributes['vkb_hidden'] ) {
|
118 |
$classes .= ' vk_hidden';
|
135 |
if ( isset( $attributes['vkb_hidden_xs'] ) && $attributes['vkb_hidden_xs'] ) {
|
136 |
$classes .= ' vk_hidden-xs';
|
137 |
}
|
138 |
+
if ( isset( $attributes['marginTop'] ) && $attributes['marginTop'] ) {
|
139 |
+
$classes .= ' ' . $attributes['marginTop'];
|
140 |
+
}
|
141 |
+
if ( isset( $attributes['marginBottom'] ) && $attributes['marginBottom'] ) {
|
142 |
+
$classes .= ' ' . $attributes['marginBottom'];
|
143 |
+
}
|
144 |
|
145 |
return $classes;
|
146 |
}
|
inc/contact-section/contact-section.php
CHANGED
@@ -149,8 +149,8 @@ class VkExUnit_Contact {
|
|
149 |
if ( isset($attributes['className']) ) {
|
150 |
$classes .= ' ' . $attributes['className'];
|
151 |
}
|
152 |
-
if ( function_exists( '
|
153 |
-
$classes .= ' ' .
|
154 |
}
|
155 |
|
156 |
$r = self::render_contact_section_html( $classes, false );
|
149 |
if ( isset($attributes['className']) ) {
|
150 |
$classes .= ' ' . $attributes['className'];
|
151 |
}
|
152 |
+
if ( function_exists( 'veu_add_common_attributes_class' ) ) {
|
153 |
+
$classes .= ' ' . veu_add_common_attributes_class( $classes, $attributes );
|
154 |
}
|
155 |
|
156 |
$r = self::render_contact_section_html( $classes, false );
|
inc/other-widget/widget-new-posts.php
CHANGED
@@ -3,6 +3,9 @@
|
|
3 |
Side Post list widget
|
4 |
/*-------------------------------------------*/
|
5 |
|
|
|
|
|
|
|
6 |
class WP_Widget_vkExUnit_post_list extends WP_Widget {
|
7 |
function __construct() {
|
8 |
parent::__construct(
|
@@ -228,7 +231,7 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
|
|
228 |
foreach ( $terms as $term ) {
|
229 |
$link = get_term_link( $term->term_id );
|
230 |
if ( class_exists( 'Vk_term_color' ) ) {
|
231 |
-
$term_color =
|
232 |
$term_color = ( $term_color ) ? ' style="background-color:' . $term_color . ';border:none;color:white;"' : '';
|
233 |
}
|
234 |
$li_items_output .= '<span class="postList_terms postList_meta_items">';
|
3 |
Side Post list widget
|
4 |
/*-------------------------------------------*/
|
5 |
|
6 |
+
// vendor/vektor-inc/vk-term-color/src
|
7 |
+
use VektorInc\VK_Term_Color\VkTermColor;
|
8 |
+
|
9 |
class WP_Widget_vkExUnit_post_list extends WP_Widget {
|
10 |
function __construct() {
|
11 |
parent::__construct(
|
231 |
foreach ( $terms as $term ) {
|
232 |
$link = get_term_link( $term->term_id );
|
233 |
if ( class_exists( 'Vk_term_color' ) ) {
|
234 |
+
$term_color = VkTermColor::get_term_color( $term->term_id );
|
235 |
$term_color = ( $term_color ) ? ' style="background-color:' . $term_color . ';border:none;color:white;"' : '';
|
236 |
}
|
237 |
$li_items_output .= '<span class="postList_terms postList_meta_items">';
|
inc/page-list-ancestor/page-list-ancestor.php
CHANGED
@@ -172,8 +172,8 @@ function veu_pageListAncestor_block_callback( $attr=array() ) {
|
|
172 |
$classes .= ' ' . $attr['className'];
|
173 |
}
|
174 |
|
175 |
-
if( function_exists( '
|
176 |
-
$classes .= ' ' .
|
177 |
}
|
178 |
|
179 |
$r = vkExUnit_pageList_ancestor_shortcode( $classes, true );
|
172 |
$classes .= ' ' . $attr['className'];
|
173 |
}
|
174 |
|
175 |
+
if( function_exists( 'veu_add_common_attributes_class' ) ){
|
176 |
+
$classes .= ' ' . veu_add_common_attributes_class($classes, $attr);
|
177 |
}
|
178 |
|
179 |
$r = vkExUnit_pageList_ancestor_shortcode( $classes, true );
|
inc/sitemap-page/sitemap-page.php
CHANGED
@@ -90,9 +90,9 @@ function veu_show_sitemap( $content ) {
|
|
90 |
function vkExUnit_sitemap( $attr ) {
|
91 |
|
92 |
$classes = '';
|
93 |
-
if ( function_exists( '
|
94 |
-
if (
|
95 |
-
$classes .= ' ' .
|
96 |
}
|
97 |
}
|
98 |
|
90 |
function vkExUnit_sitemap( $attr ) {
|
91 |
|
92 |
$classes = '';
|
93 |
+
if ( function_exists( 'veu_add_common_attributes_class' ) ) {
|
94 |
+
if ( veu_add_common_attributes_class( $classes, $attr ) ) {
|
95 |
+
$classes .= ' ' . veu_add_common_attributes_class( $classes, $attr );
|
96 |
}
|
97 |
}
|
98 |
|
inc/sns/function-sns-btns.php
CHANGED
@@ -190,8 +190,8 @@ function veu_get_sns_btns( $attr = array() ) {
|
|
190 |
$page_title = rawurlencode( veu_get_the_sns_title() );
|
191 |
|
192 |
$classes = '';
|
193 |
-
if ( function_exists( '
|
194 |
-
$classes .=
|
195 |
}
|
196 |
|
197 |
if ( isset( $attr['position'] ) ) {
|
190 |
$page_title = rawurlencode( veu_get_the_sns_title() );
|
191 |
|
192 |
$classes = '';
|
193 |
+
if ( function_exists( 'veu_add_common_attributes_class' ) ) {
|
194 |
+
$classes .= veu_add_common_attributes_class( $classes, $attr );
|
195 |
}
|
196 |
|
197 |
if ( isset( $attr['position'] ) ) {
|
inc/term-color/package/class.term-color.php
DELETED
@@ -1,312 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/*
|
3 |
-
このファイルの元ファイルは
|
4 |
-
https://github.com/vektor-inc/vektor-wp-libraries
|
5 |
-
にあります。修正の際は上記リポジトリのデータを修正してください。
|
6 |
-
*/
|
7 |
-
|
8 |
-
if ( ! class_exists( 'Vk_term_color' ) ) {
|
9 |
-
|
10 |
-
class Vk_term_color {
|
11 |
-
|
12 |
-
/**
|
13 |
-
* Construct
|
14 |
-
*/
|
15 |
-
public function __construct() {
|
16 |
-
add_action( 'init', array( $this, 'term_meta_color' ) );
|
17 |
-
add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
|
18 |
-
|
19 |
-
/********************************************
|
20 |
-
* 管理画面 _ 各種処理発火
|
21 |
-
*/
|
22 |
-
// カラーピッカーを追加するタクソノミー.
|
23 |
-
$taxonomies = self::get_term_color_taxonomies();
|
24 |
-
|
25 |
-
// 該当のタクソノミー分ループ処理する.
|
26 |
-
foreach ( $taxonomies as $key => $value ) {
|
27 |
-
add_action( $value . '_add_form_fields', array( $this, 'taxonomy_add_new_meta_field_color' ), 10, 2 );
|
28 |
-
add_action( $value . '_edit_form_fields', array( $this, 'taxonomy_add_edit_meta_field_color' ), 10, 2 );
|
29 |
-
add_action( 'edited_' . $value, array( $this, 'save_term_meta_color' ), 10, 2 );
|
30 |
-
add_action( 'create_' . $value, array( $this, 'save_term_meta_color' ), 10, 2 );
|
31 |
-
add_filter( 'manage_edit-' . $value . '_columns', array( $this, 'edit_term_columns' ) );
|
32 |
-
add_filter( 'manage_' . $value . '_custom_column', array( $this, 'manage_term_custom_column' ), 10, 3 );
|
33 |
-
}
|
34 |
-
}
|
35 |
-
|
36 |
-
/**
|
37 |
-
* REGISTER TERM META
|
38 |
-
*
|
39 |
-
* @return void
|
40 |
-
*/
|
41 |
-
public static function term_meta_color() {
|
42 |
-
register_meta( 'term', 'term_color', array( __CLASS__, 'sanitize_hex' ) );
|
43 |
-
}
|
44 |
-
|
45 |
-
/**
|
46 |
-
* SANITIZE color method
|
47 |
-
*
|
48 |
-
* @param string $color : color code.
|
49 |
-
* @return string
|
50 |
-
*/
|
51 |
-
public static function sanitize_hex( $color ) {
|
52 |
-
// sanitize_hex_color() は undefined function くらう.
|
53 |
-
$color = ltrim( $color, '#' );
|
54 |
-
return preg_match( '/([A-Fa-f0-9]{3}){1,2}$/', $color ) ? $color : '';
|
55 |
-
}
|
56 |
-
|
57 |
-
/**
|
58 |
-
* タクソノミー新規追加ページでの日本語入力フォーム
|
59 |
-
*
|
60 |
-
* @return void
|
61 |
-
*/
|
62 |
-
public static function taxonomy_add_new_meta_field_color() {
|
63 |
-
// this will add the custom meta field to the add new term page.
|
64 |
-
?>
|
65 |
-
<div class="form-field">
|
66 |
-
<?php wp_nonce_field( basename( __FILE__ ), 'term_color_nonce' ); ?>
|
67 |
-
<label for="term_color"><?php _e( 'Color', 'vk-all-in-one-expansion-unit' ); ?></label>
|
68 |
-
<input type="text" name="term_color" id="term_color" class="term_color" value="">
|
69 |
-
</div>
|
70 |
-
<?php
|
71 |
-
}
|
72 |
-
|
73 |
-
/**
|
74 |
-
* タクソノミー編集ページでのフォーム
|
75 |
-
*
|
76 |
-
* @param object $term : term object.
|
77 |
-
* @return void
|
78 |
-
*/
|
79 |
-
public static function taxonomy_add_edit_meta_field_color( $term ) {
|
80 |
-
|
81 |
-
// put the term ID into a variable.
|
82 |
-
$term_color = self::get_term_color( $term->term_id );
|
83 |
-
?>
|
84 |
-
<tr class="form-field">
|
85 |
-
<th scope="row" valign="top"><label for="term_color"><?php esc_html_e( 'Color', 'vk-all-in-one-expansion-unit' ); ?></label></th>
|
86 |
-
<td>
|
87 |
-
<?php wp_nonce_field( basename( __FILE__ ), 'term_color_nonce' ); ?>
|
88 |
-
<input type="text" name="term_color" id="term_color" class="term_color" value="<?php echo esc_attr( $term_color ); ?>">
|
89 |
-
</td>
|
90 |
-
</tr>
|
91 |
-
<?php
|
92 |
-
}
|
93 |
-
|
94 |
-
/**
|
95 |
-
* カラーの保存処理
|
96 |
-
* Save extra taxonomy fields callback function.
|
97 |
-
*
|
98 |
-
* @param int $term_id : term id.
|
99 |
-
* @return void
|
100 |
-
*/
|
101 |
-
public static function save_term_meta_color( $term_id ) {
|
102 |
-
|
103 |
-
// verify the nonce --- remove if you don't care.
|
104 |
-
if ( ! isset( $_POST['term_color_nonce'] ) || ! wp_verify_nonce( $_POST['term_color_nonce'], basename( __FILE__ ) ) ) {
|
105 |
-
return;
|
106 |
-
}
|
107 |
-
|
108 |
-
if ( isset( $_POST['term_color'] ) ) {
|
109 |
-
$now_value = get_term_meta( $term_id, 'term_color', true );
|
110 |
-
$new_value = esc_html( wp_unslash( $_POST['term_color'] ) );
|
111 |
-
if ( $now_value !== $new_value ) {
|
112 |
-
update_term_meta( $term_id, 'term_color', $new_value );
|
113 |
-
} else {
|
114 |
-
add_term_meta( $term_id, 'term_color', $new_value );
|
115 |
-
}
|
116 |
-
}
|
117 |
-
}
|
118 |
-
|
119 |
-
/**
|
120 |
-
* 管理画面 _ カラーピッカーのスクリプトの読み込み
|
121 |
-
*
|
122 |
-
* @param string $hook_suffix : page suffix.
|
123 |
-
* @return void
|
124 |
-
*/
|
125 |
-
public static function admin_enqueue_scripts( $hook_suffix ) {
|
126 |
-
|
127 |
-
wp_enqueue_style( 'wp-color-picker' );
|
128 |
-
wp_enqueue_script( 'wp-color-picker' );
|
129 |
-
|
130 |
-
add_action( 'admin_footer', array( __CLASS__, 'term_colors_print_scripts' ) );
|
131 |
-
}
|
132 |
-
|
133 |
-
/**
|
134 |
-
* Color style
|
135 |
-
*
|
136 |
-
* @return void
|
137 |
-
*/
|
138 |
-
public static function term_colors_print_styles() {
|
139 |
-
?>
|
140 |
-
|
141 |
-
<style type="text/css">
|
142 |
-
.column-color { width: 50px; }
|
143 |
-
.column-color .color-block { display: inline-block; width: 28px; height: 28px; border: 1px solid #ddd; }
|
144 |
-
</style>
|
145 |
-
<?php
|
146 |
-
}
|
147 |
-
|
148 |
-
/**
|
149 |
-
* Add Color Picker
|
150 |
-
*
|
151 |
-
* @return void
|
152 |
-
*/
|
153 |
-
public static function term_colors_print_scripts() {
|
154 |
-
?>
|
155 |
-
<script type="text/javascript">
|
156 |
-
jQuery( document ).ready( function( $ ) {
|
157 |
-
$( '.term_color' ).wpColorPicker();
|
158 |
-
} );
|
159 |
-
</script>
|
160 |
-
<?php
|
161 |
-
}
|
162 |
-
|
163 |
-
/**
|
164 |
-
* 管理画面 _ カテゴリー一覧でカラムの追加
|
165 |
-
*
|
166 |
-
* @param string $columns : column name.
|
167 |
-
* @return string $columns
|
168 |
-
*/
|
169 |
-
public static function edit_term_columns( $columns ) {
|
170 |
-
|
171 |
-
$columns['color'] = __( 'Color', 'vk-all-in-one-expansion-unit' );
|
172 |
-
|
173 |
-
return $columns;
|
174 |
-
}
|
175 |
-
|
176 |
-
|
177 |
-
/**
|
178 |
-
* Insert color column
|
179 |
-
*
|
180 |
-
* @param string $out : admin insert html.
|
181 |
-
* @param string $column insert target column.
|
182 |
-
* @param int $term_id : term id.
|
183 |
-
* @return string $out admin insert html.
|
184 |
-
*/
|
185 |
-
public static function manage_term_custom_column( $out, $column, $term_id ) {
|
186 |
-
|
187 |
-
if ( 'color' === $column ) {
|
188 |
-
|
189 |
-
$color = self::get_term_color( $term_id );
|
190 |
-
|
191 |
-
if ( ! $color ) {
|
192 |
-
$color = '#ffffff';
|
193 |
-
}
|
194 |
-
|
195 |
-
$out = sprintf( '<span class="color-block" style="background:%s;"> </span>', esc_attr( $color ) );
|
196 |
-
}
|
197 |
-
|
198 |
-
return $out;
|
199 |
-
}
|
200 |
-
|
201 |
-
/**
|
202 |
-
* Termのカラーを取得
|
203 |
-
*
|
204 |
-
* @param int $term_id : term id.
|
205 |
-
* @return string $term_color : color code
|
206 |
-
*/
|
207 |
-
public static function get_term_color( $term_id ) {
|
208 |
-
$term_color_default = '#999999';
|
209 |
-
$term_color_default = apply_filters( 'term_color_default_custom', $term_color_default );
|
210 |
-
if ( isset( $term_id ) ) {
|
211 |
-
$term_color = self::sanitize_hex( get_term_meta( $term_id, 'term_color', true ) );
|
212 |
-
$term_color = ( $term_color ) ? '#' . $term_color : $term_color_default;
|
213 |
-
} else {
|
214 |
-
$term_color = $term_color_default;
|
215 |
-
}
|
216 |
-
return $term_color;
|
217 |
-
}
|
218 |
-
|
219 |
-
/**
|
220 |
-
* Term名とカラーを取得
|
221 |
-
*
|
222 |
-
* @param object $post : post object.
|
223 |
-
* @param array $args : setting parametor.
|
224 |
-
* @return void
|
225 |
-
*/
|
226 |
-
public static function get_single_term_with_color( $post = '', $args = array() ) {
|
227 |
-
if ( ! $post ) {
|
228 |
-
global $post;
|
229 |
-
}
|
230 |
-
|
231 |
-
$args_default = array(
|
232 |
-
'class' => '',
|
233 |
-
'link' => false,
|
234 |
-
);
|
235 |
-
$args = wp_parse_args( $args, $args_default );
|
236 |
-
|
237 |
-
$outer_class = '';
|
238 |
-
if ( ! empty( $args['class'] ) ) {
|
239 |
-
$outer_class = ' class="' . esc_attr( $args['class'] ) . '"';
|
240 |
-
}
|
241 |
-
|
242 |
-
$taxonomies = get_the_taxonomies();
|
243 |
-
$exclusion = array( 'post_tag', 'product_type' );
|
244 |
-
// * vk_exclude_term_list is used in lightning too.
|
245 |
-
$exclusion = apply_filters( 'vk_get_display_taxonomies_exclusion', $exclusion );
|
246 |
-
if ( is_array( $exclusion ) ) {
|
247 |
-
foreach ( $exclusion as $key => $value ) {
|
248 |
-
unset( $taxonomies[ $value ] );
|
249 |
-
}
|
250 |
-
}
|
251 |
-
|
252 |
-
$single_term_with_color = '';
|
253 |
-
if ( $taxonomies ) :
|
254 |
-
// get $taxonomy name.
|
255 |
-
$taxonomy = apply_filters( 'vk_term_color_taxonomy', key( $taxonomies ) );
|
256 |
-
$terms = get_the_terms( $post->ID, $taxonomy );
|
257 |
-
if ( ! $terms ) {
|
258 |
-
return;
|
259 |
-
}
|
260 |
-
$term_name = esc_html( $terms[0]->name );
|
261 |
-
$term_url = esc_url( get_term_link( $terms[0]->term_id, $taxonomy ) );
|
262 |
-
$term_color = self::get_term_color( $terms[0]->term_id );
|
263 |
-
$term_color = ( $term_color ) ? ' style="color:#fff;background-color:' . $term_color . '"' : '';
|
264 |
-
|
265 |
-
if ( $args['link'] ) {
|
266 |
-
$single_term_with_color .= '<a' . $outer_class . $term_color . ' href="' . esc_url( $term_url ) . '">';
|
267 |
-
} else {
|
268 |
-
$single_term_with_color .= '<span' . $outer_class . $term_color . '>';
|
269 |
-
}
|
270 |
-
|
271 |
-
$single_term_with_color .= $term_name;
|
272 |
-
|
273 |
-
if ( $args['link'] ) {
|
274 |
-
$single_term_with_color .= '</a>';
|
275 |
-
} else {
|
276 |
-
$single_term_with_color .= '</span>';
|
277 |
-
}
|
278 |
-
|
279 |
-
endif;
|
280 |
-
return apply_filters( 'vk_get_single_term_with_color', $single_term_with_color, $post, $args );
|
281 |
-
}
|
282 |
-
|
283 |
-
/**
|
284 |
-
* Undocumented function
|
285 |
-
*
|
286 |
-
* @return array $taxonomies
|
287 |
-
*/
|
288 |
-
public static function get_term_color_taxonomies() {
|
289 |
-
/*
|
290 |
-
最初Global変数指定をしていたが、 Global変数では
|
291 |
-
複数の term color が存在した場合に実行タイミングの都合上任意に指定が効かないため、
|
292 |
-
フックでの指定を行う
|
293 |
-
*/
|
294 |
-
global $vk_term_color_taxonomies;
|
295 |
-
if ( $vk_term_color_taxonomies ) {
|
296 |
-
$taxonomies = $vk_term_color_taxonomies;
|
297 |
-
} else {
|
298 |
-
$taxonomies = array( 'category', 'post_tag' );
|
299 |
-
}
|
300 |
-
$taxonomies = apply_filters( 'term_color_taxonomies_custom', $taxonomies );
|
301 |
-
// 重複の値を削除.
|
302 |
-
$taxonomies = array_unique( $taxonomies );
|
303 |
-
// 特に影響はないがキーを振り直す.
|
304 |
-
$taxonomies = array_values( $taxonomies );
|
305 |
-
return $taxonomies;
|
306 |
-
}
|
307 |
-
|
308 |
-
}
|
309 |
-
|
310 |
-
$Vk_term_color = new Vk_term_color();
|
311 |
-
|
312 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
inc/term-color/term-color-config.php
DELETED
@@ -1,29 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
|
3 |
-
/**********************************************/
|
4 |
-
// Load modules
|
5 |
-
/**********************************************/
|
6 |
-
|
7 |
-
/*
|
8 |
-
色選択機能をつける対象のタームの指定
|
9 |
-
*/
|
10 |
-
|
11 |
-
// ★★★★★★ 関数のprefixは固有のものに変更する事 ★★★★★★
|
12 |
-
// add_filter( 'term_color_taxonomies_custom', 'fort_term_color_taxonomies_custom', 10.2 );
|
13 |
-
// function fort_term_color_taxonomies_custom( $taxonomies ) {
|
14 |
-
// $taxonomies[] = 'category';
|
15 |
-
// $taxonomies[] = 'post_tags';
|
16 |
-
// return $taxonomies;
|
17 |
-
// }
|
18 |
-
if ( ! class_exists( 'Vk_term_color' ) ) {
|
19 |
-
|
20 |
-
/*
|
21 |
-
読み込みタイミングを init にしておかないと
|
22 |
-
フィールドがカスタム分類の画面で表示されない
|
23 |
-
★★★★★★ 関数のprefixは固有のものに変更する事 ★★★★★★
|
24 |
-
*/
|
25 |
-
add_action( 'init', 'veu_load_term_color' );
|
26 |
-
function veu_load_term_color() {
|
27 |
-
require_once 'package/class.term-color.php';
|
28 |
-
}
|
29 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
initialize.php
CHANGED
@@ -26,7 +26,6 @@ require_once VEU_DIRECTORY_PATH . '/inc/template-tags/template-tags-config.php';
|
|
26 |
require_once VEU_DIRECTORY_PATH . '/inc/vk-helpers/config.php';
|
27 |
require_once VEU_DIRECTORY_PATH . '/inc/common-block.php';
|
28 |
require_once VEU_DIRECTORY_PATH . '/admin/admin.php';
|
29 |
-
require_once VEU_DIRECTORY_PATH . '/inc/term-color/term-color-config.php';
|
30 |
require VEU_DIRECTORY_PATH . '/inc/footer-copyright-change.php';
|
31 |
|
32 |
veu_package_include(); // package_manager.php
|
26 |
require_once VEU_DIRECTORY_PATH . '/inc/vk-helpers/config.php';
|
27 |
require_once VEU_DIRECTORY_PATH . '/inc/common-block.php';
|
28 |
require_once VEU_DIRECTORY_PATH . '/admin/admin.php';
|
|
|
29 |
require VEU_DIRECTORY_PATH . '/inc/footer-copyright-change.php';
|
30 |
|
31 |
veu_package_include(); // package_manager.php
|
readme.txt
CHANGED
@@ -81,6 +81,10 @@ e.g.
|
|
81 |
|
82 |
== Changelog ==
|
83 |
|
|
|
|
|
|
|
|
|
84 |
= 9.74.1.0 =
|
85 |
* [ Bug fix ] Fixed ExUnit icon appearing in other menus
|
86 |
|
81 |
|
82 |
== Changelog ==
|
83 |
|
84 |
+
= 9.74.2.0 =
|
85 |
+
* [ Bug fix ] Fixed add common attributes ( attribute from VK Blocks 1.29 - )
|
86 |
+
* [ Specification Change ] Use composer vk-term-color
|
87 |
+
|
88 |
= 9.74.1.0 =
|
89 |
* [ Bug fix ] Fixed ExUnit icon appearing in other menus
|
90 |
|
vendor/autoload.php
CHANGED
@@ -4,4 +4,4 @@
|
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
-
return
|
4 |
|
5 |
require_once __DIR__ . '/composer/autoload_real.php';
|
6 |
|
7 |
+
return ComposerAutoloaderInit268298c52e0b2fcb4a291d1eb2017ceb::getLoader();
|
vendor/composer/autoload_classmap.php
CHANGED
@@ -10,4 +10,5 @@ return array(
|
|
10 |
'VektorInc\\VK_Breadcrumb\\VkBreadcrumb' => $vendorDir . '/vektor-inc/vk-breadcrumb/src/VkBreadcrumb.php',
|
11 |
'VektorInc\\VK_Font_Awesome_Versions\\VkFontAwesomeVersions' => $vendorDir . '/vektor-inc/font-awesome-versions/src/VkFontAwesomeVersions.php',
|
12 |
'VektorInc\\VK_Helpers\\VkHelpers' => $vendorDir . '/vektor-inc/vk-helpers/src/VkHelpers.php',
|
|
|
13 |
);
|
10 |
'VektorInc\\VK_Breadcrumb\\VkBreadcrumb' => $vendorDir . '/vektor-inc/vk-breadcrumb/src/VkBreadcrumb.php',
|
11 |
'VektorInc\\VK_Font_Awesome_Versions\\VkFontAwesomeVersions' => $vendorDir . '/vektor-inc/font-awesome-versions/src/VkFontAwesomeVersions.php',
|
12 |
'VektorInc\\VK_Helpers\\VkHelpers' => $vendorDir . '/vektor-inc/vk-helpers/src/VkHelpers.php',
|
13 |
+
'VektorInc\\VK_Term_Color\\VkTermColor' => $vendorDir . '/vektor-inc/vk-term-color/src/VkTermColor.php',
|
14 |
);
|
vendor/composer/autoload_psr4.php
CHANGED
@@ -6,6 +6,7 @@ $vendorDir = dirname(dirname(__FILE__));
|
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
|
|
9 |
'VektorInc\\VK_Helpers\\' => array($vendorDir . '/vektor-inc/vk-helpers/src'),
|
10 |
'VektorInc\\VK_Font_Awesome_Versions\\' => array($vendorDir . '/vektor-inc/font-awesome-versions/src'),
|
11 |
'VektorInc\\VK_Breadcrumb\\' => array($vendorDir . '/vektor-inc/vk-breadcrumb/src'),
|
6 |
$baseDir = dirname($vendorDir);
|
7 |
|
8 |
return array(
|
9 |
+
'VektorInc\\VK_Term_Color\\' => array($vendorDir . '/vektor-inc/vk-term-color/src'),
|
10 |
'VektorInc\\VK_Helpers\\' => array($vendorDir . '/vektor-inc/vk-helpers/src'),
|
11 |
'VektorInc\\VK_Font_Awesome_Versions\\' => array($vendorDir . '/vektor-inc/font-awesome-versions/src'),
|
12 |
'VektorInc\\VK_Breadcrumb\\' => array($vendorDir . '/vektor-inc/vk-breadcrumb/src'),
|
vendor/composer/autoload_real.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
-
class
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
@@ -24,15 +24,15 @@ class ComposerAutoloaderInite27beb524671349285764adc30a7b54a
|
|
24 |
|
25 |
require __DIR__ . '/platform_check.php';
|
26 |
|
27 |
-
spl_autoload_register(array('
|
28 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
-
spl_autoload_unregister(array('
|
30 |
|
31 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
if ($useStaticLoader) {
|
33 |
require __DIR__ . '/autoload_static.php';
|
34 |
|
35 |
-
call_user_func(\Composer\Autoload\
|
36 |
} else {
|
37 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
38 |
foreach ($map as $namespace => $path) {
|
2 |
|
3 |
// autoload_real.php @generated by Composer
|
4 |
|
5 |
+
class ComposerAutoloaderInit268298c52e0b2fcb4a291d1eb2017ceb
|
6 |
{
|
7 |
private static $loader;
|
8 |
|
24 |
|
25 |
require __DIR__ . '/platform_check.php';
|
26 |
|
27 |
+
spl_autoload_register(array('ComposerAutoloaderInit268298c52e0b2fcb4a291d1eb2017ceb', 'loadClassLoader'), true, true);
|
28 |
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
|
29 |
+
spl_autoload_unregister(array('ComposerAutoloaderInit268298c52e0b2fcb4a291d1eb2017ceb', 'loadClassLoader'));
|
30 |
|
31 |
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
|
32 |
if ($useStaticLoader) {
|
33 |
require __DIR__ . '/autoload_static.php';
|
34 |
|
35 |
+
call_user_func(\Composer\Autoload\ComposerStaticInit268298c52e0b2fcb4a291d1eb2017ceb::getInitializer($loader));
|
36 |
} else {
|
37 |
$map = require __DIR__ . '/autoload_namespaces.php';
|
38 |
foreach ($map as $namespace => $path) {
|
vendor/composer/autoload_static.php
CHANGED
@@ -4,11 +4,12 @@
|
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
-
class
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'V' =>
|
11 |
array (
|
|
|
12 |
'VektorInc\\VK_Helpers\\' => 21,
|
13 |
'VektorInc\\VK_Font_Awesome_Versions\\' => 35,
|
14 |
'VektorInc\\VK_Breadcrumb\\' => 24,
|
@@ -16,6 +17,10 @@ class ComposerStaticInite27beb524671349285764adc30a7b54a
|
|
16 |
);
|
17 |
|
18 |
public static $prefixDirsPsr4 = array (
|
|
|
|
|
|
|
|
|
19 |
'VektorInc\\VK_Helpers\\' =>
|
20 |
array (
|
21 |
0 => __DIR__ . '/..' . '/vektor-inc/vk-helpers/src',
|
@@ -35,14 +40,15 @@ class ComposerStaticInite27beb524671349285764adc30a7b54a
|
|
35 |
'VektorInc\\VK_Breadcrumb\\VkBreadcrumb' => __DIR__ . '/..' . '/vektor-inc/vk-breadcrumb/src/VkBreadcrumb.php',
|
36 |
'VektorInc\\VK_Font_Awesome_Versions\\VkFontAwesomeVersions' => __DIR__ . '/..' . '/vektor-inc/font-awesome-versions/src/VkFontAwesomeVersions.php',
|
37 |
'VektorInc\\VK_Helpers\\VkHelpers' => __DIR__ . '/..' . '/vektor-inc/vk-helpers/src/VkHelpers.php',
|
|
|
38 |
);
|
39 |
|
40 |
public static function getInitializer(ClassLoader $loader)
|
41 |
{
|
42 |
return \Closure::bind(function () use ($loader) {
|
43 |
-
$loader->prefixLengthsPsr4 =
|
44 |
-
$loader->prefixDirsPsr4 =
|
45 |
-
$loader->classMap =
|
46 |
|
47 |
}, null, ClassLoader::class);
|
48 |
}
|
4 |
|
5 |
namespace Composer\Autoload;
|
6 |
|
7 |
+
class ComposerStaticInit268298c52e0b2fcb4a291d1eb2017ceb
|
8 |
{
|
9 |
public static $prefixLengthsPsr4 = array (
|
10 |
'V' =>
|
11 |
array (
|
12 |
+
'VektorInc\\VK_Term_Color\\' => 24,
|
13 |
'VektorInc\\VK_Helpers\\' => 21,
|
14 |
'VektorInc\\VK_Font_Awesome_Versions\\' => 35,
|
15 |
'VektorInc\\VK_Breadcrumb\\' => 24,
|
17 |
);
|
18 |
|
19 |
public static $prefixDirsPsr4 = array (
|
20 |
+
'VektorInc\\VK_Term_Color\\' =>
|
21 |
+
array (
|
22 |
+
0 => __DIR__ . '/..' . '/vektor-inc/vk-term-color/src',
|
23 |
+
),
|
24 |
'VektorInc\\VK_Helpers\\' =>
|
25 |
array (
|
26 |
0 => __DIR__ . '/..' . '/vektor-inc/vk-helpers/src',
|
40 |
'VektorInc\\VK_Breadcrumb\\VkBreadcrumb' => __DIR__ . '/..' . '/vektor-inc/vk-breadcrumb/src/VkBreadcrumb.php',
|
41 |
'VektorInc\\VK_Font_Awesome_Versions\\VkFontAwesomeVersions' => __DIR__ . '/..' . '/vektor-inc/font-awesome-versions/src/VkFontAwesomeVersions.php',
|
42 |
'VektorInc\\VK_Helpers\\VkHelpers' => __DIR__ . '/..' . '/vektor-inc/vk-helpers/src/VkHelpers.php',
|
43 |
+
'VektorInc\\VK_Term_Color\\VkTermColor' => __DIR__ . '/..' . '/vektor-inc/vk-term-color/src/VkTermColor.php',
|
44 |
);
|
45 |
|
46 |
public static function getInitializer(ClassLoader $loader)
|
47 |
{
|
48 |
return \Closure::bind(function () use ($loader) {
|
49 |
+
$loader->prefixLengthsPsr4 = ComposerStaticInit268298c52e0b2fcb4a291d1eb2017ceb::$prefixLengthsPsr4;
|
50 |
+
$loader->prefixDirsPsr4 = ComposerStaticInit268298c52e0b2fcb4a291d1eb2017ceb::$prefixDirsPsr4;
|
51 |
+
$loader->classMap = ComposerStaticInit268298c52e0b2fcb4a291d1eb2017ceb::$classMap;
|
52 |
|
53 |
}, null, ClassLoader::class);
|
54 |
}
|
vendor/composer/installed.json
CHANGED
@@ -125,6 +125,46 @@
|
|
125 |
"source": "https://github.com/vektor-inc/vk-helpers/tree/0.0.2"
|
126 |
},
|
127 |
"install-path": "../vektor-inc/vk-helpers"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
128 |
}
|
129 |
],
|
130 |
"dev": false,
|
125 |
"source": "https://github.com/vektor-inc/vk-helpers/tree/0.0.2"
|
126 |
},
|
127 |
"install-path": "../vektor-inc/vk-helpers"
|
128 |
+
},
|
129 |
+
{
|
130 |
+
"name": "vektor-inc/vk-term-color",
|
131 |
+
"version": "0.1.0",
|
132 |
+
"version_normalized": "0.1.0.0",
|
133 |
+
"source": {
|
134 |
+
"type": "git",
|
135 |
+
"url": "https://github.com/vektor-inc/vk-term-color.git",
|
136 |
+
"reference": "6a03c52ffbbceba13f8429beb12bbcf4946335c1"
|
137 |
+
},
|
138 |
+
"dist": {
|
139 |
+
"type": "zip",
|
140 |
+
"url": "https://api.github.com/repos/vektor-inc/vk-term-color/zipball/6a03c52ffbbceba13f8429beb12bbcf4946335c1",
|
141 |
+
"reference": "6a03c52ffbbceba13f8429beb12bbcf4946335c1",
|
142 |
+
"shasum": ""
|
143 |
+
},
|
144 |
+
"time": "2022-03-28T06:38:36+00:00",
|
145 |
+
"type": "library",
|
146 |
+
"installation-source": "dist",
|
147 |
+
"autoload": {
|
148 |
+
"psr-4": {
|
149 |
+
"VektorInc\\VK_Term_Color\\": "src/"
|
150 |
+
}
|
151 |
+
},
|
152 |
+
"notification-url": "https://packagist.org/downloads/",
|
153 |
+
"license": [
|
154 |
+
"GPL-2.0-or-later"
|
155 |
+
],
|
156 |
+
"authors": [
|
157 |
+
{
|
158 |
+
"name": "Vektor,Inc.",
|
159 |
+
"email": "kurudrive@gmail.com"
|
160 |
+
}
|
161 |
+
],
|
162 |
+
"description": "VK Term Color",
|
163 |
+
"support": {
|
164 |
+
"issues": "https://github.com/vektor-inc/vk-term-color/issues",
|
165 |
+
"source": "https://github.com/vektor-inc/vk-term-color/tree/0.1.0"
|
166 |
+
},
|
167 |
+
"install-path": "../vektor-inc/vk-term-color"
|
168 |
}
|
169 |
],
|
170 |
"dev": false,
|
vendor/composer/installed.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
-
'pretty_version' => '9.74.
|
4 |
-
'version' => '9.74.
|
5 |
'type' => 'project',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
-
'reference' => '
|
9 |
'name' => 'vektor-inc/vk-all-in-one-expansion-unit',
|
10 |
'dev' => false,
|
11 |
),
|
@@ -20,12 +20,12 @@
|
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'vektor-inc/vk-all-in-one-expansion-unit' => array(
|
23 |
-
'pretty_version' => '9.74.
|
24 |
-
'version' => '9.74.
|
25 |
'type' => 'project',
|
26 |
'install_path' => __DIR__ . '/../../',
|
27 |
'aliases' => array(),
|
28 |
-
'reference' => '
|
29 |
'dev_requirement' => false,
|
30 |
),
|
31 |
'vektor-inc/vk-breadcrumb' => array(
|
@@ -46,5 +46,14 @@
|
|
46 |
'reference' => '320155b9df7f9f57a889e144dd8b379184ac15ec',
|
47 |
'dev_requirement' => false,
|
48 |
),
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
),
|
50 |
);
|
1 |
<?php return array(
|
2 |
'root' => array(
|
3 |
+
'pretty_version' => '9.74.2.0',
|
4 |
+
'version' => '9.74.2.0',
|
5 |
'type' => 'project',
|
6 |
'install_path' => __DIR__ . '/../../',
|
7 |
'aliases' => array(),
|
8 |
+
'reference' => 'ba7566436d72a1168e91adb159835400b4e1fc35',
|
9 |
'name' => 'vektor-inc/vk-all-in-one-expansion-unit',
|
10 |
'dev' => false,
|
11 |
),
|
20 |
'dev_requirement' => false,
|
21 |
),
|
22 |
'vektor-inc/vk-all-in-one-expansion-unit' => array(
|
23 |
+
'pretty_version' => '9.74.2.0',
|
24 |
+
'version' => '9.74.2.0',
|
25 |
'type' => 'project',
|
26 |
'install_path' => __DIR__ . '/../../',
|
27 |
'aliases' => array(),
|
28 |
+
'reference' => 'ba7566436d72a1168e91adb159835400b4e1fc35',
|
29 |
'dev_requirement' => false,
|
30 |
),
|
31 |
'vektor-inc/vk-breadcrumb' => array(
|
46 |
'reference' => '320155b9df7f9f57a889e144dd8b379184ac15ec',
|
47 |
'dev_requirement' => false,
|
48 |
),
|
49 |
+
'vektor-inc/vk-term-color' => array(
|
50 |
+
'pretty_version' => '0.1.0',
|
51 |
+
'version' => '0.1.0.0',
|
52 |
+
'type' => 'library',
|
53 |
+
'install_path' => __DIR__ . '/../vektor-inc/vk-term-color',
|
54 |
+
'aliases' => array(),
|
55 |
+
'reference' => '6a03c52ffbbceba13f8429beb12bbcf4946335c1',
|
56 |
+
'dev_requirement' => false,
|
57 |
+
),
|
58 |
),
|
59 |
);
|
vendor/vektor-inc/vk-term-color/LICENSE
ADDED
@@ -0,0 +1,339 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
GNU GENERAL PUBLIC LICENSE
|
2 |
+
Version 2, June 1991
|
3 |
+
|
4 |
+
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
5 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
6 |
+
Everyone is permitted to copy and distribute verbatim copies
|
7 |
+
of this license document, but changing it is not allowed.
|
8 |
+
|
9 |
+
Preamble
|
10 |
+
|
11 |
+
The licenses for most software are designed to take away your
|
12 |
+
freedom to share and change it. By contrast, the GNU General Public
|
13 |
+
License is intended to guarantee your freedom to share and change free
|
14 |
+
software--to make sure the software is free for all its users. This
|
15 |
+
General Public License applies to most of the Free Software
|
16 |
+
Foundation's software and to any other program whose authors commit to
|
17 |
+
using it. (Some other Free Software Foundation software is covered by
|
18 |
+
the GNU Lesser General Public License instead.) You can apply it to
|
19 |
+
your programs, too.
|
20 |
+
|
21 |
+
When we speak of free software, we are referring to freedom, not
|
22 |
+
price. Our General Public Licenses are designed to make sure that you
|
23 |
+
have the freedom to distribute copies of free software (and charge for
|
24 |
+
this service if you wish), that you receive source code or can get it
|
25 |
+
if you want it, that you can change the software or use pieces of it
|
26 |
+
in new free programs; and that you know you can do these things.
|
27 |
+
|
28 |
+
To protect your rights, we need to make restrictions that forbid
|
29 |
+
anyone to deny you these rights or to ask you to surrender the rights.
|
30 |
+
These restrictions translate to certain responsibilities for you if you
|
31 |
+
distribute copies of the software, or if you modify it.
|
32 |
+
|
33 |
+
For example, if you distribute copies of such a program, whether
|
34 |
+
gratis or for a fee, you must give the recipients all the rights that
|
35 |
+
you have. You must make sure that they, too, receive or can get the
|
36 |
+
source code. And you must show them these terms so they know their
|
37 |
+
rights.
|
38 |
+
|
39 |
+
We protect your rights with two steps: (1) copyright the software, and
|
40 |
+
(2) offer you this license which gives you legal permission to copy,
|
41 |
+
distribute and/or modify the software.
|
42 |
+
|
43 |
+
Also, for each author's protection and ours, we want to make certain
|
44 |
+
that everyone understands that there is no warranty for this free
|
45 |
+
software. If the software is modified by someone else and passed on, we
|
46 |
+
want its recipients to know that what they have is not the original, so
|
47 |
+
that any problems introduced by others will not reflect on the original
|
48 |
+
authors' reputations.
|
49 |
+
|
50 |
+
Finally, any free program is threatened constantly by software
|
51 |
+
patents. We wish to avoid the danger that redistributors of a free
|
52 |
+
program will individually obtain patent licenses, in effect making the
|
53 |
+
program proprietary. To prevent this, we have made it clear that any
|
54 |
+
patent must be licensed for everyone's free use or not licensed at all.
|
55 |
+
|
56 |
+
The precise terms and conditions for copying, distribution and
|
57 |
+
modification follow.
|
58 |
+
|
59 |
+
GNU GENERAL PUBLIC LICENSE
|
60 |
+
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
61 |
+
|
62 |
+
0. This License applies to any program or other work which contains
|
63 |
+
a notice placed by the copyright holder saying it may be distributed
|
64 |
+
under the terms of this General Public License. The "Program", below,
|
65 |
+
refers to any such program or work, and a "work based on the Program"
|
66 |
+
means either the Program or any derivative work under copyright law:
|
67 |
+
that is to say, a work containing the Program or a portion of it,
|
68 |
+
either verbatim or with modifications and/or translated into another
|
69 |
+
language. (Hereinafter, translation is included without limitation in
|
70 |
+
the term "modification".) Each licensee is addressed as "you".
|
71 |
+
|
72 |
+
Activities other than copying, distribution and modification are not
|
73 |
+
covered by this License; they are outside its scope. The act of
|
74 |
+
running the Program is not restricted, and the output from the Program
|
75 |
+
is covered only if its contents constitute a work based on the
|
76 |
+
Program (independent of having been made by running the Program).
|
77 |
+
Whether that is true depends on what the Program does.
|
78 |
+
|
79 |
+
1. You may copy and distribute verbatim copies of the Program's
|
80 |
+
source code as you receive it, in any medium, provided that you
|
81 |
+
conspicuously and appropriately publish on each copy an appropriate
|
82 |
+
copyright notice and disclaimer of warranty; keep intact all the
|
83 |
+
notices that refer to this License and to the absence of any warranty;
|
84 |
+
and give any other recipients of the Program a copy of this License
|
85 |
+
along with the Program.
|
86 |
+
|
87 |
+
You may charge a fee for the physical act of transferring a copy, and
|
88 |
+
you may at your option offer warranty protection in exchange for a fee.
|
89 |
+
|
90 |
+
2. You may modify your copy or copies of the Program or any portion
|
91 |
+
of it, thus forming a work based on the Program, and copy and
|
92 |
+
distribute such modifications or work under the terms of Section 1
|
93 |
+
above, provided that you also meet all of these conditions:
|
94 |
+
|
95 |
+
a) You must cause the modified files to carry prominent notices
|
96 |
+
stating that you changed the files and the date of any change.
|
97 |
+
|
98 |
+
b) You must cause any work that you distribute or publish, that in
|
99 |
+
whole or in part contains or is derived from the Program or any
|
100 |
+
part thereof, to be licensed as a whole at no charge to all third
|
101 |
+
parties under the terms of this License.
|
102 |
+
|
103 |
+
c) If the modified program normally reads commands interactively
|
104 |
+
when run, you must cause it, when started running for such
|
105 |
+
interactive use in the most ordinary way, to print or display an
|
106 |
+
announcement including an appropriate copyright notice and a
|
107 |
+
notice that there is no warranty (or else, saying that you provide
|
108 |
+
a warranty) and that users may redistribute the program under
|
109 |
+
these conditions, and telling the user how to view a copy of this
|
110 |
+
License. (Exception: if the Program itself is interactive but
|
111 |
+
does not normally print such an announcement, your work based on
|
112 |
+
the Program is not required to print an announcement.)
|
113 |
+
|
114 |
+
These requirements apply to the modified work as a whole. If
|
115 |
+
identifiable sections of that work are not derived from the Program,
|
116 |
+
and can be reasonably considered independent and separate works in
|
117 |
+
themselves, then this License, and its terms, do not apply to those
|
118 |
+
sections when you distribute them as separate works. But when you
|
119 |
+
distribute the same sections as part of a whole which is a work based
|
120 |
+
on the Program, the distribution of the whole must be on the terms of
|
121 |
+
this License, whose permissions for other licensees extend to the
|
122 |
+
entire whole, and thus to each and every part regardless of who wrote it.
|
123 |
+
|
124 |
+
Thus, it is not the intent of this section to claim rights or contest
|
125 |
+
your rights to work written entirely by you; rather, the intent is to
|
126 |
+
exercise the right to control the distribution of derivative or
|
127 |
+
collective works based on the Program.
|
128 |
+
|
129 |
+
In addition, mere aggregation of another work not based on the Program
|
130 |
+
with the Program (or with a work based on the Program) on a volume of
|
131 |
+
a storage or distribution medium does not bring the other work under
|
132 |
+
the scope of this License.
|
133 |
+
|
134 |
+
3. You may copy and distribute the Program (or a work based on it,
|
135 |
+
under Section 2) in object code or executable form under the terms of
|
136 |
+
Sections 1 and 2 above provided that you also do one of the following:
|
137 |
+
|
138 |
+
a) Accompany it with the complete corresponding machine-readable
|
139 |
+
source code, which must be distributed under the terms of Sections
|
140 |
+
1 and 2 above on a medium customarily used for software interchange; or,
|
141 |
+
|
142 |
+
b) Accompany it with a written offer, valid for at least three
|
143 |
+
years, to give any third party, for a charge no more than your
|
144 |
+
cost of physically performing source distribution, a complete
|
145 |
+
machine-readable copy of the corresponding source code, to be
|
146 |
+
distributed under the terms of Sections 1 and 2 above on a medium
|
147 |
+
customarily used for software interchange; or,
|
148 |
+
|
149 |
+
c) Accompany it with the information you received as to the offer
|
150 |
+
to distribute corresponding source code. (This alternative is
|
151 |
+
allowed only for noncommercial distribution and only if you
|
152 |
+
received the program in object code or executable form with such
|
153 |
+
an offer, in accord with Subsection b above.)
|
154 |
+
|
155 |
+
The source code for a work means the preferred form of the work for
|
156 |
+
making modifications to it. For an executable work, complete source
|
157 |
+
code means all the source code for all modules it contains, plus any
|
158 |
+
associated interface definition files, plus the scripts used to
|
159 |
+
control compilation and installation of the executable. However, as a
|
160 |
+
special exception, the source code distributed need not include
|
161 |
+
anything that is normally distributed (in either source or binary
|
162 |
+
form) with the major components (compiler, kernel, and so on) of the
|
163 |
+
operating system on which the executable runs, unless that component
|
164 |
+
itself accompanies the executable.
|
165 |
+
|
166 |
+
If distribution of executable or object code is made by offering
|
167 |
+
access to copy from a designated place, then offering equivalent
|
168 |
+
access to copy the source code from the same place counts as
|
169 |
+
distribution of the source code, even though third parties are not
|
170 |
+
compelled to copy the source along with the object code.
|
171 |
+
|
172 |
+
4. You may not copy, modify, sublicense, or distribute the Program
|
173 |
+
except as expressly provided under this License. Any attempt
|
174 |
+
otherwise to copy, modify, sublicense or distribute the Program is
|
175 |
+
void, and will automatically terminate your rights under this License.
|
176 |
+
However, parties who have received copies, or rights, from you under
|
177 |
+
this License will not have their licenses terminated so long as such
|
178 |
+
parties remain in full compliance.
|
179 |
+
|
180 |
+
5. You are not required to accept this License, since you have not
|
181 |
+
signed it. However, nothing else grants you permission to modify or
|
182 |
+
distribute the Program or its derivative works. These actions are
|
183 |
+
prohibited by law if you do not accept this License. Therefore, by
|
184 |
+
modifying or distributing the Program (or any work based on the
|
185 |
+
Program), you indicate your acceptance of this License to do so, and
|
186 |
+
all its terms and conditions for copying, distributing or modifying
|
187 |
+
the Program or works based on it.
|
188 |
+
|
189 |
+
6. Each time you redistribute the Program (or any work based on the
|
190 |
+
Program), the recipient automatically receives a license from the
|
191 |
+
original licensor to copy, distribute or modify the Program subject to
|
192 |
+
these terms and conditions. You may not impose any further
|
193 |
+
restrictions on the recipients' exercise of the rights granted herein.
|
194 |
+
You are not responsible for enforcing compliance by third parties to
|
195 |
+
this License.
|
196 |
+
|
197 |
+
7. If, as a consequence of a court judgment or allegation of patent
|
198 |
+
infringement or for any other reason (not limited to patent issues),
|
199 |
+
conditions are imposed on you (whether by court order, agreement or
|
200 |
+
otherwise) that contradict the conditions of this License, they do not
|
201 |
+
excuse you from the conditions of this License. If you cannot
|
202 |
+
distribute so as to satisfy simultaneously your obligations under this
|
203 |
+
License and any other pertinent obligations, then as a consequence you
|
204 |
+
may not distribute the Program at all. For example, if a patent
|
205 |
+
license would not permit royalty-free redistribution of the Program by
|
206 |
+
all those who receive copies directly or indirectly through you, then
|
207 |
+
the only way you could satisfy both it and this License would be to
|
208 |
+
refrain entirely from distribution of the Program.
|
209 |
+
|
210 |
+
If any portion of this section is held invalid or unenforceable under
|
211 |
+
any particular circumstance, the balance of the section is intended to
|
212 |
+
apply and the section as a whole is intended to apply in other
|
213 |
+
circumstances.
|
214 |
+
|
215 |
+
It is not the purpose of this section to induce you to infringe any
|
216 |
+
patents or other property right claims or to contest validity of any
|
217 |
+
such claims; this section has the sole purpose of protecting the
|
218 |
+
integrity of the free software distribution system, which is
|
219 |
+
implemented by public license practices. Many people have made
|
220 |
+
generous contributions to the wide range of software distributed
|
221 |
+
through that system in reliance on consistent application of that
|
222 |
+
system; it is up to the author/donor to decide if he or she is willing
|
223 |
+
to distribute software through any other system and a licensee cannot
|
224 |
+
impose that choice.
|
225 |
+
|
226 |
+
This section is intended to make thoroughly clear what is believed to
|
227 |
+
be a consequence of the rest of this License.
|
228 |
+
|
229 |
+
8. If the distribution and/or use of the Program is restricted in
|
230 |
+
certain countries either by patents or by copyrighted interfaces, the
|
231 |
+
original copyright holder who places the Program under this License
|
232 |
+
may add an explicit geographical distribution limitation excluding
|
233 |
+
those countries, so that distribution is permitted only in or among
|
234 |
+
countries not thus excluded. In such case, this License incorporates
|
235 |
+
the limitation as if written in the body of this License.
|
236 |
+
|
237 |
+
9. The Free Software Foundation may publish revised and/or new versions
|
238 |
+
of the General Public License from time to time. Such new versions will
|
239 |
+
be similar in spirit to the present version, but may differ in detail to
|
240 |
+
address new problems or concerns.
|
241 |
+
|
242 |
+
Each version is given a distinguishing version number. If the Program
|
243 |
+
specifies a version number of this License which applies to it and "any
|
244 |
+
later version", you have the option of following the terms and conditions
|
245 |
+
either of that version or of any later version published by the Free
|
246 |
+
Software Foundation. If the Program does not specify a version number of
|
247 |
+
this License, you may choose any version ever published by the Free Software
|
248 |
+
Foundation.
|
249 |
+
|
250 |
+
10. If you wish to incorporate parts of the Program into other free
|
251 |
+
programs whose distribution conditions are different, write to the author
|
252 |
+
to ask for permission. For software which is copyrighted by the Free
|
253 |
+
Software Foundation, write to the Free Software Foundation; we sometimes
|
254 |
+
make exceptions for this. Our decision will be guided by the two goals
|
255 |
+
of preserving the free status of all derivatives of our free software and
|
256 |
+
of promoting the sharing and reuse of software generally.
|
257 |
+
|
258 |
+
NO WARRANTY
|
259 |
+
|
260 |
+
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
261 |
+
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
262 |
+
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
263 |
+
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
264 |
+
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
265 |
+
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
266 |
+
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
267 |
+
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
268 |
+
REPAIR OR CORRECTION.
|
269 |
+
|
270 |
+
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
271 |
+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
272 |
+
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
273 |
+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
274 |
+
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
275 |
+
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
276 |
+
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
277 |
+
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
278 |
+
POSSIBILITY OF SUCH DAMAGES.
|
279 |
+
|
280 |
+
END OF TERMS AND CONDITIONS
|
281 |
+
|
282 |
+
How to Apply These Terms to Your New Programs
|
283 |
+
|
284 |
+
If you develop a new program, and you want it to be of the greatest
|
285 |
+
possible use to the public, the best way to achieve this is to make it
|
286 |
+
free software which everyone can redistribute and change under these terms.
|
287 |
+
|
288 |
+
To do so, attach the following notices to the program. It is safest
|
289 |
+
to attach them to the start of each source file to most effectively
|
290 |
+
convey the exclusion of warranty; and each file should have at least
|
291 |
+
the "copyright" line and a pointer to where the full notice is found.
|
292 |
+
|
293 |
+
<one line to give the program's name and a brief idea of what it does.>
|
294 |
+
Copyright (C) <year> <name of author>
|
295 |
+
|
296 |
+
This program is free software; you can redistribute it and/or modify
|
297 |
+
it under the terms of the GNU General Public License as published by
|
298 |
+
the Free Software Foundation; either version 2 of the License, or
|
299 |
+
(at your option) any later version.
|
300 |
+
|
301 |
+
This program is distributed in the hope that it will be useful,
|
302 |
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
303 |
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
304 |
+
GNU General Public License for more details.
|
305 |
+
|
306 |
+
You should have received a copy of the GNU General Public License along
|
307 |
+
with this program; if not, write to the Free Software Foundation, Inc.,
|
308 |
+
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
309 |
+
|
310 |
+
Also add information on how to contact you by electronic and paper mail.
|
311 |
+
|
312 |
+
If the program is interactive, make it output a short notice like this
|
313 |
+
when it starts in an interactive mode:
|
314 |
+
|
315 |
+
Gnomovision version 69, Copyright (C) year name of author
|
316 |
+
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
317 |
+
This is free software, and you are welcome to redistribute it
|
318 |
+
under certain conditions; type `show c' for details.
|
319 |
+
|
320 |
+
The hypothetical commands `show w' and `show c' should show the appropriate
|
321 |
+
parts of the General Public License. Of course, the commands you use may
|
322 |
+
be called something other than `show w' and `show c'; they could even be
|
323 |
+
mouse-clicks or menu items--whatever suits your program.
|
324 |
+
|
325 |
+
You should also get your employer (if you work as a programmer) or your
|
326 |
+
school, if any, to sign a "copyright disclaimer" for the program, if
|
327 |
+
necessary. Here is a sample; alter the names:
|
328 |
+
|
329 |
+
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
330 |
+
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
331 |
+
|
332 |
+
<signature of Ty Coon>, 1 April 1989
|
333 |
+
Ty Coon, President of Vice
|
334 |
+
|
335 |
+
This General Public License does not permit incorporating your program into
|
336 |
+
proprietary programs. If your program is a subroutine library, you may
|
337 |
+
consider it more useful to permit linking proprietary applications with the
|
338 |
+
library. If this is what you want to do, use the GNU Lesser General
|
339 |
+
Public License instead of this License.
|
vendor/vektor-inc/vk-term-color/src/VkTermColor.php
ADDED
@@ -0,0 +1,310 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php //phpcs:ignore
|
2 |
+
/**
|
3 |
+
* VK_Term_Color
|
4 |
+
*
|
5 |
+
* @package vektor-inc/vk-term-color
|
6 |
+
* @license GPL-2.0+
|
7 |
+
*
|
8 |
+
* @version 0.1.0
|
9 |
+
*/
|
10 |
+
|
11 |
+
namespace VektorInc\VK_Term_Color;
|
12 |
+
|
13 |
+
/**
|
14 |
+
* Term Color
|
15 |
+
*/
|
16 |
+
class VkTermColor {
|
17 |
+
|
18 |
+
/**
|
19 |
+
* Init
|
20 |
+
*
|
21 |
+
* @return void
|
22 |
+
*/
|
23 |
+
public static function init() {
|
24 |
+
add_action( 'init', array( __CLASS__, 'term_meta_color' ) );
|
25 |
+
add_action( 'admin_enqueue_scripts', array( __CLASS__, 'admin_enqueue_scripts' ) );
|
26 |
+
|
27 |
+
// カラーピッカーを追加するタクソノミー.
|
28 |
+
$taxonomies = self::get_term_color_taxonomies();
|
29 |
+
|
30 |
+
// 該当のタクソノミー分ループ処理する.
|
31 |
+
foreach ( $taxonomies as $key => $value ) {
|
32 |
+
add_action( $value . '_add_form_fields', array( __CLASS__, 'taxonomy_add_new_meta_field_color' ), 10, 2 );
|
33 |
+
add_action( $value . '_edit_form_fields', array( __CLASS__, 'taxonomy_add_edit_meta_field_color' ), 10, 2 );
|
34 |
+
add_action( 'edited_' . $value, array( __CLASS__, 'save_term_meta_color' ), 10, 2 );
|
35 |
+
add_action( 'create_' . $value, array( __CLASS__, 'save_term_meta_color' ), 10, 2 );
|
36 |
+
add_filter( 'manage_edit-' . $value . '_columns', array( __CLASS__, 'edit_term_columns' ) );
|
37 |
+
add_filter( 'manage_' . $value . '_custom_column', array( __CLASS__, 'manage_term_custom_column' ), 10, 3 );
|
38 |
+
}
|
39 |
+
}
|
40 |
+
|
41 |
+
/**
|
42 |
+
* REGISTER TERM META
|
43 |
+
*
|
44 |
+
* @return void
|
45 |
+
*/
|
46 |
+
public static function term_meta_color() {
|
47 |
+
register_meta( 'term', 'term_color', array( __CLASS__, 'sanitize_hex' ) );
|
48 |
+
}
|
49 |
+
|
50 |
+
/**
|
51 |
+
* SANITIZE DATA
|
52 |
+
*
|
53 |
+
* @param string $color color data.
|
54 |
+
* @return string $color
|
55 |
+
*/
|
56 |
+
public static function sanitize_hex( $color ) {
|
57 |
+
// sanitize_hex_color() は undefined function くらう.
|
58 |
+
$color = ltrim( $color, '#' );
|
59 |
+
return preg_match( '/([A-Fa-f0-9]{3}){1,2}$/', $color ) ? $color : '';
|
60 |
+
}
|
61 |
+
|
62 |
+
/**
|
63 |
+
* タクソノミー新規追加ページでの日本語入力フォーム
|
64 |
+
*
|
65 |
+
* @return void
|
66 |
+
*/
|
67 |
+
public static function taxonomy_add_new_meta_field_color() {
|
68 |
+
// this will add the custom meta field to the add new term page.
|
69 |
+
?>
|
70 |
+
<div class="form-field">
|
71 |
+
<?php wp_nonce_field( basename( __FILE__ ), 'term_color_nonce' ); ?>
|
72 |
+
<label for="term_color">
|
73 |
+
<?php _e( 'Color', 'lightning' ); ?></label>
|
74 |
+
<input type="text" name="term_color" id="term_color" class="term_color" value="">
|
75 |
+
</div>
|
76 |
+
<?php
|
77 |
+
}
|
78 |
+
|
79 |
+
/**
|
80 |
+
* タクソノミー編集ページでのフォーム
|
81 |
+
*
|
82 |
+
* @param object $term : term object.
|
83 |
+
* @return void
|
84 |
+
*/
|
85 |
+
public static function taxonomy_add_edit_meta_field_color( $term ) {
|
86 |
+
|
87 |
+
// put the term ID into a variable.
|
88 |
+
$term_color = self::get_term_color( $term->term_id );
|
89 |
+
?>
|
90 |
+
<tr class="form-field">
|
91 |
+
<th scope="row" valign="top"><label for="term_color"><?php _e( 'Color', 'lightning' ); ?></label></th>
|
92 |
+
<td>
|
93 |
+
<?php wp_nonce_field( basename( __FILE__ ), 'term_color_nonce' ); ?>
|
94 |
+
<input type="text" name="term_color" id="term_color" class="term_color" value="<?php echo $term_color; ?>">
|
95 |
+
</td>
|
96 |
+
</tr>
|
97 |
+
<?php
|
98 |
+
}
|
99 |
+
|
100 |
+
/**
|
101 |
+
* Save color function
|
102 |
+
* Save extra taxonomy fields callback function.
|
103 |
+
*
|
104 |
+
* @param int $term_id term id.
|
105 |
+
* @return void
|
106 |
+
*/
|
107 |
+
public static function save_term_meta_color( $term_id ) {
|
108 |
+
|
109 |
+
if ( ! isset( $_POST['term_color_nonce'] ) || ! wp_verify_nonce( $_POST['term_color_nonce'], basename( __FILE__ ) ) ) {
|
110 |
+
return;
|
111 |
+
}
|
112 |
+
|
113 |
+
if ( isset( $_POST['term_color'] ) ) {
|
114 |
+
$now_value = get_term_meta( $term_id, 'term_color', true );
|
115 |
+
$new_value = $_POST['term_color'];
|
116 |
+
if ( $now_value != $new_value ) {
|
117 |
+
update_term_meta( $term_id, 'term_color', $new_value );
|
118 |
+
} else {
|
119 |
+
add_term_meta( $term_id, 'term_color', $new_value );
|
120 |
+
}
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
/**
|
125 |
+
* 管理画面 _ カラーピッカーのスクリプトの読み込み
|
126 |
+
*
|
127 |
+
* @param string $hook_suffix : page slug.
|
128 |
+
* @return void
|
129 |
+
*/
|
130 |
+
public static function admin_enqueue_scripts( $hook_suffix ) {
|
131 |
+
|
132 |
+
wp_enqueue_style( 'wp-color-picker' );
|
133 |
+
wp_enqueue_script( 'wp-color-picker' );
|
134 |
+
add_action( 'admin_footer', array( __CLASS__, 'term_colors_print_scripts' ) );
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Print Term Color style
|
139 |
+
*
|
140 |
+
* @return void
|
141 |
+
*/
|
142 |
+
public static function term_colors_print_styles() {
|
143 |
+
?>
|
144 |
+
<style type="text/css">
|
145 |
+
.column-color { width: 50px; }
|
146 |
+
.column-color .color-block { display: inline-block; width: 28px; height: 28px; border: 1px solid #ddd; }
|
147 |
+
</style>
|
148 |
+
<?php
|
149 |
+
}
|
150 |
+
|
151 |
+
/**
|
152 |
+
* Print term color script
|
153 |
+
*
|
154 |
+
* @return void
|
155 |
+
*/
|
156 |
+
public static function term_colors_print_scripts() {
|
157 |
+
?>
|
158 |
+
<script type="text/javascript">
|
159 |
+
jQuery( document ).ready( function( $ ) {
|
160 |
+
$( '.term_color' ).wpColorPicker();
|
161 |
+
} );
|
162 |
+
</script>
|
163 |
+
<?php
|
164 |
+
}
|
165 |
+
|
166 |
+
/**
|
167 |
+
* 管理画面 _ カテゴリー一覧でカラムの追加
|
168 |
+
*
|
169 |
+
* @param array $columns : column data.
|
170 |
+
* @return array $columns : column data.
|
171 |
+
*/
|
172 |
+
public static function edit_term_columns( $columns ) {
|
173 |
+
|
174 |
+
$columns['color'] = __( 'Color', 'lightning' );
|
175 |
+
|
176 |
+
return $columns;
|
177 |
+
}
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Manage term column
|
181 |
+
*
|
182 |
+
* @param string $out : color html.
|
183 |
+
* @param array $column : column array.
|
184 |
+
* @param int $term_id : term id.
|
185 |
+
* @return string $out
|
186 |
+
*/
|
187 |
+
public static function manage_term_custom_column( $out, $column, $term_id ) {
|
188 |
+
|
189 |
+
if ( 'color' === $column ) {
|
190 |
+
|
191 |
+
$color = self::get_term_color( $term_id );
|
192 |
+
|
193 |
+
if ( ! $color ) {
|
194 |
+
$color = '#ffffff';
|
195 |
+
}
|
196 |
+
|
197 |
+
$out = sprintf( '<span class="color-block" style="background:%s;"> </span>', esc_attr( $color ) );
|
198 |
+
}
|
199 |
+
|
200 |
+
return $out;
|
201 |
+
}
|
202 |
+
|
203 |
+
/**
|
204 |
+
* Termのカラーを取得
|
205 |
+
*
|
206 |
+
* @param int $term_id .
|
207 |
+
* @return string $term_color
|
208 |
+
*/
|
209 |
+
public static function get_term_color( $term_id ) {
|
210 |
+
$term_color_default = '#999999';
|
211 |
+
$term_color_default = apply_filters( 'term_color_default_custom', $term_color_default );
|
212 |
+
if ( isset( $term_id ) ) {
|
213 |
+
$term_color = self::sanitize_hex( get_term_meta( $term_id, 'term_color', true ) );
|
214 |
+
$term_color = ( $term_color ) ? '#' . $term_color : $term_color_default;
|
215 |
+
} else {
|
216 |
+
$term_color = $term_color_default;
|
217 |
+
}
|
218 |
+
return $term_color;
|
219 |
+
}
|
220 |
+
|
221 |
+
/**
|
222 |
+
* Termのカラーを取得
|
223 |
+
*
|
224 |
+
* @param object $post .
|
225 |
+
* @param array $args .
|
226 |
+
* @return void .
|
227 |
+
*/
|
228 |
+
public static function get_single_term_with_color( $post = '', $args = array() ) {
|
229 |
+
if ( ! $post ) {
|
230 |
+
global $post;
|
231 |
+
}
|
232 |
+
|
233 |
+
$args_default = array(
|
234 |
+
'class' => '',
|
235 |
+
'link' => false,
|
236 |
+
);
|
237 |
+
$args = wp_parse_args( $args, $args_default );
|
238 |
+
|
239 |
+
$outer_class = '';
|
240 |
+
if ( ! empty( $args['class'] ) ) {
|
241 |
+
$outer_class = ' class="' . esc_attr( $args['class'] ) . '"';
|
242 |
+
}
|
243 |
+
|
244 |
+
$taxonomies = get_the_taxonomies();
|
245 |
+
$exclusion = array( 'post_tag', 'product_type' );
|
246 |
+
// * vk_exclude_term_list is used in lightning too.
|
247 |
+
$exclusion = apply_filters( 'vk_get_display_taxonomies_exclusion', $exclusion );
|
248 |
+
if ( is_array( $exclusion ) ) {
|
249 |
+
foreach ( $exclusion as $key => $value ) {
|
250 |
+
unset( $taxonomies[ $key ] );
|
251 |
+
}
|
252 |
+
}
|
253 |
+
|
254 |
+
$single_term_with_color = '';
|
255 |
+
if ( $taxonomies ) :
|
256 |
+
// get $taxonomy name.
|
257 |
+
$taxonomy = key( $taxonomies );
|
258 |
+
$terms = get_the_terms( $post->ID, $taxonomy );
|
259 |
+
if ( ! $terms ) {
|
260 |
+
return;
|
261 |
+
}
|
262 |
+
$term_name = esc_html( $terms[0]->name );
|
263 |
+
$term_url = esc_url( get_term_link( $terms[0]->term_id, $taxonomy ) );
|
264 |
+
$term_color = self::get_term_color( $terms[0]->term_id );
|
265 |
+
$term_color = ( $term_color ) ? ' style="color:#fff;background-color:' . $term_color . '"' : '';
|
266 |
+
|
267 |
+
if ( $args['link'] ) {
|
268 |
+
$single_term_with_color .= '<a' . $outer_class . $term_color . ' href="' . esc_url( $term_url ) . '">';
|
269 |
+
} else {
|
270 |
+
$single_term_with_color .= '<span' . $outer_class . $term_color . '>';
|
271 |
+
}
|
272 |
+
|
273 |
+
$single_term_with_color .= $term_name;
|
274 |
+
|
275 |
+
if ( $args['link'] ) {
|
276 |
+
$single_term_with_color .= '</a>';
|
277 |
+
} else {
|
278 |
+
$single_term_with_color .= '</span>';
|
279 |
+
}
|
280 |
+
|
281 |
+
endif;
|
282 |
+
return $single_term_with_color;
|
283 |
+
}
|
284 |
+
|
285 |
+
/**
|
286 |
+
* Term color を有効化する taxonomy
|
287 |
+
*
|
288 |
+
* @return array $taxonomies .
|
289 |
+
*/
|
290 |
+
public static function get_term_color_taxonomies() {
|
291 |
+
/*
|
292 |
+
最初Global変数指定をしていたが、 Global変数では
|
293 |
+
複数の term color が存在した場合に実行タイミングの都合上任意に指定が効かないため、
|
294 |
+
フックでの指定を行う
|
295 |
+
*/
|
296 |
+
global $vk_term_color_taxonomies;
|
297 |
+
if ( $vk_term_color_taxonomies ) {
|
298 |
+
$taxonomies = $vk_term_color_taxonomies;
|
299 |
+
} else {
|
300 |
+
$taxonomies = array( 'category', 'post_tag' );
|
301 |
+
}
|
302 |
+
$taxonomies = apply_filters( 'term_color_taxonomies_custom', $taxonomies );
|
303 |
+
// 重複の値を削除.
|
304 |
+
$taxonomies = array_unique( $taxonomies );
|
305 |
+
// 特に影響はないがキーを振り直す.
|
306 |
+
$taxonomies = array_values( $taxonomies );
|
307 |
+
return $taxonomies;
|
308 |
+
}
|
309 |
+
|
310 |
+
}
|
vkExUnit.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: VK All in One Expansion Unit
|
4 |
* Plugin URI: https://ex-unit.nagoya
|
5 |
* Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
|
6 |
-
* Version: 9.74.
|
7 |
* Requires PHP: 7.2
|
8 |
* Author: Vektor,Inc.
|
9 |
* Text Domain: vk-all-in-one-expansion-unit
|
3 |
* Plugin Name: VK All in One Expansion Unit
|
4 |
* Plugin URI: https://ex-unit.nagoya
|
5 |
* Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
|
6 |
+
* Version: 9.74.2.0
|
7 |
* Requires PHP: 7.2
|
8 |
* Author: Vektor,Inc.
|
9 |
* Text Domain: vk-all-in-one-expansion-unit
|