Version Description
[ Specification change ]
Download this release
Release Info
Developer | kurudrive |
Plugin | VK All in One Expansion Unit |
Version | 9.6.8.0 |
Comparing to | |
See all releases |
Code changes from version 9.6.6.0 to 9.6.8.0
- inc/template-tags/package/template-tags-veu-old.php +69 -0
- inc/template-tags/package/template-tags-veu.php +240 -0
- inc/template-tags/package/template-tags.php +427 -0
- inc/template-tags/template-tags-config.php +7 -0
- inc/template-tags/template-tags.php +43 -9
- initialize.php +2 -3
- readme.txt +7 -1
- vkExUnit.php +1 -1
inc/template-tags/package/template-tags-veu-old.php
ADDED
@@ -0,0 +1,69 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
このファイルの元ファイルは
|
5 |
+
https://github.com/vektor-inc/vektor-wp-libraries
|
6 |
+
にあります。修正の際は上記リポジトリのデータを修正してください。
|
7 |
+
*/
|
8 |
+
|
9 |
+
function vkExUnit_get_directory( $path = '' ) {
|
10 |
+
return veu_get_directory( $path );
|
11 |
+
}
|
12 |
+
function vkExUnit_get_directory_uri( $path = '' ) {
|
13 |
+
return veu_get_directory_uri( $path );
|
14 |
+
}
|
15 |
+
|
16 |
+
if ( ! function_exists( 'vkExUnit_get_common_options' ) ) {
|
17 |
+
function vkExUnit_get_common_options() {
|
18 |
+
return veu_get_common_options();
|
19 |
+
}
|
20 |
+
}
|
21 |
+
if ( ! function_exists( 'vkExUnit_is_excerpt' ) ) {
|
22 |
+
function vkExUnit_is_excerpt() {
|
23 |
+
return vk_is_excerpt();
|
24 |
+
}
|
25 |
+
}
|
26 |
+
|
27 |
+
if ( ! function_exists( 'vkExUnit_get_name' ) ) {
|
28 |
+
function vkExUnit_get_name() {
|
29 |
+
return veu_get_name();
|
30 |
+
}
|
31 |
+
}
|
32 |
+
|
33 |
+
if ( ! function_exists( 'vkExUnit_get_little_short_name' ) ) {
|
34 |
+
function vkExUnit_get_little_short_name() {
|
35 |
+
return veu_get_little_short_name();
|
36 |
+
}
|
37 |
+
}
|
38 |
+
|
39 |
+
if ( ! function_exists( 'vkExUnit_get_short_name' ) ) {
|
40 |
+
function vkExUnit_get_short_name() {
|
41 |
+
return veu_get_short_name();
|
42 |
+
}
|
43 |
+
}
|
44 |
+
|
45 |
+
if ( ! function_exists( 'vkExUnit_get_page_for_posts' ) ) {
|
46 |
+
function vkExUnit_get_page_for_posts() {
|
47 |
+
return vk_get_page_for_posts();
|
48 |
+
}
|
49 |
+
}
|
50 |
+
|
51 |
+
if ( ! function_exists( 'vkExUnit_get_post_type' ) ) {
|
52 |
+
function vkExUnit_get_post_type() {
|
53 |
+
return vk_get_post_type();
|
54 |
+
}
|
55 |
+
}
|
56 |
+
|
57 |
+
if ( ! function_exists( 'vkExUnit_get_the_archive_title' ) ) {
|
58 |
+
function vkExUnit_get_the_archive_title() {
|
59 |
+
$title = vk_get_the_archive_title();
|
60 |
+
return apply_filters( 'vkExUnit_get_the_archive_title', $title );
|
61 |
+
}
|
62 |
+
}
|
63 |
+
|
64 |
+
if ( ! function_exists( 'vkExUnit_get_pageDescription' ) ) {
|
65 |
+
function vkExUnit_get_pageDescription() {
|
66 |
+
$title = vk_get_page_description();
|
67 |
+
return apply_filters( 'vkExUnit_pageDescriptionCustom', $title );
|
68 |
+
}
|
69 |
+
}
|
inc/template-tags/package/template-tags-veu.php
ADDED
@@ -0,0 +1,240 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
このファイルの元ファイルは
|
5 |
+
https://github.com/vektor-inc/vektor-wp-libraries
|
6 |
+
にあります。修正の際は上記リポジトリのデータを修正してください。
|
7 |
+
*/
|
8 |
+
|
9 |
+
/**
|
10 |
+
* ExUnit固有の関数だが、ExUnitの機能を複製している他のプラグインにも使用されるものもある
|
11 |
+
*/
|
12 |
+
|
13 |
+
function veu_get_common_options() {
|
14 |
+
$dafault = veu_get_common_options_default();
|
15 |
+
$options = get_option( 'vkExUnit_common_options' );
|
16 |
+
$options = wp_parse_args( $options, $dafault );
|
17 |
+
return apply_filters( 'vkExUnit_common_options', $options );
|
18 |
+
}
|
19 |
+
|
20 |
+
function veu_get_common_options_default() {
|
21 |
+
// hook veu_package_is_enable()
|
22 |
+
// パッケージの情報を取得してデフォルトの配列を作成
|
23 |
+
$defaults = array();
|
24 |
+
$packages = veu_get_packages();
|
25 |
+
foreach ( $packages as $key => $value ) {
|
26 |
+
$name = $value['name'];
|
27 |
+
$default_options[ 'active_' . $name ] = $value['default'];
|
28 |
+
}
|
29 |
+
$default_options['post_metabox_individual'] = false;
|
30 |
+
$default_options['delete_options_at_deactivate'] = false;
|
31 |
+
$default_options['content_filter_state'] = 'content';
|
32 |
+
return apply_filters( 'vkExUnit_common_options_default', $default_options );
|
33 |
+
}
|
34 |
+
|
35 |
+
/*-------------------------------------------*/
|
36 |
+
/* validate
|
37 |
+
/*-------------------------------------------*/
|
38 |
+
|
39 |
+
function veu_common_options_validate( $input ) {
|
40 |
+
/*
|
41 |
+
入力された値の無害化
|
42 |
+
ここでは機能の有効化有無に関する項目が殆どで、手動で項目を記載すると機能の増減の際に項目の編集漏れが出るため、
|
43 |
+
veu_get_common_options_default() の中で package に登録してある項目・デフォルト値を読み込み、それをループ処理する
|
44 |
+
*/
|
45 |
+
$defaults = veu_get_common_options_default();
|
46 |
+
foreach ( $defaults as $key => $default_value ) {
|
47 |
+
// 'content_filter_state' 以外は true か false しか返ってこない
|
48 |
+
if ( $key != 'content_filter_state' ) {
|
49 |
+
$output[ $key ] = ( isset( $input[ $key ] ) ) ? esc_html( $input[ $key ] ) : $default_value;
|
50 |
+
} else {
|
51 |
+
$output['content_filter_state'] = ( ! empty( $input['content_filter_state'] ) ) ? 'loop_end' : 'content';
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
return apply_filters( 'vkExUnit_common_options_validate', $output, $input, $defaults );
|
56 |
+
}
|
57 |
+
|
58 |
+
|
59 |
+
if ( ! function_exists( 'veu_get_capability_required' ) ) {
|
60 |
+
function veu_get_capability_required() {
|
61 |
+
return add_filter( 'veu_get_capability_required', 'edit_theme_options' );
|
62 |
+
}
|
63 |
+
}
|
64 |
+
|
65 |
+
if ( ! function_exists( 'veu_get_systemlogo_html' ) ) {
|
66 |
+
function veu_get_systemlogo_html() {
|
67 |
+
$logo = '<div class="logo_exUnit">';
|
68 |
+
$logo .= '<img src="' . apply_filters( 'vkExUnit_news_image_URL_small', veu_get_directory_uri( '/assets/images/head_logo_ExUnit.png' ) ) . '" alt="VK ExUnit" />';
|
69 |
+
$logo .= '</div>';
|
70 |
+
$logo = apply_filters( 'veu_get_systemlogo_html', $logo );
|
71 |
+
return $logo;
|
72 |
+
}
|
73 |
+
}
|
74 |
+
|
75 |
+
if ( ! function_exists( 'veu_content_filter_state' ) ) {
|
76 |
+
function veu_content_filter_state() {
|
77 |
+
// $opt = veu_get_common_options();
|
78 |
+
// return empty( $opt['content_filter_state'] )? 'content' : $opt['content_filter_state'];
|
79 |
+
// コンテンツループ下部に出力すると誤動作が多いので、一旦コンテンツ下部出力に強制変更
|
80 |
+
return 'content';
|
81 |
+
}
|
82 |
+
}
|
83 |
+
|
84 |
+
if ( ! function_exists( 'veu_get_name' ) ) {
|
85 |
+
function veu_get_name() {
|
86 |
+
$system_name = apply_filters( 'veu_get_name', 'VK All in one Expansion Unit' );
|
87 |
+
return $system_name;
|
88 |
+
}
|
89 |
+
}
|
90 |
+
|
91 |
+
if ( ! function_exists( 'veu_get_little_short_name' ) ) {
|
92 |
+
function veu_get_little_short_name() {
|
93 |
+
$little_short_name = apply_filters( 'veu_get_little_short_name', 'ExUnit' );
|
94 |
+
return $little_short_name;
|
95 |
+
}
|
96 |
+
}
|
97 |
+
|
98 |
+
if ( ! function_exists( 'veu_get_short_name' ) ) {
|
99 |
+
function veu_get_short_name() {
|
100 |
+
$short_name = apply_filters( 'veu_get_short_name', 'VK' );
|
101 |
+
return $short_name;
|
102 |
+
}
|
103 |
+
}
|
104 |
+
if ( ! function_exists( 'veu_get_prefix' ) ) {
|
105 |
+
function veu_get_prefix() {
|
106 |
+
$prefix = apply_filters( 'veu_get_prefix', 'VK' );
|
107 |
+
if ( $prefix ) {
|
108 |
+
$prefix .= ' ';
|
109 |
+
}
|
110 |
+
return $prefix;
|
111 |
+
}
|
112 |
+
}
|
113 |
+
if ( ! function_exists( 'veu_get_prefix_customize_panel' ) ) {
|
114 |
+
function veu_get_prefix_customize_panel() {
|
115 |
+
$prefix = apply_filters( 'veu_get_prefix_customize_panel', 'ExUnit' );
|
116 |
+
if ( $prefix ) {
|
117 |
+
$prefix .= ' ';
|
118 |
+
}
|
119 |
+
return $prefix;
|
120 |
+
}
|
121 |
+
}
|
122 |
+
|
123 |
+
if ( ! function_exists( 'veu_is_cta_active' ) ) {
|
124 |
+
function veu_is_cta_active() {
|
125 |
+
if ( vk_is_plugin_active( 'vk-all-in-one-expansion-unit/vkExUnit.php' ) ) {
|
126 |
+
$veu_common_options = get_option( 'vkExUnit_common_options' );
|
127 |
+
if ( isset( $veu_common_options['active_call_to_action'] ) && $veu_common_options['active_call_to_action'] ) {
|
128 |
+
return true;
|
129 |
+
}
|
130 |
+
}
|
131 |
+
}
|
132 |
+
}
|
133 |
+
|
134 |
+
require_once( 'template-tags-veu-old.php' );
|
135 |
+
|
136 |
+
|
137 |
+
function veu_is_parent_metabox_display() {
|
138 |
+
$flag = apply_filters( 'veu_parent_metabox_activation', false );
|
139 |
+
if ( ! $flag ) {
|
140 |
+
$flag = veu_is_parent_metabox_display_maual();
|
141 |
+
}
|
142 |
+
return $flag;
|
143 |
+
}
|
144 |
+
|
145 |
+
function veu_is_insert_item_metabox_display() {
|
146 |
+
$options = veu_get_common_options();
|
147 |
+
$admin_post_type = vk_get_post_type();
|
148 |
+
|
149 |
+
/* childPageIndex
|
150 |
+
/*-------------------------------------------*/
|
151 |
+
if ( ! empty( $options['active_childPageIndex'] ) && $admin_post_type['slug'] == 'page' ) {
|
152 |
+
return true;
|
153 |
+
}
|
154 |
+
/* pageList_ancestor
|
155 |
+
/*-------------------------------------------*/
|
156 |
+
if ( ! empty( $options['active_pageList_ancestor'] ) && $admin_post_type['slug'] == 'page' ) {
|
157 |
+
return true;
|
158 |
+
}
|
159 |
+
/* contact_section
|
160 |
+
/*-------------------------------------------*/
|
161 |
+
if ( ! empty( $options['active_contact_section'] ) && $admin_post_type['slug'] == 'page' ) {
|
162 |
+
return true;
|
163 |
+
}
|
164 |
+
/* HTML Sitemap
|
165 |
+
/*-------------------------------------------*/
|
166 |
+
if ( ! empty( $options['active_sitemap_page'] ) && $admin_post_type['slug'] == 'page' ) {
|
167 |
+
return true;
|
168 |
+
}
|
169 |
+
}
|
170 |
+
|
171 |
+
function veu_is_parent_metabox_display_maual() {
|
172 |
+
$flag = false;
|
173 |
+
$options = veu_get_common_options();
|
174 |
+
$admin_post_type = vk_get_post_type();
|
175 |
+
|
176 |
+
$insert_item_metabox_display = veu_is_insert_item_metabox_display();
|
177 |
+
if ( $insert_item_metabox_display ) {
|
178 |
+
return true;
|
179 |
+
}
|
180 |
+
|
181 |
+
/* Meta KeyWords
|
182 |
+
/*-------------------------------------------*/
|
183 |
+
if ( ! empty( $options['active_metaKeyword'] ) ) {
|
184 |
+
return true;
|
185 |
+
}
|
186 |
+
|
187 |
+
/* CSS Customize
|
188 |
+
/*-------------------------------------------*/
|
189 |
+
if ( ! empty( $options['active_css_customize'] ) ) {
|
190 |
+
return true;
|
191 |
+
}
|
192 |
+
|
193 |
+
/* CTA
|
194 |
+
/*-------------------------------------------*/
|
195 |
+
if ( ! empty( $options['active_call_to_action'] ) ) {
|
196 |
+
return true;
|
197 |
+
}
|
198 |
+
|
199 |
+
/* NoIndex
|
200 |
+
/*-------------------------------------------*/
|
201 |
+
if ( ! empty( $options['active_noindex'] ) ) {
|
202 |
+
return true;
|
203 |
+
}
|
204 |
+
|
205 |
+
/* Auto Eye Catch
|
206 |
+
/*-------------------------------------------*/
|
207 |
+
if ( ! empty( $options['active_auto_eyecatch'] ) ) {
|
208 |
+
return true;
|
209 |
+
}
|
210 |
+
|
211 |
+
/* SNS
|
212 |
+
/*-------------------------------------------*/
|
213 |
+
|
214 |
+
if ( ! empty( $options['active_sns'] ) ) {
|
215 |
+
$sns_options = veu_get_sns_options();
|
216 |
+
|
217 |
+
// OGタグ出力機能がONの時は タイトルタグ 書き換え欄の出力が必要
|
218 |
+
if ( ! empty( $sns_options['enableOGTags'] ) || ! empty( $sns_options['enableTwitterCardTagss'] ) ) {
|
219 |
+
return true;
|
220 |
+
}
|
221 |
+
// シェアボタンの表示
|
222 |
+
if ( ! empty( $sns_options['enableSnsBtns'] ) ) {
|
223 |
+
// 表示除外投稿タイプの配列指定がある場合
|
224 |
+
if ( is_array( $sns_options['snsBtn_exclude_post_types'] ) ) {
|
225 |
+
// 表示除外投稿タイプをループ
|
226 |
+
foreach ( $sns_options['snsBtn_exclude_post_types'] as $loop_post_type => $value ) {
|
227 |
+
// 除外対象じゃない投稿タイプの時
|
228 |
+
if ( ! $value && $admin_post_type['slug'] == $loop_post_type ) {
|
229 |
+
return true;
|
230 |
+
}
|
231 |
+
}
|
232 |
+
} else {
|
233 |
+
// SNSを表示しない投稿タイプの指定がない場合
|
234 |
+
return true;
|
235 |
+
}
|
236 |
+
}
|
237 |
+
}
|
238 |
+
|
239 |
+
return $flag;
|
240 |
+
}
|
inc/template-tags/package/template-tags.php
ADDED
@@ -0,0 +1,427 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
|
3 |
+
/*
|
4 |
+
このファイルの元ファイルは
|
5 |
+
https://github.com/vektor-inc/vektor-wp-libraries
|
6 |
+
にあります。修正の際は上記リポジトリのデータを修正してください。
|
7 |
+
*/
|
8 |
+
|
9 |
+
/*
|
10 |
+
Chack use post top page
|
11 |
+
Chack post type info
|
12 |
+
Archive title
|
13 |
+
Page description
|
14 |
+
vk_is_plugin_active
|
15 |
+
Sanitize
|
16 |
+
Post Type Check Box
|
17 |
+
vk_is_checked
|
18 |
+
*/
|
19 |
+
|
20 |
+
if ( ! function_exists( 'vk_is_template_tags_exist' ) ) {
|
21 |
+
function vk_is_template_tags_exist() {
|
22 |
+
return true;
|
23 |
+
}
|
24 |
+
}
|
25 |
+
|
26 |
+
|
27 |
+
if ( ! function_exists( 'vk_is_excerpt' ) ) {
|
28 |
+
function vk_is_excerpt() {
|
29 |
+
global $wp_current_filter;
|
30 |
+
if ( in_array( 'get_the_excerpt', (array) $wp_current_filter ) ) {
|
31 |
+
return true; }
|
32 |
+
return false;
|
33 |
+
}
|
34 |
+
}
|
35 |
+
|
36 |
+
|
37 |
+
/*
|
38 |
+
Chack use post top page
|
39 |
+
/*-------------------------------------------*/
|
40 |
+
if ( ! function_exists( 'vk_get_page_for_posts' ) ) {
|
41 |
+
function vk_get_page_for_posts() {
|
42 |
+
// Get post top page by setting display page.
|
43 |
+
$page_for_posts['post_top_id'] = get_option( 'page_for_posts' );
|
44 |
+
|
45 |
+
// Set use post top page flag.
|
46 |
+
$page_for_posts['post_top_use'] = ( isset( $page_for_posts['post_top_id'] ) && $page_for_posts['post_top_id'] ) ? true : false;
|
47 |
+
|
48 |
+
// When use post top page that get post top page name.
|
49 |
+
$page_for_posts['post_top_name'] = ( $page_for_posts['post_top_use'] ) ? get_the_title( $page_for_posts['post_top_id'] ) : '';
|
50 |
+
|
51 |
+
return $page_for_posts;
|
52 |
+
}
|
53 |
+
}
|
54 |
+
|
55 |
+
|
56 |
+
/*
|
57 |
+
Chack post type info
|
58 |
+
/*-------------------------------------------*/
|
59 |
+
if ( ! function_exists( 'vk_get_post_type' ) ) {
|
60 |
+
function vk_get_post_type() {
|
61 |
+
|
62 |
+
$postType = array();
|
63 |
+
|
64 |
+
$url = $_SERVER['REQUEST_URI'];
|
65 |
+
|
66 |
+
// 管理画面の投稿タイプ
|
67 |
+
// ※ phpunitで is_admin()判定が効かない場合のため strpos( $url, 'wp-admin' ) を使用
|
68 |
+
if ( is_admin() || strpos( $url, 'wp-admin' ) ) {
|
69 |
+
global $post;
|
70 |
+
$postType['slug'] = get_post_type( $post );
|
71 |
+
if ( ! $postType['slug'] ) {
|
72 |
+
if ( ! empty( $_GET['post_type'] ) ) {
|
73 |
+
$postType['slug'] = $_GET['post_type'];
|
74 |
+
} elseif ( ! empty( $_GET['post'] ) ) {
|
75 |
+
$admin_post = get_post( $_GET['post'] );
|
76 |
+
if ( ! empty( $admin_post->post_type ) ) {
|
77 |
+
$postType['slug'] = $admin_post->post_type;
|
78 |
+
}
|
79 |
+
}
|
80 |
+
}
|
81 |
+
return $postType;
|
82 |
+
}
|
83 |
+
|
84 |
+
/*-------------------------------------------*/
|
85 |
+
global $wp_query;
|
86 |
+
$page_for_posts = vk_get_page_for_posts();
|
87 |
+
$postType['slug'] = get_post_type();
|
88 |
+
if ( ! $postType['slug'] ) {
|
89 |
+
|
90 |
+
if ( isset( $wp_query->query_vars['post_type'] ) && $wp_query->query_vars['post_type'] ) {
|
91 |
+
|
92 |
+
$postType['slug'] = $wp_query->query_vars['post_type'];
|
93 |
+
|
94 |
+
} else {
|
95 |
+
// Case of no post type query
|
96 |
+
if ( ! empty( $wp_query->queried_object->taxonomy ) ) {
|
97 |
+
// Case of tax archive and no posts
|
98 |
+
$taxonomy = $wp_query->queried_object->taxonomy;
|
99 |
+
$postType['slug'] = get_taxonomy( $taxonomy )->object_type[0];
|
100 |
+
|
101 |
+
} else {
|
102 |
+
// Case of no tax query and no post type query and no posts
|
103 |
+
$postType['slug'] = 'post';
|
104 |
+
|
105 |
+
} // if ( ! empty( $wp_query->queried_object->taxonomy ) ) {
|
106 |
+
}
|
107 |
+
}
|
108 |
+
|
109 |
+
// Get post type name
|
110 |
+
/*-------------------------------------------*/
|
111 |
+
$post_type_object = get_post_type_object( $postType['slug'] );
|
112 |
+
if ( $post_type_object ) {
|
113 |
+
$allowed_html = array(
|
114 |
+
'span' => array( 'class' => array() ),
|
115 |
+
'b' => array(),
|
116 |
+
);
|
117 |
+
if ( $page_for_posts['post_top_use'] && $postType['slug'] == 'post' ) {
|
118 |
+
$postType['name'] = wp_kses( get_the_title( $page_for_posts['post_top_id'] ), $allowed_html );
|
119 |
+
} else {
|
120 |
+
$postType['name'] = esc_html( $post_type_object->labels->name );
|
121 |
+
}
|
122 |
+
}
|
123 |
+
|
124 |
+
// Get post type archive url
|
125 |
+
/*-------------------------------------------*/
|
126 |
+
if ( $page_for_posts['post_top_use'] && $postType['slug'] == 'post' ) {
|
127 |
+
$postType['url'] = get_the_permalink( $page_for_posts['post_top_id'] );
|
128 |
+
} else {
|
129 |
+
$postType['url'] = get_post_type_archive_link( $postType['slug'] );
|
130 |
+
}
|
131 |
+
|
132 |
+
$postType = apply_filters( 'vkExUnit_postType_custom', $postType );
|
133 |
+
return $postType;
|
134 |
+
}
|
135 |
+
}
|
136 |
+
|
137 |
+
/*
|
138 |
+
Archive title
|
139 |
+
/*-------------------------------------------*/
|
140 |
+
if ( ! function_exists( 'vk_get_the_archive_title' ) ) {
|
141 |
+
function vk_get_the_archive_title() {
|
142 |
+
if ( is_category() ) {
|
143 |
+
$title = single_cat_title( '', false );
|
144 |
+
} elseif ( is_tag() ) {
|
145 |
+
$title = single_tag_title( '', false );
|
146 |
+
} elseif ( is_author() ) {
|
147 |
+
$title = sprintf( __( 'Author: %s', 'vk-all-in-one-expansion-unit' ), '<span class="vcard">' . get_the_author() . '</span>' );
|
148 |
+
} elseif ( is_year() ) {
|
149 |
+
$title = get_the_date( _x( 'Y', 'yearly archives date format', 'vk-all-in-one-expansion-unit' ) );
|
150 |
+
} elseif ( is_month() ) {
|
151 |
+
$title = get_the_date( _x( 'F Y', 'monthly archives date format', 'vk-all-in-one-expansion-unit' ) );
|
152 |
+
} elseif ( is_day() ) {
|
153 |
+
$title = get_the_date( _x( 'F j, Y', 'daily archives date format', 'vk-all-in-one-expansion-unit' ) );
|
154 |
+
} elseif ( is_tax( 'post_format' ) ) {
|
155 |
+
if ( is_tax( 'post_format', 'post-format-aside' ) ) {
|
156 |
+
$title = _x( 'Asides', 'post format archive title' );
|
157 |
+
} elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
|
158 |
+
$title = _x( 'Galleries', 'post format archive title' );
|
159 |
+
} elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
|
160 |
+
$title = _x( 'Images', 'post format archive title' );
|
161 |
+
} elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
|
162 |
+
$title = _x( 'Videos', 'post format archive title' );
|
163 |
+
} elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
|
164 |
+
$title = _x( 'Quotes', 'post format archive title' );
|
165 |
+
} elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
|
166 |
+
$title = _x( 'Links', 'post format archive title' );
|
167 |
+
} elseif ( is_tax( 'post_format', 'post-format-status' ) ) {
|
168 |
+
$title = _x( 'Statuses', 'post format archive title' );
|
169 |
+
} elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {
|
170 |
+
$title = _x( 'Audio', 'post format archive title' );
|
171 |
+
} elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
|
172 |
+
$title = _x( 'Chats', 'post format archive title' );
|
173 |
+
}
|
174 |
+
} elseif ( is_post_type_archive() ) {
|
175 |
+
$title = post_type_archive_title( '', false );
|
176 |
+
} elseif ( is_tax() ) {
|
177 |
+
$title = single_term_title( '', false );
|
178 |
+
} elseif ( is_home() && ! is_front_page() ) {
|
179 |
+
$vkExUnit_page_for_posts = vkExUnit_get_page_for_posts();
|
180 |
+
$title = $vkExUnit_page_for_posts['post_top_name'];
|
181 |
+
} else {
|
182 |
+
global $wp_query;
|
183 |
+
// get post type
|
184 |
+
$postType = $wp_query->query_vars['post_type'];
|
185 |
+
if ( $postType ) {
|
186 |
+
$title = get_post_type_object( $postType )->labels->name;
|
187 |
+
} else {
|
188 |
+
$title = __( 'Archives', 'vk-all-in-one-expansion-unit' );
|
189 |
+
}
|
190 |
+
}
|
191 |
+
return apply_filters( 'vk_get_the_archive_title', $title );
|
192 |
+
}
|
193 |
+
}
|
194 |
+
|
195 |
+
|
196 |
+
/*
|
197 |
+
Page description
|
198 |
+
/*-------------------------------------------*/
|
199 |
+
if ( ! function_exists( 'vk_get_page_description' ) ) {
|
200 |
+
function vk_get_page_description() {
|
201 |
+
global $wp_query;
|
202 |
+
$post = $wp_query->get_queried_object();
|
203 |
+
if ( is_front_page() ) {
|
204 |
+
if ( isset( $post->post_excerpt ) && $post->post_excerpt ) {
|
205 |
+
$page_description = get_the_excerpt();
|
206 |
+
} else {
|
207 |
+
$page_description = get_bloginfo( 'description' );
|
208 |
+
}
|
209 |
+
} elseif ( is_home() ) {
|
210 |
+
$page_for_posts = vk_get_page_for_posts();
|
211 |
+
if ( $page_for_posts['post_top_use'] ) {
|
212 |
+
$page = get_post( $page_for_posts['post_top_id'] );
|
213 |
+
$page_description = $page->post_excerpt;
|
214 |
+
} else {
|
215 |
+
$page_description = get_bloginfo( 'description' );
|
216 |
+
}
|
217 |
+
} elseif ( is_category() || is_tax() ) {
|
218 |
+
if ( ! $post->description ) {
|
219 |
+
$page_description = sprintf( __( 'About %s', 'vk-all-in-one-expansion-unit' ), single_cat_title( '', false ) ) . ' ' . get_bloginfo( 'name' ) . ' ' . get_bloginfo( 'description' );
|
220 |
+
} else {
|
221 |
+
$page_description = $post->description;
|
222 |
+
}
|
223 |
+
} elseif ( is_tag() ) {
|
224 |
+
$page_description = strip_tags( tag_description() );
|
225 |
+
$page_description = str_replace( array( "\r\n", "\r", "\n" ), '', $page_description ); // delete br
|
226 |
+
if ( ! $page_description ) {
|
227 |
+
$page_description = sprintf( __( 'About %s', 'vk-all-in-one-expansion-unit' ), single_tag_title( '', false ) ) . ' ' . get_bloginfo( 'name' ) . ' ' . get_bloginfo( 'description' );
|
228 |
+
}
|
229 |
+
} elseif ( is_archive() ) {
|
230 |
+
if ( is_year() ) {
|
231 |
+
$description_date = get_the_date( _x( 'Y', 'yearly archives date format', 'vk-all-in-one-expansion-unit' ) );
|
232 |
+
$page_description = sprintf( _x( 'Article of %s.', 'Yearly archive description', 'vk-all-in-one-expansion-unit' ), $description_date );
|
233 |
+
$page_description .= ' ' . get_bloginfo( 'name' ) . ' ' . get_bloginfo( 'description' );
|
234 |
+
} elseif ( is_month() ) {
|
235 |
+
$description_date = get_the_date( _x( 'F Y', 'monthly archives date format', 'vk-all-in-one-expansion-unit' ) );
|
236 |
+
$page_description = sprintf( _x( 'Article of %s.', 'Archive description', 'vk-all-in-one-expansion-unit' ), $description_date );
|
237 |
+
$page_description .= ' ' . get_bloginfo( 'name' ) . ' ' . get_bloginfo( 'description' );
|
238 |
+
} elseif ( is_author() ) {
|
239 |
+
$userObj = get_queried_object();
|
240 |
+
$page_description = sprintf( _x( 'Article of %s.', 'Archive description', 'vk-all-in-one-expansion-unit' ), esc_html( $userObj->display_name ) );
|
241 |
+
$page_description .= ' ' . get_bloginfo( 'name' ) . ' ' . get_bloginfo( 'description' );
|
242 |
+
} else {
|
243 |
+
$postType = get_post_type();
|
244 |
+
if ( $postType ) {
|
245 |
+
$page_description = sprintf( _x( 'Article of %s.', 'Archive description', 'vk-all-in-one-expansion-unit' ), esc_html( get_post_type_object( $postType )->label ) );
|
246 |
+
$page_description .= ' ' . get_bloginfo( 'name' ) . ' ' . get_bloginfo( 'description' );
|
247 |
+
} else {
|
248 |
+
$page_description = get_bloginfo( 'description' );
|
249 |
+
}
|
250 |
+
}
|
251 |
+
} elseif ( is_page() || is_single() ) {
|
252 |
+
if ( $post->post_excerpt ) {
|
253 |
+
$page_description = $post->post_excerpt;
|
254 |
+
} else {
|
255 |
+
$page_description = $post->post_content;
|
256 |
+
}
|
257 |
+
} else {
|
258 |
+
$page_description = get_bloginfo( 'description' );
|
259 |
+
}
|
260 |
+
global $paged;
|
261 |
+
if ( $paged != '0' ) {
|
262 |
+
$page_description = '[' . sprintf( __( 'Page of %s', 'vk-all-in-one-expansion-unit' ), $paged ) . '] ' . $page_description;
|
263 |
+
}
|
264 |
+
// This filter (vkExUnit_pageDescriptionCustom) is deprecated.
|
265 |
+
$page_description = apply_filters( 'vkExUnit_pageDescriptionCustom', $page_description );
|
266 |
+
|
267 |
+
/*
|
268 |
+
いままで
|
269 |
+
* 画像ギャラリーなどのショートコードがそのまま表示される
|
270 |
+
* ショートコードの中の引数の "" が入るとタグの終了がおかしくなりシェアやRSSで問題が出る
|
271 |
+
という理由で do_shortcode で実行した後 html タグを除去していた
|
272 |
+
$page_description = esc_html( strip_tags( do_shortcode( $page_description ) ) );
|
273 |
+
|
274 |
+
しかし、ここで do_shortcode 入れるとWooCommerceなどのエラーメッセージが正常に表示されなくなる。
|
275 |
+
なので、ショートコードの実行は行わないが、ショートコードの引き値としての " は不具合の原因となるので
|
276 |
+
" esc_attr でエスケープを実施する
|
277 |
+
本来ショートコードが出る場合は適切に抜粋欄に記入して運用でカバーする。
|
278 |
+
*/
|
279 |
+
// この関数は get_the_ ではないので関数内では esc_attr() は行わない
|
280 |
+
$page_description = strip_tags( $page_description );
|
281 |
+
$page_description = strip_shortcodes( $page_description );
|
282 |
+
|
283 |
+
if ( is_singular() ) {
|
284 |
+
$page_description = mb_substr( $page_description, 0, 240 ); // kill tags and trim 240 chara
|
285 |
+
}
|
286 |
+
|
287 |
+
// Delete Line break
|
288 |
+
$page_description = str_replace( array( "\r\n", "\r", "\n", "\t" ), '', $page_description );
|
289 |
+
|
290 |
+
return apply_filters( 'vk_get_page_description', $page_description );
|
291 |
+
}
|
292 |
+
}
|
293 |
+
|
294 |
+
/*
|
295 |
+
vk_is_plugin_active
|
296 |
+
/*-------------------------------------------*/
|
297 |
+
if ( ! function_exists( 'vk_is_plugin_active' ) ) {
|
298 |
+
function vk_is_plugin_active( $plugin_path = '' ) {
|
299 |
+
if ( function_exists( 'is_plugin_active' ) ) {
|
300 |
+
return is_plugin_active( $plugin_path );
|
301 |
+
} else {
|
302 |
+
return in_array(
|
303 |
+
$plugin_path,
|
304 |
+
get_option( 'active_plugins' )
|
305 |
+
);
|
306 |
+
}
|
307 |
+
}
|
308 |
+
}
|
309 |
+
|
310 |
+
/*
|
311 |
+
Sanitize
|
312 |
+
/*-------------------------------------------*/
|
313 |
+
if ( ! function_exists( 'veu_sanitize_boolean' ) ) {
|
314 |
+
function veu_sanitize_boolean( $input ) {
|
315 |
+
if ( $input == true ) {
|
316 |
+
return true;
|
317 |
+
} else {
|
318 |
+
return false;
|
319 |
+
}
|
320 |
+
}
|
321 |
+
}
|
322 |
+
|
323 |
+
if ( ! function_exists( 'veu_sanitize_radio' ) ) {
|
324 |
+
function veu_sanitize_radio( $input ) {
|
325 |
+
return esc_attr( $input );
|
326 |
+
}
|
327 |
+
}
|
328 |
+
|
329 |
+
if ( ! function_exists( 'vk_sanitize_number' ) ) {
|
330 |
+
function vk_sanitize_number( $input ) {
|
331 |
+
$return = intval( mb_convert_kana( $input, 'n' ) );
|
332 |
+
return esc_attr( $return );
|
333 |
+
}
|
334 |
+
}
|
335 |
+
if ( ! function_exists( 'vk_sanitize_array' ) ) {
|
336 |
+
function vk_sanitize_array( $input ) {
|
337 |
+
if ( is_array( $input ) ) {
|
338 |
+
$return = array();
|
339 |
+
foreach ( $input as $key => $value ) {
|
340 |
+
$return[ $key ] = wp_kses_post( $value );
|
341 |
+
}
|
342 |
+
}
|
343 |
+
return $return;
|
344 |
+
}
|
345 |
+
}
|
346 |
+
|
347 |
+
/*
|
348 |
+
Post Type Check Box
|
349 |
+
/*-------------------------------------------*/
|
350 |
+
/**
|
351 |
+
* 投稿タイプのチェックボックスを表示する関数
|
352 |
+
*
|
353 |
+
* @param [type] $args 取得する投稿タイプ情報の判別や保存されてる値の情報など
|
354 |
+
* @return [type] [description]
|
355 |
+
*/
|
356 |
+
function vk_the_post_type_check_list( $args ) {
|
357 |
+
$default = array(
|
358 |
+
'post_types_args' => array(
|
359 |
+
'public' => true,
|
360 |
+
),
|
361 |
+
'name' => '',
|
362 |
+
'checked' => array( 'post' => true ),
|
363 |
+
'id' => '',
|
364 |
+
'exclude_post_types' => array( 'attachment' ),
|
365 |
+
);
|
366 |
+
$args = wp_parse_args( $args, $default );
|
367 |
+
$post_types = get_post_types( $args['post_types_args'], 'object' );
|
368 |
+
|
369 |
+
echo '<ul>';
|
370 |
+
foreach ( $post_types as $key => $value ) {
|
371 |
+
|
372 |
+
if ( ! in_array( $key, $args['exclude_post_types'] ) ) {
|
373 |
+
|
374 |
+
$checked = ( isset( $args['checked'][ $key ] ) && ( $args['checked'][ $key ] ) ) ? ' checked' : '';
|
375 |
+
|
376 |
+
if ( ! empty( $args['id'][ $key ] ) ) {
|
377 |
+
$id = ' id="' . esc_attr( $args['id'][ $key ] ) . '"';
|
378 |
+
} elseif ( ! empty( $args['name'][ $key ] ) ) {
|
379 |
+
$id = ' id="' . esc_attr( $args['name'][ $key ] ) . '"';
|
380 |
+
} else {
|
381 |
+
$id = '';
|
382 |
+
}
|
383 |
+
|
384 |
+
echo '<li><label>';
|
385 |
+
echo '<input type="checkbox" name="' . esc_attr( $args['name'] ) . '[' . $key . ']"' . $id . ' value="true"' . $checked . ' />' . esc_html( $value->label );
|
386 |
+
echo '</label></li>';
|
387 |
+
}
|
388 |
+
}
|
389 |
+
echo '</ul>';
|
390 |
+
}
|
391 |
+
|
392 |
+
/**
|
393 |
+
* vk_the_post_type_check_list で保存される配列が、キーに投稿タイプ名が入る微妙な仕様のため、投稿タイプだけを配列で返すように変換
|
394 |
+
* @param [type] $post_types : array( 'post' => 'true', 'info' => '' );
|
395 |
+
* @return [type] $return : array( 'post' );
|
396 |
+
*/
|
397 |
+
function vk_the_post_type_check_list_saved_array_convert( $post_types ) {
|
398 |
+
$return = array();
|
399 |
+
if ( is_array( $post_types ) ) {
|
400 |
+
foreach ( $post_types as $post_type => $value ) {
|
401 |
+
if ( $value ) {
|
402 |
+
$return[] = $post_type;
|
403 |
+
}
|
404 |
+
}
|
405 |
+
}
|
406 |
+
return$return;
|
407 |
+
}
|
408 |
+
|
409 |
+
/*
|
410 |
+
vk_is_checked
|
411 |
+
/*-------------------------------------------*/
|
412 |
+
/**
|
413 |
+
* [vk_is_checked description]
|
414 |
+
*
|
415 |
+
* @param string $checked_value checkedにする場合の値
|
416 |
+
* @param string $value 保存値
|
417 |
+
* @return boolean [description]
|
418 |
+
*/
|
419 |
+
if ( ! function_exists( 'vk_is_checked' ) ) {
|
420 |
+
function vk_is_checked( $checked_value = '', $value = '' ) {
|
421 |
+
$checked = '';
|
422 |
+
if ( $checked_value == $value ) {
|
423 |
+
$checked = ' checked';
|
424 |
+
}
|
425 |
+
echo $checked;
|
426 |
+
}
|
427 |
+
}
|
inc/template-tags/template-tags-config.php
ADDED
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
// if ( ! function_exists( 'vk_is_template_tags_exist' ) ) {
|
3 |
+
if ( ! function_exists( 'vk_get_post_type' ) ) {
|
4 |
+
require_once( 'package/template-tags.php' );
|
5 |
+
require_once( 'package/template-tags-veu.php' );
|
6 |
+
require_once( 'package/template-tags-veu-old.php' );
|
7 |
+
}
|
inc/template-tags/template-tags.php
CHANGED
@@ -17,6 +17,11 @@ https://github.com/vektor-inc/vektor-wp-libraries
|
|
17 |
vk_is_checked
|
18 |
*/
|
19 |
|
|
|
|
|
|
|
|
|
|
|
20 |
|
21 |
|
22 |
if ( ! function_exists( 'vk_is_excerpt' ) ) {
|
@@ -327,6 +332,17 @@ if ( ! function_exists( 'vk_sanitize_number' ) ) {
|
|
327 |
return esc_attr( $return );
|
328 |
}
|
329 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
330 |
|
331 |
/*
|
332 |
Post Type Check Box
|
@@ -343,35 +359,53 @@ function vk_the_post_type_check_list( $args ) {
|
|
343 |
'public' => true,
|
344 |
),
|
345 |
'name' => '',
|
346 |
-
'checked' => '',
|
347 |
'id' => '',
|
348 |
'exclude_post_types' => array( 'attachment' ),
|
349 |
);
|
350 |
$args = wp_parse_args( $args, $default );
|
351 |
$post_types = get_post_types( $args['post_types_args'], 'object' );
|
|
|
352 |
echo '<ul>';
|
353 |
foreach ( $post_types as $key => $value ) {
|
354 |
|
355 |
if ( ! in_array( $key, $args['exclude_post_types'] ) ) {
|
356 |
|
357 |
-
$checked = ( isset( $args['checked'][ $key ] ) && $args['checked'][ $key ]
|
358 |
|
359 |
-
if ( $args['id'] ) {
|
360 |
-
$id = ' id="' . esc_attr( $args['id'] ) . '"';
|
361 |
-
} elseif ( $args['name'] ) {
|
362 |
-
$id = ' id="' . esc_attr( $args['name'] ) . '"';
|
363 |
} else {
|
364 |
$id = '';
|
365 |
}
|
366 |
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
}
|
371 |
}
|
372 |
echo '</ul>';
|
373 |
}
|
374 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
375 |
/*
|
376 |
vk_is_checked
|
377 |
/*-------------------------------------------*/
|
17 |
vk_is_checked
|
18 |
*/
|
19 |
|
20 |
+
if ( ! function_exists( 'vk_is_template_tags_exist' ) ) {
|
21 |
+
function vk_is_template_tags_exist() {
|
22 |
+
return true;
|
23 |
+
}
|
24 |
+
}
|
25 |
|
26 |
|
27 |
if ( ! function_exists( 'vk_is_excerpt' ) ) {
|
332 |
return esc_attr( $return );
|
333 |
}
|
334 |
}
|
335 |
+
if ( ! function_exists( 'vk_sanitize_array' ) ) {
|
336 |
+
function vk_sanitize_array( $input ) {
|
337 |
+
if ( is_array( $input ) ) {
|
338 |
+
$return = array();
|
339 |
+
foreach ( $input as $key => $value ) {
|
340 |
+
$return[ $key ] = wp_kses_post( $value );
|
341 |
+
}
|
342 |
+
}
|
343 |
+
return $return;
|
344 |
+
}
|
345 |
+
}
|
346 |
|
347 |
/*
|
348 |
Post Type Check Box
|
359 |
'public' => true,
|
360 |
),
|
361 |
'name' => '',
|
362 |
+
'checked' => array( 'post' => true ),
|
363 |
'id' => '',
|
364 |
'exclude_post_types' => array( 'attachment' ),
|
365 |
);
|
366 |
$args = wp_parse_args( $args, $default );
|
367 |
$post_types = get_post_types( $args['post_types_args'], 'object' );
|
368 |
+
|
369 |
echo '<ul>';
|
370 |
foreach ( $post_types as $key => $value ) {
|
371 |
|
372 |
if ( ! in_array( $key, $args['exclude_post_types'] ) ) {
|
373 |
|
374 |
+
$checked = ( isset( $args['checked'][ $key ] ) && ( $args['checked'][ $key ] ) ) ? ' checked' : '';
|
375 |
|
376 |
+
if ( ! empty( $args['id'][ $key ] ) ) {
|
377 |
+
$id = ' id="' . esc_attr( $args['id'][ $key ] ) . '"';
|
378 |
+
} elseif ( ! empty( $args['name'][ $key ] ) ) {
|
379 |
+
$id = ' id="' . esc_attr( $args['name'][ $key ] ) . '"';
|
380 |
} else {
|
381 |
$id = '';
|
382 |
}
|
383 |
|
384 |
+
echo '<li><label>';
|
385 |
+
echo '<input type="checkbox" name="' . esc_attr( $args['name'] ) . '[' . $key . ']"' . $id . ' value="true"' . $checked . ' />' . esc_html( $value->label );
|
386 |
+
echo '</label></li>';
|
387 |
}
|
388 |
}
|
389 |
echo '</ul>';
|
390 |
}
|
391 |
|
392 |
+
/**
|
393 |
+
* vk_the_post_type_check_list で保存される配列が、キーに投稿タイプ名が入る微妙な仕様のため、投稿タイプだけを配列で返すように変換
|
394 |
+
* @param [type] $post_types : array( 'post' => 'true', 'info' => '' );
|
395 |
+
* @return [type] $return : array( 'post' );
|
396 |
+
*/
|
397 |
+
function vk_the_post_type_check_list_saved_array_convert( $post_types ) {
|
398 |
+
$return = array();
|
399 |
+
if ( is_array( $post_types ) ) {
|
400 |
+
foreach ( $post_types as $post_type => $value ) {
|
401 |
+
if ( $value ) {
|
402 |
+
$return[] = $post_type;
|
403 |
+
}
|
404 |
+
}
|
405 |
+
}
|
406 |
+
return$return;
|
407 |
+
}
|
408 |
+
|
409 |
/*
|
410 |
vk_is_checked
|
411 |
/*-------------------------------------------*/
|
initialize.php
CHANGED
@@ -10,9 +10,8 @@
|
|
10 |
/*-------------------------------------------*/
|
11 |
require veu_get_directory() . '/veu-package-manager.php';
|
12 |
// template-tags-veuでpackageの関数を使うので package-managerを先に読み込んでいる
|
13 |
-
require_once veu_get_directory() . '/inc/template-tags/template-tags.php';
|
14 |
-
|
15 |
-
require_once veu_get_directory() . '/inc/template-tags/template-tags-veu-old.php';
|
16 |
require_once veu_get_directory() . '/admin/admin.php';
|
17 |
require veu_get_directory() . '/inc/footer-copyright-change.php';
|
18 |
|
10 |
/*-------------------------------------------*/
|
11 |
require veu_get_directory() . '/veu-package-manager.php';
|
12 |
// template-tags-veuでpackageの関数を使うので package-managerを先に読み込んでいる
|
13 |
+
require_once veu_get_directory() . '/inc/template-tags/template-tags-config.php';
|
14 |
+
|
|
|
15 |
require_once veu_get_directory() . '/admin/admin.php';
|
16 |
require veu_get_directory() . '/inc/footer-copyright-change.php';
|
17 |
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Donate link:
|
|
4 |
Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
|
5 |
Requires at least: 5.1.0
|
6 |
Tested up to: 5.3.0
|
7 |
-
Stable tag: 9.6.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -87,6 +87,12 @@ e.g.
|
|
87 |
|
88 |
== Changelog ==
|
89 |
|
|
|
|
|
|
|
|
|
|
|
|
|
90 |
= 9.6.6.0 =
|
91 |
[ bug fix ][ vk blocks ] WP 5.3 column bug fix
|
92 |
[ bug fix ][ SNS ] Facebook OG size first load
|
4 |
Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
|
5 |
Requires at least: 5.1.0
|
6 |
Tested up to: 5.3.0
|
7 |
+
Stable tag: 9.6.8.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
87 |
|
88 |
== Changelog ==
|
89 |
|
90 |
+
= 9.6.8.0 =
|
91 |
+
[ Specification change ] ファイル階層一部変更
|
92 |
+
|
93 |
+
= 9.6.7.0 =
|
94 |
+
[ library update ] library update
|
95 |
+
|
96 |
= 9.6.6.0 =
|
97 |
[ bug fix ][ vk blocks ] WP 5.3 column bug fix
|
98 |
[ bug fix ][ SNS ] Facebook OG size first load
|
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.6.
|
7 |
* Author: Vektor,Inc.
|
8 |
* Text Domain: vk-all-in-one-expansion-unit
|
9 |
* Domain Path: /languages
|
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.6.8.0
|
7 |
* Author: Vektor,Inc.
|
8 |
* Text Domain: vk-all-in-one-expansion-unit
|
9 |
* Domain Path: /languages
|