Version Description
- [ Add function ] Insert Page list from ancestor.
- [ Specification change ][ Related post ] Change related logic.
- [ bug fix ][ Description ] Delete
- [ bug fix ] php7
Download this release
Release Info
Developer | kurudrive |
Plugin | VK All in One Expansion Unit |
Version | 3.7.0 |
Comparing to | |
See all releases |
Code changes from version 3.6.3 to 3.7.0
- _scss/vkExUnit_style.scss +60 -66
- admin_wrapper.php +46 -46
- common_helpers.php +136 -136
- common_init.php +15 -15
- css/vkExUnit_style.css +1 -1
- css/vkExUnit_style_in_bs.css +2 -2
- package_manager.php +29 -29
- packages.php +225 -203
- plugins/auto_eyecatch.php +31 -32
- plugins/call_to_action/call_to_action.php +1 -1
- plugins/call_to_action/class.call_to_action.php +169 -170
- plugins/call_to_action/view.actionbox.php +9 -9
- plugins/call_to_action/view.adminsetting.php +14 -14
- plugins/child_page_index.php +42 -43
- plugins/contact_section.php +78 -79
- plugins/css_customize/css_customize.php +48 -52
- plugins/disable_ping-back.php +1 -1
- plugins/footer_copyright_change.php +4 -4
- plugins/google_analytics/ga_admin.php +15 -15
- plugins/google_analytics/google_analytics.php +24 -24
- plugins/icons.php +20 -21
- plugins/insert_ads.php +45 -46
- plugins/meta_description.php +11 -11
- plugins/meta_keyword.php +59 -59
- plugins/other_widget/old/widget-rss-widget.php +14 -14
- plugins/other_widget/other_widget.php +23 -1
- plugins/other_widget/widget-3pr-area.php +239 -239
- plugins/other_widget/widget-archives.php +51 -52
- plugins/other_widget/widget-child-page-list.php +15 -15
- plugins/other_widget/widget-new-posts.php +62 -62
- plugins/other_widget/widget-page.php +29 -28
- plugins/other_widget/widget-pr-blocks.php +98 -97
- plugins/other_widget/widget-profile.php +86 -86
- plugins/other_widget/widget-taxonomies.php +37 -37
- plugins/pageList_ancestor.php +46 -46
- plugins/page_custom_field.php +8 -8
- plugins/related_posts/related_posts.php +27 -23
- plugins/sitemap_page/sitemap_admin.php +6 -6
- plugins/sitemap_page/sitemap_page.php +80 -81
- plugins/sns/function_fbPagePlugin.php +37 -38
- plugins/sns/function_follow.php +11 -11
- plugins/sns/function_meta_box.php +41 -41
- plugins/sns/function_og.php +21 -21
- plugins/sns/function_snsBtns.php +14 -14
- plugins/sns/function_twitterCard.php +34 -34
- plugins/sns/sns.php +35 -35
- plugins/sns/sns_admin.php +25 -25
- plugins_admin/admin_banner.php +6 -6
- plugins_admin/admin_bar.php +12 -12
- plugins_admin/dashboard_info_widget.php +9 -8
- plugins_admin/news_from_exUnit.php +22 -33
- readme.txt +8 -1
- uninstaller.php +37 -37
- vkExUnit.php +57 -63
- vkExUnit_admin.php +42 -43
_scss/vkExUnit_style.scss
CHANGED
@@ -59,7 +59,7 @@ html { font-size: inherit; } /* reset bootstrap */
|
|
59 |
h1.mainSection-title { font-size:24px; }
|
60 |
|
61 |
.veu_adminEdit { margin-top:5px; }
|
62 |
-
.veu_adminEdit a.btn:before{margin-right:5px;
|
63 |
|
64 |
.veu_contentAddSection { display:block; clear:both; overflow:hidden; padding-top:20px; }
|
65 |
|
@@ -118,7 +118,7 @@ h1.mainSection-title { font-size:24px; }
|
|
118 |
li.sb_pocket { margin-left:5px;}
|
119 |
}
|
120 |
.veu_count_sns_fb,
|
121 |
-
.veu_count_sns_hb { display:inline-block; margin-left:5px; padding:2px 5px; border-radius:5px;
|
122 |
.veu_count_sns_fb { background:#425dab; }
|
123 |
.veu_count_sns_hb { background:#2c6ebd; }
|
124 |
|
@@ -173,10 +173,10 @@ h1.mainSection-title { font-size:24px; }
|
|
173 |
margin-top: 2.5em;margin-bottom:1em;
|
174 |
a:hover{ text-decoration: none; }
|
175 |
.childPage_list_box { display:block;margin-bottom:1em; }
|
176 |
-
.childPage_list_box_inner{ display:block; overflow:hidden;
|
177 |
-
.childPage_list_title{ margin-top:20px;font-size: 16px;line-height: 1.4;
|
178 |
.wp-post-image{ float: left; margin-right: 1em; width: 30%; border: solid 1px #ddd; }
|
179 |
-
.childPage_list_body{ overflow: hidden; color: #333; font-size: 14px;
|
180 |
&:hover{
|
181 |
text-decoration: underline;
|
182 |
}
|
@@ -194,79 +194,73 @@ h1.mainSection-title { font-size:24px; }
|
|
194 |
/*-------------------------------------------*/
|
195 |
/* .veu_pageList_ancestor
|
196 |
/*-------------------------------------------*/
|
|
|
197 |
.veu_pageList_ancestor{
|
198 |
margin: 0 0 15px;
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
color: #333;
|
203 |
-
font-size: 23px;
|
204 |
-
}
|
205 |
-
}
|
206 |
.pageList{
|
207 |
-
|
208 |
-
|
209 |
-
display: -webkit-flex;
|
210 |
-
display: flex;
|
211 |
-
overflow: hidden;
|
212 |
-
margin: 0;
|
213 |
-
padding: 0;
|
214 |
-
width: 100%;
|
215 |
-
-ms-flex-wrap:wrap;
|
216 |
-
-webkit-flex-wrap:wrap;
|
217 |
-
flex-wrap:wrap;
|
218 |
-
}
|
219 |
-
.page_item{
|
220 |
-
box-sizing: border-box;
|
221 |
-
width: 33.3%;
|
222 |
-
list-style: none;
|
223 |
a{
|
224 |
display: block;
|
225 |
-
padding:
|
|
|
226 |
color: #333;
|
227 |
font-size: 0.8em;
|
228 |
}
|
229 |
-
|
230 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
231 |
}
|
232 |
}
|
233 |
-
.current_page_item a{
|
234 |
background-color: #F0F0F0;
|
|
|
235 |
}
|
236 |
.children{
|
237 |
margin: 0;
|
238 |
-
padding-left:
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
247 |
}
|
248 |
}
|
249 |
}
|
250 |
@media screen and (max-width:992px){
|
251 |
-
.veu_pageList_ancestor{
|
252 |
-
|
253 |
-
float: none;
|
254 |
-
margin-bottom: 0;
|
255 |
-
width: 100%;
|
256 |
}
|
257 |
-
.children{
|
258 |
-
a{
|
259 |
-
padding: 5px;
|
260 |
-
}
|
261 |
-
}
|
262 |
-
}
|
263 |
} // @media screen and (max-width:992px){
|
264 |
|
265 |
/*-------------------------------------------*/
|
266 |
/* .veu_cta
|
267 |
/*-------------------------------------------*/
|
268 |
-
.veu_cta { display:block; overflow:hidden;
|
269 |
-
h1.cta_title { display:block; overflow:hidden;background-color: #333;font-size:22px;
|
270 |
.cta_body { display:block; overflow:hidden; padding:1.5em 2em 2em;line-height: 170%; }
|
271 |
.cta_body_image { margin-bottom:1.5em; }
|
272 |
.cta_body_image img { max-width: 250px; }
|
@@ -292,15 +286,15 @@ h1.mainSection-title { font-size:24px; }
|
|
292 |
/* .veu_contact
|
293 |
/*-------------------------------------------*/
|
294 |
.veu_contact { display:block; overflow:hidden;
|
295 |
-
.contact_frame { display:block; overflow:hidden;padding:25px 24px 21px; border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px rgba(255,255,255,1);
|
296 |
.contact_txt_catch,
|
297 |
.contact_txt_tel,
|
298 |
.contact_txt_time { display:block; overflow:hidden; }
|
299 |
.contact_txt_catch,
|
300 |
-
.contact_txt_time { line-height: 128.6%;
|
301 |
-
.contact_txt_tel { font-size: 28px;line-height: 110%;
|
302 |
-
.contact_bt_txt:before {
|
303 |
-
.contact_bt_txt:after {
|
304 |
.contact_bt_subTxt { display:block; overflow:hidden;font-size:14px; }
|
305 |
} // .veu_contact
|
306 |
|
@@ -319,7 +313,7 @@ h1.mainSection-title { font-size:24px; }
|
|
319 |
} // .veu_contact
|
320 |
|
321 |
.widget {
|
322 |
-
.veu_contact .contact_bt {
|
323 |
}
|
324 |
|
325 |
} // @media (min-width: 768px){
|
@@ -398,17 +392,17 @@ h1.mainSection-title { font-size:24px; }
|
|
398 |
.veu_newPosts {
|
399 |
h1.mainSection-title { margin-bottom:0; }
|
400 |
ul.postList { margin:15px 0 $section_margin;padding:0;
|
401 |
-
li { display:block; overflow:hidden;border-bottom:1px dotted #666;
|
402 |
a {color:$color_font_default;}
|
403 |
.published,
|
404 |
.taxonomies a,
|
405 |
-
.entry-title {display:block; overflow:hidden;
|
406 |
.published { margin-right:10px;color:#d44950; }
|
407 |
-
.published:before { content:'';
|
408 |
-
.taxonomies a {
|
409 |
-
.entry-title {
|
410 |
}
|
411 |
-
.entry-meta_items.published:before {
|
412 |
}
|
413 |
/*-------------------------------------------*/
|
414 |
/* Widget .veu_followSet
|
59 |
h1.mainSection-title { font-size:24px; }
|
60 |
|
61 |
.veu_adminEdit { margin-top:5px; }
|
62 |
+
.veu_adminEdit a.btn:before{margin-right:5px;content:"\f040";font-family:FontAwesome;}
|
63 |
|
64 |
.veu_contentAddSection { display:block; clear:both; overflow:hidden; padding-top:20px; }
|
65 |
|
118 |
li.sb_pocket { margin-left:5px;}
|
119 |
}
|
120 |
.veu_count_sns_fb,
|
121 |
+
.veu_count_sns_hb { display:inline-block; margin-left:5px; padding:2px 5px; border-radius:5px; color:#ffffff; vertical-align:top; font-size:77%; line-height:1; }
|
122 |
.veu_count_sns_fb { background:#425dab; }
|
123 |
.veu_count_sns_hb { background:#2c6ebd; }
|
124 |
|
173 |
margin-top: 2.5em;margin-bottom:1em;
|
174 |
a:hover{ text-decoration: none; }
|
175 |
.childPage_list_box { display:block;margin-bottom:1em; }
|
176 |
+
.childPage_list_box_inner{ position: relative; display:block; overflow:hidden;padding: 0 20px;border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px rgba(255,255,255,1);}
|
177 |
+
.childPage_list_title{ margin-top:20px;color:$color_font_default;font-size: 16px;line-height: 1.4;}
|
178 |
.wp-post-image{ float: left; margin-right: 1em; width: 30%; border: solid 1px #ddd; }
|
179 |
+
.childPage_list_body{ overflow: hidden;margin-bottom:5px; color: #333; font-size: 14px;
|
180 |
&:hover{
|
181 |
text-decoration: underline;
|
182 |
}
|
194 |
/*-------------------------------------------*/
|
195 |
/* .veu_pageList_ancestor
|
196 |
/*-------------------------------------------*/
|
197 |
+
|
198 |
.veu_pageList_ancestor{
|
199 |
margin: 0 0 15px;
|
200 |
+
padding: 0 20px;
|
201 |
+
border: 3px solid #efefef;
|
202 |
+
box-shadow: inset 0px 0px 0px 1px #fff;
|
|
|
|
|
|
|
|
|
203 |
.pageList{
|
204 |
+
margin-top: 1em;
|
205 |
+
padding-left: 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
206 |
a{
|
207 |
display: block;
|
208 |
+
padding: 8px 5px;
|
209 |
+
border-bottom: solid 1px #ddd;
|
210 |
color: #333;
|
211 |
font-size: 0.8em;
|
212 |
}
|
213 |
+
& > .page_item {
|
214 |
+
list-style: none;
|
215 |
+
}
|
216 |
+
& > .page_item:last-child a{
|
217 |
+
border: none;
|
218 |
+
}
|
219 |
+
.page_item{
|
220 |
+
margin-bottom: 0;
|
221 |
}
|
222 |
}
|
223 |
+
.current_page_item > a{
|
224 |
background-color: #F0F0F0;
|
225 |
+
box-shadow: inset 0 0 5px #eee;
|
226 |
}
|
227 |
.children{
|
228 |
margin: 0;
|
229 |
+
padding-left: 15px;
|
230 |
+
.page_item{
|
231 |
+
position: relative;
|
232 |
+
list-style: none;
|
233 |
+
&:before{
|
234 |
+
position: absolute;
|
235 |
+
top: 0.26em;
|
236 |
+
left: 5px;
|
237 |
+
display: inline-block;
|
238 |
+
content: "・";
|
239 |
+
}
|
240 |
+
a{
|
241 |
+
padding-left: 20px;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
}
|
245 |
+
.section_title.subSection-title{
|
246 |
+
margin: 0.5em 0;
|
247 |
+
a{
|
248 |
+
color: #333;
|
249 |
+
font-size: 23px;
|
250 |
}
|
251 |
}
|
252 |
}
|
253 |
@media screen and (max-width:992px){
|
254 |
+
.page-template-default .veu_pageList_ancestor{
|
255 |
+
display: none;
|
|
|
|
|
|
|
256 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
257 |
} // @media screen and (max-width:992px){
|
258 |
|
259 |
/*-------------------------------------------*/
|
260 |
/* .veu_cta
|
261 |
/*-------------------------------------------*/
|
262 |
+
.veu_cta { display:block; overflow:hidden;margin-top:$section_margin;margin-bottom:$section_margin;background-color: #efefef;
|
263 |
+
h1.cta_title { display:block; overflow:hidden;padding: 12px 20px 10px;background-color: #333;color:#fff;font-size:22px;line-height: 1.2em; }
|
264 |
.cta_body { display:block; overflow:hidden; padding:1.5em 2em 2em;line-height: 170%; }
|
265 |
.cta_body_image { margin-bottom:1.5em; }
|
266 |
.cta_body_image img { max-width: 250px; }
|
286 |
/* .veu_contact
|
287 |
/*-------------------------------------------*/
|
288 |
.veu_contact { display:block; overflow:hidden;
|
289 |
+
.contact_frame { display:block; overflow:hidden;padding:25px 24px 21px; border:3px solid #efefef;background-color: #f9f9f9;box-shadow:inset 0px 0px 0px 1px rgba(255,255,255,1); }
|
290 |
.contact_txt_catch,
|
291 |
.contact_txt_tel,
|
292 |
.contact_txt_time { display:block; overflow:hidden; }
|
293 |
.contact_txt_catch,
|
294 |
+
.contact_txt_time {font-size: 14px; line-height: 128.6%; }
|
295 |
+
.contact_txt_tel {padding-top:4px; font-size: 28px;line-height: 110%;}
|
296 |
+
.contact_bt_txt:before {margin-right:7px;content:"\f003"; font-family:FontAwesome; }
|
297 |
+
.contact_bt_txt:after {margin-left:7px;content:"\f18e"; font-family:FontAwesome; }
|
298 |
.contact_bt_subTxt { display:block; overflow:hidden;font-size:14px; }
|
299 |
} // .veu_contact
|
300 |
|
313 |
} // .veu_contact
|
314 |
|
315 |
.widget {
|
316 |
+
.veu_contact .contact_bt {display: inline-block;float:none; margin-top:15px; }
|
317 |
}
|
318 |
|
319 |
} // @media (min-width: 768px){
|
392 |
.veu_newPosts {
|
393 |
h1.mainSection-title { margin-bottom:0; }
|
394 |
ul.postList { margin:15px 0 $section_margin;padding:0;
|
395 |
+
li { display:block;clear:both; overflow:hidden;padding:0;border-bottom:1px dotted #666; }
|
396 |
a {color:$color_font_default;}
|
397 |
.published,
|
398 |
.taxonomies a,
|
399 |
+
.entry-title {display:block;float:left; overflow:hidden;}
|
400 |
.published { margin-right:10px;color:#d44950; }
|
401 |
+
.published:before {margin:0; content:''; }
|
402 |
+
.taxonomies a {margin-right:3px; padding: 2px 5px 1px; border-radius:3px; background-color: #efefef;font-size:12px; }
|
403 |
+
.entry-title { display: block; clear:both;margin:5px 0; }
|
404 |
}
|
405 |
+
.entry-meta_items.published:before {margin-right:5px;content:"\f073"; font-family:FontAwesome; }
|
406 |
}
|
407 |
/*-------------------------------------------*/
|
408 |
/* Widget .veu_followSet
|
admin_wrapper.php
CHANGED
@@ -4,19 +4,19 @@ function vkExUnit_add_main_setting() {
|
|
4 |
$capability_required = add_filter( 'vkExUnit_ga_page_capability', vkExUnit_get_capability_required() );
|
5 |
$custom_page = add_submenu_page(
|
6 |
'vkExUnit_setting_page', // parent
|
7 |
-
__('Main setting','vkExUnit'), // Name of page
|
8 |
-
__('Main setting','vkExUnit'), // Label in menu
|
9 |
// $capability_required,
|
10 |
'activate_plugins', // Capability
|
11 |
'vkExUnit_main_setting', // ユニークなこのサブメニューページの識別子
|
12 |
'vkExUnit_render_main_config' // メニューページのコンテンツを出力する関数
|
13 |
);
|
14 |
-
if ( ! $custom_page ) return;
|
15 |
}
|
16 |
add_action( 'admin_menu', 'vkExUnit_add_main_setting' );
|
17 |
|
18 |
|
19 |
-
function vkExUnit_render_main_config(){
|
20 |
|
21 |
vkExUnit_save_main_config();
|
22 |
?>
|
@@ -27,7 +27,7 @@ function vkExUnit_render_main_config(){
|
|
27 |
<?php
|
28 |
wp_nonce_field( 'standing_on_the_shoulder_of_giants', '_nonce_vkExUnit' );
|
29 |
global $vkExUnit_options;
|
30 |
-
|
31 |
|
32 |
<div id="adminContent_sub">
|
33 |
|
@@ -36,16 +36,16 @@ function vkExUnit_render_main_config(){
|
|
36 |
<div class="optionNav"><ul>
|
37 |
<?php
|
38 |
// $i = 0;
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
|
48 |
-
|
49 |
?>
|
50 |
</ul></div>
|
51 |
</div><!-- [ /#adminContent_sub ] -->
|
@@ -53,29 +53,29 @@ function vkExUnit_render_main_config(){
|
|
53 |
<div id="adminContent_main">
|
54 |
|
55 |
<?php
|
56 |
-
|
57 |
-
|
58 |
|
59 |
-
|
60 |
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
}
|
66 |
-
echo '</section>';
|
67 |
}
|
|
|
|
|
68 |
?>
|
69 |
|
70 |
</div><!-- [ /#adminContent_main ] -->
|
71 |
|
72 |
|
73 |
|
74 |
-
<?php else:
|
75 |
|
76 |
-
_e('Activated Packages is noting. please activate some package.', 'vkExUnit');
|
77 |
|
78 |
-
|
79 |
</form>
|
80 |
</div><!-- [ /.adminMain ] -->
|
81 |
|
@@ -87,51 +87,51 @@ _e('Activated Packages is noting. please activate some package.', 'vkExUnit');
|
|
87 |
<?php
|
88 |
}
|
89 |
|
90 |
-
function vkExUnit_register_setting( $tab_label=
|
91 |
global $vkExUnit_options;
|
92 |
$vkExUnit_options[] =
|
93 |
array(
|
94 |
-
'option_name'
|
95 |
-
'callback'
|
96 |
-
'tab_label'
|
97 |
-
'render_page'
|
98 |
);
|
99 |
}
|
100 |
|
101 |
|
102 |
-
function vkExUnit_main_config_sanitaize($post){
|
103 |
global $vkExUnit_options;
|
104 |
|
105 |
-
if(!empty($vkExUnit_options)){
|
106 |
-
foreach($vkExUnit_options as $opt){
|
107 |
|
108 |
-
if( is_array( $opt['callback'] ) ){
|
109 |
|
110 |
-
$before = (isset($post[$opt['option_name']])? $post[$opt['option_name']]: null);
|
111 |
-
$option = $opt['callback'][0]
|
112 |
|
113 |
-
}elseif( function_exists( $opt['callback'] ) ){
|
114 |
|
115 |
-
$before = (isset($post[$opt['option_name']])? $post[$opt['option_name']]: null);
|
116 |
$option = $opt['callback']($before);
|
117 |
|
118 |
-
}else { continue; }
|
119 |
|
120 |
-
update_option($opt['option_name'], $option);
|
121 |
}
|
122 |
}
|
123 |
}
|
124 |
|
125 |
|
126 |
-
function vkExUnit_save_main_config(){
|
127 |
|
128 |
// nonce
|
129 |
-
if(!isset($_POST['_nonce_vkExUnit'])){
|
130 |
return ;
|
131 |
}
|
132 |
-
if(!wp_verify_nonce($_POST['_nonce_vkExUnit'], 'standing_on_the_shoulder_of_giants')){
|
133 |
return ;
|
134 |
}
|
135 |
|
136 |
-
vkExUnit_main_config_sanitaize($_POST);
|
137 |
-
}
|
4 |
$capability_required = add_filter( 'vkExUnit_ga_page_capability', vkExUnit_get_capability_required() );
|
5 |
$custom_page = add_submenu_page(
|
6 |
'vkExUnit_setting_page', // parent
|
7 |
+
__( 'Main setting','vkExUnit' ), // Name of page
|
8 |
+
__( 'Main setting','vkExUnit' ), // Label in menu
|
9 |
// $capability_required,
|
10 |
'activate_plugins', // Capability
|
11 |
'vkExUnit_main_setting', // ユニークなこのサブメニューページの識別子
|
12 |
'vkExUnit_render_main_config' // メニューページのコンテンツを出力する関数
|
13 |
);
|
14 |
+
if ( ! $custom_page ) { return; }
|
15 |
}
|
16 |
add_action( 'admin_menu', 'vkExUnit_add_main_setting' );
|
17 |
|
18 |
|
19 |
+
function vkExUnit_render_main_config() {
|
20 |
|
21 |
vkExUnit_save_main_config();
|
22 |
?>
|
27 |
<?php
|
28 |
wp_nonce_field( 'standing_on_the_shoulder_of_giants', '_nonce_vkExUnit' );
|
29 |
global $vkExUnit_options;
|
30 |
+
if ( is_array( $vkExUnit_options ) ) : ?>
|
31 |
|
32 |
<div id="adminContent_sub">
|
33 |
|
36 |
<div class="optionNav"><ul>
|
37 |
<?php
|
38 |
// $i = 0;
|
39 |
+
foreach ( $vkExUnit_options as $vkoption ) {
|
40 |
+
if ( ! isset( $vkoption['render_page'] ) ) { continue; }
|
41 |
+
// $linkUrl = ($i == 0) ? 'wpwrap':$vkoption['option_name'];
|
42 |
+
$linkUrl = $vkoption['option_name'];
|
43 |
+
echo '<li id="btn_"'. $vkoption['option_name']. '" class="'.$vkoption['option_name'].'"><a href="#'. $linkUrl .'">';
|
44 |
+
echo $vkoption['tab_label'];
|
45 |
+
echo '</a></li>';
|
46 |
+
// $i++;
|
47 |
|
48 |
+
}
|
49 |
?>
|
50 |
</ul></div>
|
51 |
</div><!-- [ /#adminContent_sub ] -->
|
53 |
<div id="adminContent_main">
|
54 |
|
55 |
<?php
|
56 |
+
foreach ( $vkExUnit_options as $vkoption ) {
|
57 |
+
if ( ! isset( $vkoption['render_page'] ) ) { continue; }
|
58 |
|
59 |
+
echo '<section id="'. $vkoption['option_name'] .'">';
|
60 |
|
61 |
+
if ( is_array( $vkoption['render_page'] ) ) {
|
62 |
+
$vkoption['render_page'][0]->{$vkoption['render_page'][1]}();
|
63 |
+
} else {
|
64 |
+
$vkoption['render_page']();
|
|
|
|
|
65 |
}
|
66 |
+
echo '</section>';
|
67 |
+
}
|
68 |
?>
|
69 |
|
70 |
</div><!-- [ /#adminContent_main ] -->
|
71 |
|
72 |
|
73 |
|
74 |
+
<?php else :
|
75 |
|
76 |
+
_e( 'Activated Packages is noting. please activate some package.', 'vkExUnit' );
|
77 |
|
78 |
+
endif; ?>
|
79 |
</form>
|
80 |
</div><!-- [ /.adminMain ] -->
|
81 |
|
87 |
<?php
|
88 |
}
|
89 |
|
90 |
+
function vkExUnit_register_setting( $tab_label = 'tab_label', $option_name, $sanitize_callback, $render_page ) {
|
91 |
global $vkExUnit_options;
|
92 |
$vkExUnit_options[] =
|
93 |
array(
|
94 |
+
'option_name' => $option_name,
|
95 |
+
'callback' => $sanitize_callback,
|
96 |
+
'tab_label' => $tab_label,
|
97 |
+
'render_page' => $render_page,
|
98 |
);
|
99 |
}
|
100 |
|
101 |
|
102 |
+
function vkExUnit_main_config_sanitaize( $post ) {
|
103 |
global $vkExUnit_options;
|
104 |
|
105 |
+
if ( ! empty( $vkExUnit_options ) ) {
|
106 |
+
foreach ( $vkExUnit_options as $opt ) {
|
107 |
|
108 |
+
if ( is_array( $opt['callback'] ) ) {
|
109 |
|
110 |
+
$before = (isset( $post[ $opt['option_name'] ] )? $post[ $opt['option_name'] ]: null);
|
111 |
+
$option = $opt['callback'][0]->{$opt['callback'][1]}($before);
|
112 |
|
113 |
+
} elseif ( function_exists( $opt['callback'] ) ) {
|
114 |
|
115 |
+
$before = (isset( $post[ $opt['option_name'] ] )? $post[ $opt['option_name'] ]: null);
|
116 |
$option = $opt['callback']($before);
|
117 |
|
118 |
+
} else { continue; }
|
119 |
|
120 |
+
update_option( $opt['option_name'], $option );
|
121 |
}
|
122 |
}
|
123 |
}
|
124 |
|
125 |
|
126 |
+
function vkExUnit_save_main_config() {
|
127 |
|
128 |
// nonce
|
129 |
+
if ( ! isset( $_POST['_nonce_vkExUnit'] ) ) {
|
130 |
return ;
|
131 |
}
|
132 |
+
if ( ! wp_verify_nonce( $_POST['_nonce_vkExUnit'], 'standing_on_the_shoulder_of_giants' ) ) {
|
133 |
return ;
|
134 |
}
|
135 |
|
136 |
+
vkExUnit_main_config_sanitaize( $_POST );
|
137 |
+
}
|
common_helpers.php
CHANGED
@@ -1,38 +1,38 @@
|
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
-
/*
|
4 |
/*-------------------------------------------*/
|
5 |
-
/*
|
6 |
/*-------------------------------------------*/
|
7 |
-
/*
|
8 |
/*-------------------------------------------*/
|
9 |
-
/*
|
10 |
/*-------------------------------------------*/
|
11 |
-
/*
|
12 |
/*-------------------------------------------*/
|
13 |
-
/*
|
14 |
/*-------------------------------------------*/
|
15 |
|
16 |
/*-------------------------------------------*/
|
17 |
-
/*
|
18 |
/*-------------------------------------------*/
|
19 |
function vkExUnit_get_name() {
|
20 |
-
$system_name = apply_filters('vkExUnit_get_name_custom','VK All in one Expansion Unit');
|
21 |
return $system_name;
|
22 |
}
|
23 |
function vkExUnit_get_little_short_name() {
|
24 |
-
$little_short_name = apply_filters('vkExUnit_get_little_short_name_custom','VK Ex Unit');
|
25 |
return $little_short_name;
|
26 |
}
|
27 |
function vkExUnit_get_short_name() {
|
28 |
-
$short_name = apply_filters('vkExUnit_get_short_name_custom','VK');
|
29 |
return $short_name;
|
30 |
}
|
31 |
-
function vkExUnit_get_capability_required(){
|
32 |
$capability_required = 'activate_plugins';
|
33 |
return $capability_required;
|
34 |
}
|
35 |
-
function vkExUnit_get_systemlogo(){
|
36 |
$logo = '<div class="logo_exUnit">';
|
37 |
$logo .= '<img src="' . apply_filters( 'vkExUnit_news_image_URL_small', vkExUnit_get_directory_uri( '/images/head_logo_ExUnit.png' ) ) . '" alt="VK ExUnit" />';
|
38 |
$logo .= '</div>';
|
@@ -40,14 +40,14 @@ function vkExUnit_get_systemlogo(){
|
|
40 |
}
|
41 |
|
42 |
/*-------------------------------------------*/
|
43 |
-
/*
|
44 |
/*-------------------------------------------*/
|
45 |
-
function vkExUnit_get_page_for_posts(){
|
46 |
// Get post top page by setting display page.
|
47 |
-
$page_for_posts['post_top_id'] = get_option('page_for_posts');
|
48 |
|
49 |
// Set use post top page flag.
|
50 |
-
$page_for_posts['post_top_use'] = ( isset($page_for_posts['post_top_id']) && $page_for_posts['post_top_id'] ) ? true : false ;
|
51 |
|
52 |
// When use post top page that get post top page name.
|
53 |
$page_for_posts['post_top_name'] = ( $page_for_posts['post_top_use'] ) ? get_the_title( $page_for_posts['post_top_id'] ) : '';
|
@@ -56,18 +56,18 @@ function vkExUnit_get_page_for_posts(){
|
|
56 |
}
|
57 |
|
58 |
/*-------------------------------------------*/
|
59 |
-
/*
|
60 |
/*-------------------------------------------*/
|
61 |
-
function vkExUnit_get_post_type(){
|
62 |
|
63 |
$page_for_posts = vkExUnit_get_page_for_posts();
|
64 |
|
65 |
// Get post type slug
|
66 |
/*-------------------------------------------*/
|
67 |
$postType['slug'] = get_post_type();
|
68 |
-
if (
|
69 |
global $wp_query;
|
70 |
-
if ($wp_query->query_vars['post_type']) {
|
71 |
$postType['slug'] = $wp_query->query_vars['post_type'];
|
72 |
} else {
|
73 |
// Case of tax archive and no posts
|
@@ -78,215 +78,215 @@ function vkExUnit_get_post_type(){
|
|
78 |
|
79 |
// Get post type name
|
80 |
/*-------------------------------------------*/
|
81 |
-
$post_type_object = get_post_type_object($postType['slug']);
|
82 |
-
if($post_type_object){
|
83 |
-
if ( $page_for_posts['post_top_use'] && $postType['slug'] == 'post' ){
|
84 |
-
$postType['name'] = esc_html( get_the_title($page_for_posts['post_top_id']) );
|
85 |
} else {
|
86 |
-
$postType['name'] = esc_html($post_type_object->labels->name);
|
87 |
}
|
88 |
}
|
89 |
|
90 |
// Get post type archive url
|
91 |
/*-------------------------------------------*/
|
92 |
-
if ( $page_for_posts['post_top_use'] && $postType['slug'] == 'post' ){
|
93 |
-
$postType['url'] = get_the_permalink($page_for_posts['post_top_id']);
|
94 |
} else {
|
95 |
$postType['url'] = home_url().'/?post_type='.$postType['slug'];
|
96 |
}
|
97 |
|
98 |
-
$postType = apply_filters('vkExUnit_postType_custom',$postType);
|
99 |
return $postType;
|
100 |
}
|
101 |
/*-------------------------------------------*/
|
102 |
-
/*
|
103 |
/*-------------------------------------------*/
|
104 |
-
function vkExUnit_get_wp_head_title(){
|
105 |
global $wp_query;
|
106 |
$post = $wp_query->get_queried_object();
|
107 |
$sep = ' | ';
|
108 |
$sep = apply_filters( 'vkExUnit_get_wp_head_title', $sep );
|
109 |
|
110 |
-
if (is_front_page()) {
|
111 |
-
$title = get_bloginfo('name').$sep.get_bloginfo( 'description' );
|
112 |
-
} else if ( is_home() && !is_front_page()) {
|
113 |
-
$title = vkExUnit_get_the_archive_title().$sep.get_bloginfo('name');
|
114 |
} else if ( is_archive() ) {
|
115 |
-
$title = vkExUnit_get_the_archive_title().$sep.get_bloginfo('name');
|
116 |
-
|
117 |
-
} else if (is_page()) {
|
118 |
// Sub Pages
|
119 |
if ( $post->post_parent ) {
|
120 |
-
if($post->ancestors){
|
121 |
-
foreach($post->ancestors as $post_anc_id){
|
122 |
$post_id = $post_anc_id;
|
123 |
}
|
124 |
} else {
|
125 |
$post_id = $post->ID;
|
126 |
}
|
127 |
-
$title = get_the_title().$sep.get_the_title($post_id).$sep.get_bloginfo('name');
|
128 |
-
|
129 |
} else {
|
130 |
-
$title = get_the_title().$sep.get_bloginfo('name');
|
131 |
}
|
132 |
-
} else if ( is_single() || is_attachment() ){
|
133 |
-
$title = get_the_title().$sep.get_bloginfo('name');
|
134 |
|
135 |
-
|
136 |
-
} else if ( is_search() ){
|
137 |
-
$title = sprintf(__('Search Results for : %s', 'vkExUnit'),get_search_query()).$sep.get_bloginfo('name');
|
138 |
-
|
139 |
-
} else if (is_404()){
|
140 |
-
$title = __('Not found', 'vkExUnit').$sep.get_bloginfo('name');
|
141 |
-
|
142 |
} else {
|
143 |
-
$title = get_bloginfo('name');
|
144 |
}
|
145 |
|
146 |
// Add Page numner.
|
147 |
global $paged;
|
148 |
-
if ( $paged >= 2 ){
|
149 |
-
$title = '['.sprintf(__('Page of %s', 'vkExUnit' ),$paged).'] '.$title;
|
150 |
}
|
151 |
|
152 |
$title = apply_filters( 'vkExUnit_get_wp_head_title', $title );
|
153 |
|
154 |
// Remove Tags(ex:<i>) & return
|
155 |
-
return strip_tags($title);
|
156 |
}
|
157 |
|
158 |
|
159 |
/*-------------------------------------------*/
|
160 |
-
/*
|
161 |
/*-------------------------------------------*/
|
162 |
function vkExUnit_get_pageDescription() {
|
163 |
global $wp_query;
|
164 |
$post = $wp_query->get_queried_object();
|
165 |
if ( is_front_page() ) {
|
166 |
-
if ( isset($post->post_excerpt) && $post->post_excerpt ) {
|
167 |
$pageDescription = get_the_excerpt();
|
168 |
} else {
|
169 |
$pageDescription = get_bloginfo( 'description' );
|
170 |
}
|
171 |
} else if ( is_home() ) {
|
172 |
$page_for_posts = vkExUnit_get_page_for_posts();
|
173 |
-
if ( $page_for_posts['post_top_use'] ){
|
174 |
-
$page = get_post($page_for_posts['post_top_id']);
|
175 |
$pageDescription = $page->post_excerpt;
|
176 |
} else {
|
177 |
$pageDescription = get_bloginfo( 'description' );
|
178 |
}
|
179 |
-
} else if (is_category() || is_tax()) {
|
180 |
if ( ! $post->description ) {
|
181 |
-
$pageDescription = sprintf(__('About %s', 'vkExUnit'),single_cat_title('',false)).' '.get_bloginfo('name').' '.get_bloginfo('description');
|
182 |
} else {
|
183 |
$pageDescription = $post->description;
|
184 |
}
|
185 |
-
} else if (is_tag()) {
|
186 |
-
$pageDescription = strip_tags(tag_description());
|
187 |
-
$pageDescription = str_replace(array("\r\n","\r","\n"), '', $pageDescription); // delete br
|
188 |
if ( ! $pageDescription ) {
|
189 |
-
$pageDescription = sprintf(__('About %s', 'vkExUnit'),single_tag_title('',false)).' '.get_bloginfo('name').' '.get_bloginfo('description');
|
190 |
}
|
191 |
-
} else if (is_archive()) {
|
192 |
-
if (is_year()){
|
193 |
$description_date = get_the_date( _x( 'Y', 'yearly archives date format', 'vkExUnit' ) );
|
194 |
-
$pageDescription = sprintf(_x('Article of %s.','Yearly archive description', 'vkExUnit'), $description_date );
|
195 |
-
$pageDescription .= ' '.get_bloginfo('name').' '.get_bloginfo('description');
|
196 |
-
} else if (is_month()){
|
197 |
$description_date = get_the_date( _x( 'F Y', 'monthly archives date format', 'vkExUnit' ) );
|
198 |
-
$pageDescription = sprintf(_x('Article of %s.','Archive description', 'vkExUnit'),$description_date );
|
199 |
-
$pageDescription .= ' '.get_bloginfo('name').' '.get_bloginfo('description');
|
200 |
-
} else if (is_author()) {
|
201 |
$userObj = get_queried_object();
|
202 |
-
$pageDescription = sprintf(_x('Article of %s.','Archive description', 'vkExUnit'),esc_html($userObj->display_name) );
|
203 |
-
$pageDescription .= ' '.get_bloginfo('name').' '.get_bloginfo('description');
|
204 |
} else {
|
205 |
$postType = get_post_type();
|
206 |
-
$pageDescription = sprintf(_x('Article of %s.','Archive description', 'vkExUnit'),esc_html(get_post_type_object($postType)->labels->name) );
|
207 |
-
$pageDescription .= ' '.get_bloginfo('name').' '.get_bloginfo('description');
|
208 |
}
|
209 |
-
} else if (is_page() || is_single()) {
|
210 |
$metaExcerpt = $post->post_excerpt;
|
211 |
-
if ($metaExcerpt) {
|
212 |
$pageDescription = $metaExcerpt;
|
213 |
} else {
|
214 |
-
$pageDescription = mb_substr( strip_tags($post->post_content), 0, 240 ); // kill tags and trim 240 chara
|
215 |
}
|
216 |
} else {
|
217 |
-
$pageDescription = get_bloginfo('description');
|
218 |
}
|
219 |
global $paged;
|
220 |
-
if ( $paged != '0'){
|
221 |
-
$pageDescription = '['.sprintf(__('Page of %s', 'vkExUnit' ),$paged).'] '.$pageDescription;
|
222 |
}
|
223 |
$pageDescription = apply_filters( 'vkExUnit_pageDescriptionCustom', $pageDescription );
|
224 |
-
$pageDescription = esc_html(strip_tags($pageDescription));
|
225 |
// Delete Line break
|
226 |
-
$pageDescription = str_replace(array("\r", "\n"), '
|
227 |
return $pageDescription;
|
228 |
}
|
229 |
|
230 |
/*-------------------------------------------*/
|
231 |
-
/*
|
232 |
/*-------------------------------------------*/
|
233 |
|
234 |
-
function vkExUnit_get_the_archive_title(){
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
-
|
244 |
-
|
245 |
-
|
246 |
-
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
-
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
|
268 |
-
|
269 |
-
|
270 |
-
|
271 |
-
|
272 |
-
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
// get post type
|
277 |
$postType = $wp_query->query_vars['post_type'];
|
278 |
if ( $postType ) {
|
279 |
-
$title = get_post_type_object($postType)->labels->name;
|
280 |
} else {
|
281 |
$title = __( 'Archives', 'vkExUnit' );
|
282 |
}
|
283 |
-
|
284 |
|
285 |
-
|
286 |
}
|
287 |
|
288 |
-
function vkExUnit_is_excerpt(){
|
289 |
-
|
290 |
-
|
291 |
-
|
292 |
-
}
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
+
/* basic setting
|
4 |
/*-------------------------------------------*/
|
5 |
+
/* Chack use post top page
|
6 |
/*-------------------------------------------*/
|
7 |
+
/* Chack post type info
|
8 |
/*-------------------------------------------*/
|
9 |
+
/* Head title
|
10 |
/*-------------------------------------------*/
|
11 |
+
/* Page description
|
12 |
/*-------------------------------------------*/
|
13 |
+
/* Archive title
|
14 |
/*-------------------------------------------*/
|
15 |
|
16 |
/*-------------------------------------------*/
|
17 |
+
/* basic setting
|
18 |
/*-------------------------------------------*/
|
19 |
function vkExUnit_get_name() {
|
20 |
+
$system_name = apply_filters( 'vkExUnit_get_name_custom','VK All in one Expansion Unit' );
|
21 |
return $system_name;
|
22 |
}
|
23 |
function vkExUnit_get_little_short_name() {
|
24 |
+
$little_short_name = apply_filters( 'vkExUnit_get_little_short_name_custom','VK Ex Unit' );
|
25 |
return $little_short_name;
|
26 |
}
|
27 |
function vkExUnit_get_short_name() {
|
28 |
+
$short_name = apply_filters( 'vkExUnit_get_short_name_custom','VK' );
|
29 |
return $short_name;
|
30 |
}
|
31 |
+
function vkExUnit_get_capability_required() {
|
32 |
$capability_required = 'activate_plugins';
|
33 |
return $capability_required;
|
34 |
}
|
35 |
+
function vkExUnit_get_systemlogo() {
|
36 |
$logo = '<div class="logo_exUnit">';
|
37 |
$logo .= '<img src="' . apply_filters( 'vkExUnit_news_image_URL_small', vkExUnit_get_directory_uri( '/images/head_logo_ExUnit.png' ) ) . '" alt="VK ExUnit" />';
|
38 |
$logo .= '</div>';
|
40 |
}
|
41 |
|
42 |
/*-------------------------------------------*/
|
43 |
+
/* Chack use post top page
|
44 |
/*-------------------------------------------*/
|
45 |
+
function vkExUnit_get_page_for_posts() {
|
46 |
// Get post top page by setting display page.
|
47 |
+
$page_for_posts['post_top_id'] = get_option( 'page_for_posts' );
|
48 |
|
49 |
// Set use post top page flag.
|
50 |
+
$page_for_posts['post_top_use'] = ( isset( $page_for_posts['post_top_id'] ) && $page_for_posts['post_top_id'] ) ? true : false ;
|
51 |
|
52 |
// When use post top page that get post top page name.
|
53 |
$page_for_posts['post_top_name'] = ( $page_for_posts['post_top_use'] ) ? get_the_title( $page_for_posts['post_top_id'] ) : '';
|
56 |
}
|
57 |
|
58 |
/*-------------------------------------------*/
|
59 |
+
/* Chack post type info
|
60 |
/*-------------------------------------------*/
|
61 |
+
function vkExUnit_get_post_type() {
|
62 |
|
63 |
$page_for_posts = vkExUnit_get_page_for_posts();
|
64 |
|
65 |
// Get post type slug
|
66 |
/*-------------------------------------------*/
|
67 |
$postType['slug'] = get_post_type();
|
68 |
+
if ( ! $postType['slug'] ) {
|
69 |
global $wp_query;
|
70 |
+
if ( $wp_query->query_vars['post_type'] ) {
|
71 |
$postType['slug'] = $wp_query->query_vars['post_type'];
|
72 |
} else {
|
73 |
// Case of tax archive and no posts
|
78 |
|
79 |
// Get post type name
|
80 |
/*-------------------------------------------*/
|
81 |
+
$post_type_object = get_post_type_object( $postType['slug'] );
|
82 |
+
if ( $post_type_object ) {
|
83 |
+
if ( $page_for_posts['post_top_use'] && $postType['slug'] == 'post' ) {
|
84 |
+
$postType['name'] = esc_html( get_the_title( $page_for_posts['post_top_id'] ) );
|
85 |
} else {
|
86 |
+
$postType['name'] = esc_html( $post_type_object->labels->name );
|
87 |
}
|
88 |
}
|
89 |
|
90 |
// Get post type archive url
|
91 |
/*-------------------------------------------*/
|
92 |
+
if ( $page_for_posts['post_top_use'] && $postType['slug'] == 'post' ) {
|
93 |
+
$postType['url'] = get_the_permalink( $page_for_posts['post_top_id'] );
|
94 |
} else {
|
95 |
$postType['url'] = home_url().'/?post_type='.$postType['slug'];
|
96 |
}
|
97 |
|
98 |
+
$postType = apply_filters( 'vkExUnit_postType_custom',$postType );
|
99 |
return $postType;
|
100 |
}
|
101 |
/*-------------------------------------------*/
|
102 |
+
/* Head title
|
103 |
/*-------------------------------------------*/
|
104 |
+
function vkExUnit_get_wp_head_title() {
|
105 |
global $wp_query;
|
106 |
$post = $wp_query->get_queried_object();
|
107 |
$sep = ' | ';
|
108 |
$sep = apply_filters( 'vkExUnit_get_wp_head_title', $sep );
|
109 |
|
110 |
+
if ( is_front_page() ) {
|
111 |
+
$title = get_bloginfo( 'name' ).$sep.get_bloginfo( 'description' );
|
112 |
+
} else if ( is_home() && ! is_front_page() ) {
|
113 |
+
$title = vkExUnit_get_the_archive_title().$sep.get_bloginfo( 'name' );
|
114 |
} else if ( is_archive() ) {
|
115 |
+
$title = vkExUnit_get_the_archive_title().$sep.get_bloginfo( 'name' );
|
116 |
+
// Page
|
117 |
+
} else if ( is_page() ) {
|
118 |
// Sub Pages
|
119 |
if ( $post->post_parent ) {
|
120 |
+
if ( $post->ancestors ) {
|
121 |
+
foreach ( $post->ancestors as $post_anc_id ) {
|
122 |
$post_id = $post_anc_id;
|
123 |
}
|
124 |
} else {
|
125 |
$post_id = $post->ID;
|
126 |
}
|
127 |
+
$title = get_the_title().$sep.get_the_title( $post_id ).$sep.get_bloginfo( 'name' );
|
128 |
+
// Not Sub Pages
|
129 |
} else {
|
130 |
+
$title = get_the_title().$sep.get_bloginfo( 'name' );
|
131 |
}
|
132 |
+
} else if ( is_single() || is_attachment() ) {
|
133 |
+
$title = get_the_title().$sep.get_bloginfo( 'name' );
|
134 |
|
135 |
+
// Search
|
136 |
+
} else if ( is_search() ) {
|
137 |
+
$title = sprintf( __( 'Search Results for : %s', 'vkExUnit' ),get_search_query() ).$sep.get_bloginfo( 'name' );
|
138 |
+
// 404
|
139 |
+
} else if ( is_404() ) {
|
140 |
+
$title = __( 'Not found', 'vkExUnit' ).$sep.get_bloginfo( 'name' );
|
141 |
+
// Other
|
142 |
} else {
|
143 |
+
$title = get_bloginfo( 'name' );
|
144 |
}
|
145 |
|
146 |
// Add Page numner.
|
147 |
global $paged;
|
148 |
+
if ( $paged >= 2 ) {
|
149 |
+
$title = '['.sprintf( __( 'Page of %s', 'vkExUnit' ),$paged ).'] '.$title;
|
150 |
}
|
151 |
|
152 |
$title = apply_filters( 'vkExUnit_get_wp_head_title', $title );
|
153 |
|
154 |
// Remove Tags(ex:<i>) & return
|
155 |
+
return strip_tags( $title );
|
156 |
}
|
157 |
|
158 |
|
159 |
/*-------------------------------------------*/
|
160 |
+
/* Page description
|
161 |
/*-------------------------------------------*/
|
162 |
function vkExUnit_get_pageDescription() {
|
163 |
global $wp_query;
|
164 |
$post = $wp_query->get_queried_object();
|
165 |
if ( is_front_page() ) {
|
166 |
+
if ( isset( $post->post_excerpt ) && $post->post_excerpt ) {
|
167 |
$pageDescription = get_the_excerpt();
|
168 |
} else {
|
169 |
$pageDescription = get_bloginfo( 'description' );
|
170 |
}
|
171 |
} else if ( is_home() ) {
|
172 |
$page_for_posts = vkExUnit_get_page_for_posts();
|
173 |
+
if ( $page_for_posts['post_top_use'] ) {
|
174 |
+
$page = get_post( $page_for_posts['post_top_id'] );
|
175 |
$pageDescription = $page->post_excerpt;
|
176 |
} else {
|
177 |
$pageDescription = get_bloginfo( 'description' );
|
178 |
}
|
179 |
+
} else if ( is_category() || is_tax() ) {
|
180 |
if ( ! $post->description ) {
|
181 |
+
$pageDescription = sprintf( __( 'About %s', 'vkExUnit' ),single_cat_title( '',false ) ).' '.get_bloginfo( 'name' ).' '.get_bloginfo( 'description' );
|
182 |
} else {
|
183 |
$pageDescription = $post->description;
|
184 |
}
|
185 |
+
} else if ( is_tag() ) {
|
186 |
+
$pageDescription = strip_tags( tag_description() );
|
187 |
+
$pageDescription = str_replace( array( "\r\n", "\r", "\n" ), '', $pageDescription ); // delete br
|
188 |
if ( ! $pageDescription ) {
|
189 |
+
$pageDescription = sprintf( __( 'About %s', 'vkExUnit' ),single_tag_title( '',false ) ).' '.get_bloginfo( 'name' ).' '.get_bloginfo( 'description' );
|
190 |
}
|
191 |
+
} else if ( is_archive() ) {
|
192 |
+
if ( is_year() ) {
|
193 |
$description_date = get_the_date( _x( 'Y', 'yearly archives date format', 'vkExUnit' ) );
|
194 |
+
$pageDescription = sprintf( _x( 'Article of %s.','Yearly archive description', 'vkExUnit' ), $description_date );
|
195 |
+
$pageDescription .= ' '.get_bloginfo( 'name' ).' '.get_bloginfo( 'description' );
|
196 |
+
} else if ( is_month() ) {
|
197 |
$description_date = get_the_date( _x( 'F Y', 'monthly archives date format', 'vkExUnit' ) );
|
198 |
+
$pageDescription = sprintf( _x( 'Article of %s.','Archive description', 'vkExUnit' ),$description_date );
|
199 |
+
$pageDescription .= ' '.get_bloginfo( 'name' ).' '.get_bloginfo( 'description' );
|
200 |
+
} else if ( is_author() ) {
|
201 |
$userObj = get_queried_object();
|
202 |
+
$pageDescription = sprintf( _x( 'Article of %s.','Archive description', 'vkExUnit' ),esc_html( $userObj->display_name ) );
|
203 |
+
$pageDescription .= ' '.get_bloginfo( 'name' ).' '.get_bloginfo( 'description' );
|
204 |
} else {
|
205 |
$postType = get_post_type();
|
206 |
+
$pageDescription = sprintf( _x( 'Article of %s.','Archive description', 'vkExUnit' ),esc_html( get_post_type_object( $postType )->labels->name ) );
|
207 |
+
$pageDescription .= ' '.get_bloginfo( 'name' ).' '.get_bloginfo( 'description' );
|
208 |
}
|
209 |
+
} else if ( is_page() || is_single() ) {
|
210 |
$metaExcerpt = $post->post_excerpt;
|
211 |
+
if ( $metaExcerpt ) {
|
212 |
$pageDescription = $metaExcerpt;
|
213 |
} else {
|
214 |
+
$pageDescription = mb_substr( strip_tags( $post->post_content ), 0, 240 ); // kill tags and trim 240 chara
|
215 |
}
|
216 |
} else {
|
217 |
+
$pageDescription = get_bloginfo( 'description' );
|
218 |
}
|
219 |
global $paged;
|
220 |
+
if ( $paged != '0' ) {
|
221 |
+
$pageDescription = '['.sprintf( __( 'Page of %s', 'vkExUnit' ),$paged ).'] '.$pageDescription;
|
222 |
}
|
223 |
$pageDescription = apply_filters( 'vkExUnit_pageDescriptionCustom', $pageDescription );
|
224 |
+
$pageDescription = esc_html( strip_tags( $pageDescription ) );
|
225 |
// Delete Line break
|
226 |
+
$pageDescription = str_replace( array( "\r\n", "\r", "\n" ), '', $pageDescription );
|
227 |
return $pageDescription;
|
228 |
}
|
229 |
|
230 |
/*-------------------------------------------*/
|
231 |
+
/* Archive title
|
232 |
/*-------------------------------------------*/
|
233 |
|
234 |
+
function vkExUnit_get_the_archive_title() {
|
235 |
+
if ( is_category() ) {
|
236 |
+
$title = single_cat_title( '', false );
|
237 |
+
} elseif ( is_tag() ) {
|
238 |
+
$title = single_tag_title( '', false );
|
239 |
+
} elseif ( is_author() ) {
|
240 |
+
$title = sprintf( __( 'Author: %s', 'vkExUnit' ), '<span class="vcard">' . get_the_author() . '</span>' );
|
241 |
+
} elseif ( is_year() ) {
|
242 |
+
$title = get_the_date( _x( 'Y', 'yearly archives date format', 'vkExUnit' ) );
|
243 |
+
} elseif ( is_month() ) {
|
244 |
+
$title = get_the_date( _x( 'F Y', 'monthly archives date format', 'vkExUnit' ) );
|
245 |
+
} elseif ( is_day() ) {
|
246 |
+
$title = get_the_date( _x( 'F j, Y', 'daily archives date format', 'vkExUnit' ) );
|
247 |
+
} elseif ( is_tax( 'post_format' ) ) {
|
248 |
+
if ( is_tax( 'post_format', 'post-format-aside' ) ) {
|
249 |
+
$title = _x( 'Asides', 'post format archive title' );
|
250 |
+
} elseif ( is_tax( 'post_format', 'post-format-gallery' ) ) {
|
251 |
+
$title = _x( 'Galleries', 'post format archive title' );
|
252 |
+
} elseif ( is_tax( 'post_format', 'post-format-image' ) ) {
|
253 |
+
$title = _x( 'Images', 'post format archive title' );
|
254 |
+
} elseif ( is_tax( 'post_format', 'post-format-video' ) ) {
|
255 |
+
$title = _x( 'Videos', 'post format archive title' );
|
256 |
+
} elseif ( is_tax( 'post_format', 'post-format-quote' ) ) {
|
257 |
+
$title = _x( 'Quotes', 'post format archive title' );
|
258 |
+
} elseif ( is_tax( 'post_format', 'post-format-link' ) ) {
|
259 |
+
$title = _x( 'Links', 'post format archive title' );
|
260 |
+
} elseif ( is_tax( 'post_format', 'post-format-status' ) ) {
|
261 |
+
$title = _x( 'Statuses', 'post format archive title' );
|
262 |
+
} elseif ( is_tax( 'post_format', 'post-format-audio' ) ) {
|
263 |
+
$title = _x( 'Audio', 'post format archive title' );
|
264 |
+
} elseif ( is_tax( 'post_format', 'post-format-chat' ) ) {
|
265 |
+
$title = _x( 'Chats', 'post format archive title' );
|
266 |
+
}
|
267 |
+
} elseif ( is_post_type_archive() ) {
|
268 |
+
$title = post_type_archive_title( '', false );
|
269 |
+
} elseif ( is_tax() ) {
|
270 |
+
$title = single_term_title( '', false );
|
271 |
+
} elseif ( is_home() && ! is_front_page() ) {
|
272 |
+
$vkExUnit_page_for_posts = vkExUnit_get_page_for_posts();
|
273 |
+
$title = $vkExUnit_page_for_posts['post_top_name'];
|
274 |
+
} else {
|
275 |
+
global $wp_query;
|
276 |
// get post type
|
277 |
$postType = $wp_query->query_vars['post_type'];
|
278 |
if ( $postType ) {
|
279 |
+
$title = get_post_type_object( $postType )->labels->name;
|
280 |
} else {
|
281 |
$title = __( 'Archives', 'vkExUnit' );
|
282 |
}
|
283 |
+
}
|
284 |
|
285 |
+
return apply_filters( 'vkExUnit_get_the_archive_title', $title );
|
286 |
}
|
287 |
|
288 |
+
function vkExUnit_is_excerpt() {
|
289 |
+
global $wp_current_filter;
|
290 |
+
if ( in_array( 'get_the_excerpt', (array) $wp_current_filter ) ) { return true; }
|
291 |
+
return false;
|
292 |
+
}
|
common_init.php
CHANGED
@@ -33,23 +33,23 @@ function vkExUnit_get_common_options_default() {
|
|
33 |
}
|
34 |
|
35 |
/*-------------------------------------------*/
|
36 |
-
/*
|
37 |
/*-------------------------------------------*/
|
38 |
|
39 |
function vkExUnit_common_options_validate( $input ) {
|
40 |
$output = $defaults = vkExUnit_get_common_options_default();
|
41 |
-
$output['active_bootstrap'] = (isset($input['active_bootstrap'])) ? true:false;
|
42 |
-
$output['active_fontawesome'] = (isset($input['active_fontawesome'])) ? true:false;
|
43 |
-
$output['active_metaDescription'] = (isset($input['active_metaDescription'])) ? true:false;
|
44 |
-
$output['active_metaKeyword'] = (isset($input['active_metaKeyword'])) ? true:false;
|
45 |
-
$output['active_icon'] = (isset($input['active_icon'])) ? true:false;
|
46 |
-
$output['active_wpTitle'] = (isset($input['active_wpTitle'])) ? true:false;
|
47 |
-
$output['active_sns'] = (isset($input['active_sns'])) ? true:false;
|
48 |
-
$output['active_ga'] = (isset($input['active_ga'])) ? true:false;
|
49 |
-
$output['active_relatedPosts'] = (isset($input['active_relatedPosts'])) ? true:false;
|
50 |
-
$output['active_otherWidgets'] = (isset($input['active_otherWidgets'])) ? true:false;
|
51 |
-
$output['active_css_customize'] = (isset($input['active_css_customize'])) ? true:false;
|
52 |
-
$output['active_call_to_action'] = (isset($input['active_call_to_action'])) ? true:false;
|
53 |
-
$output['delete_options_at_deactivate'] = (isset($input['delete_options_at_deactivate'])) ? true:false;
|
54 |
return apply_filters( 'vkExUnit_common_options_validate', $output, $input, $defaults );
|
55 |
-
}
|
33 |
}
|
34 |
|
35 |
/*-------------------------------------------*/
|
36 |
+
/* validate
|
37 |
/*-------------------------------------------*/
|
38 |
|
39 |
function vkExUnit_common_options_validate( $input ) {
|
40 |
$output = $defaults = vkExUnit_get_common_options_default();
|
41 |
+
$output['active_bootstrap'] = (isset( $input['active_bootstrap'] )) ? true:false;
|
42 |
+
$output['active_fontawesome'] = (isset( $input['active_fontawesome'] )) ? true:false;
|
43 |
+
$output['active_metaDescription'] = (isset( $input['active_metaDescription'] )) ? true:false;
|
44 |
+
$output['active_metaKeyword'] = (isset( $input['active_metaKeyword'] )) ? true:false;
|
45 |
+
$output['active_icon'] = (isset( $input['active_icon'] )) ? true:false;
|
46 |
+
$output['active_wpTitle'] = (isset( $input['active_wpTitle'] )) ? true:false;
|
47 |
+
$output['active_sns'] = (isset( $input['active_sns'] )) ? true:false;
|
48 |
+
$output['active_ga'] = (isset( $input['active_ga'] )) ? true:false;
|
49 |
+
$output['active_relatedPosts'] = (isset( $input['active_relatedPosts'] )) ? true:false;
|
50 |
+
$output['active_otherWidgets'] = (isset( $input['active_otherWidgets'] )) ? true:false;
|
51 |
+
$output['active_css_customize'] = (isset( $input['active_css_customize'] )) ? true:false;
|
52 |
+
$output['active_call_to_action'] = (isset( $input['active_call_to_action'] )) ? true:false;
|
53 |
+
$output['delete_options_at_deactivate'] = (isset( $input['delete_options_at_deactivate'] )) ? true:false;
|
54 |
return apply_filters( 'vkExUnit_common_options_validate', $output, $input, $defaults );
|
55 |
+
}
|
css/vkExUnit_style.css
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.media{border-bottom:1px solid #e5e5e5;padding:2em 0;margin-top:0}.media:first-child{border-top:1px solid #e5e5e5}.media .postList_thumbnail{width:160px;margin-bottom:0.5em;padding-right:30px;display:block;overflow:hidden;float:left}.media .postList_thumbnail a{position:relative;display:block;overflow:hidden}.media .postList_thumbnail img{width:100%;height:auto}.media .postList_thumbnail .postList_cateLabel{position:absolute;bottom:0;left:0}.media .media-body .media-heading{font-size:1.8em;line-height:1.3em;margin-top:0;margin-bottom:0.5em;font-weight:normal}.media .media-body .media-heading a{color:#464646}.media .media-body .media-heading a:hover{text-decoration:none}.media .media-body p{margin-bottom:0}.media .media-body a.media-body_excerpt{color:#464646}@media (max-width: 767px){.media .postList_thumbnail{padding-right:20px}.media .media-body .media-heading{font-size:1.2em;line-height:1.3em;margin-bottom:0.5em}}@media (max-width: 500px){.media .postList_thumbnail{width:100px}}.veu_leadTxt,p.veu_leadTxt{font-size:2em;line-height:150%;padding:0}dl.veu_qaItem{display:block;overflow:hidden;border-bottom:1px dotted #ccc;padding:0px 0px 20px;margin:0px 0px 20px;width:100%;position:relative}dl.veu_qaItem dt,dl.veu_qaItem dd{border:none;padding-left:35px}dl.veu_qaItem dt:before,dl.veu_qaItem dd:before{position:absolute;left:0;font-size:24px;line-height:105%}dl.veu_qaItem dt{margin-bottom:15px;font-size:18px}dl.veu_qaItem dt:before{font-family:"areal";content:"Q ";color:#e50000}dl.veu_qaItem dd{margin-bottom:0px}dl.veu_qaItem dd:before{content:"A ";color:#337ab7;font-family:""}.veu_flowBox{display:block;overflow:hidden}.veu_flowBox:after{font-family:FontAwesome;content:"\f0d7";font-size:50px;margin:0 auto 15px;position:relative;left:48%;line-height:120%;color:#ccc}.veu_flowBox:last-child{padding-bottom:0px;margin-bottom:30px}.veu_flowBox:last-child:after{content:"";font-size:0}.veu_flowBox dl{display:block;overflow:hidden;padding:20px 25px;border:3px solid #e5e5e5;margin:0}.veu_flowBox dl dt,.veu_flowBox dl dd{padding-left:0;border:none}.veu_flowBox dl dt{border-bottom:1px dotted #ccc;margin-bottom:10px;font-size:1.2em}.veu_flowBox dl dd{margin-bottom:0px}.veu_flowBox dl dd h4{margin:0px;padding:0px}.veu_flowBox dl dd p{margin-bottom:10px}.veu_flowBox dl dd ul{margin-bottom:0px}.veu_dummyImage{padding:20px;display:block;vertical-align:middle;text-align:center;background-color:#f5f5f5;border:1px solid #ccc;margin-bottom:15px}.veu_floatLeft{float:left;margin-right:20px}.veu_floatRight{float:right;margin-left:20px}html{font-size:inherit}.link-list li{padding:0.5em}@media (min-width: 768px){.mainSection .widget{margin-bottom:40px}}.widget .subSection-title{font-size:18px}h1.mainSection-title{font-size:24px}.veu_adminEdit{margin-top:5px}.veu_adminEdit a.btn:before{margin-right:5px;font-family:FontAwesome;content:"\f040"}.veu_contentAddSection{display:block;clear:both;overflow:hidden;padding-top:20px}.relatedPosts h2{margin-bottom:10px}.veu_autoEyeCatchBox{display:block;overflow:hidden;margin-bottom:2em}.veu_sitemap .sectionBox{padding-top:0}.veu_sitemap .sitemap-col{padding-bottom:2em}.veu_sitemap .sitemap-col{margin-top:2.5em}.veu_sitemap .sitemap-col .link-list{margin-top:0;margin-bottom:0}.veu_sitemap .sitemap-col .page_item{padding:0}.veu_sitemap .sitemap-col .children{margin-bottom:2em}.veu_sitemap .sitemap-col .cat-item{padding:0}.veu_socialSet ul{margin:0px;padding:0}.veu_socialSet ul li{position:relative;display:block;float:left;overflow:visible;margin-right:10px;padding:0px;background:none}.veu_socialSet ul li.sb_icon a{display:block;overflow:hidden;padding:3px 5px 0px;border:1px solid #ccc;border-radius:3px;background-color:#fff;color:#333;text-decoration:none;line-height:100%}.veu_socialSet ul li.sb_icon a .sns_txt{position:relative;top:-2px;font-size:11px}.veu_socialSet ul li iframe{border:none}.veu_socialSet ul li a .icon_sns{margin-right:5px;font-size:100%}.veu_socialSet ul li.sb_icon.sb_facebook .icon_sns{color:#425dab}.veu_socialSet ul li.sb_icon.sb_hatena .icon_sns{color:#2c6ebd}.veu_socialSet ul li.sb_icon.sb_twitter .icon_sns{color:#00abec}.veu_socialSet ul li.sb_icon.sb_google .icon_sns{color:#dd4b39}.veu_socialSet ul li.sb_icon.sb_line .icon_sns{color:#6ebd30}.veu_socialSet ul li.sb_pocket{margin-left:5px}.veu_count_sns_fb,.veu_count_sns_hb{display:inline-block;margin-left:5px;padding:2px 5px;border-radius:5px;line-height:1;vertical-align:top;font-size:77%;color:#ffffff}.veu_count_sns_fb{background:#425dab}.veu_count_sns_hb{background:#2c6ebd}@font-face{font-weight:normal;font-style:normal;font-family:'vk_sns';src:url("../plugins/sns/icons/fonts/vk_sns.eot?-bq20cj");src:url("../plugins/sns/icons/fonts/vk_sns.eot?#iefix-bq20cj") format("embedded-opentype"),url("../plugins/sns/icons/fonts/vk_sns.woff?-bq20cj") format("woff"),url("../plugins/sns/icons/fonts/vk_sns.ttf?-bq20cj") format("truetype"),url("../plugins/sns/icons/fonts/vk_sns.svg?-bq20cj#vk_sns") format("svg")}[class^="vk_icon_w_r_sns_"],[class*=" vk_icon_w_r_sns_"]{text-transform:none;font-weight:normal;font-style:normal;font-variant:normal;font-family:'vk_sns';line-height:1;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.vk_icon_w_r_sns_twitter:before{content:"\e600"}.vk_icon_w_r_sns_line:before{content:"\e601"}.vk_icon_w_r_sns_hatena:before{content:"\e602"}.vk_icon_w_r_sns_google:before{content:"\e603"}.vk_icon_w_r_sns_fb:before{content:"\e604"}.veu_childPage_list{margin-top:2.5em;margin-bottom:1em}.veu_childPage_list a:hover{text-decoration:none}.veu_childPage_list .childPage_list_box{display:block;margin-bottom:1em}.veu_childPage_list .childPage_list_box_inner{display:block;overflow:hidden;position:relative;border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px #fff;padding:0 20px}.veu_childPage_list .childPage_list_title{margin-top:20px;font-size:16px;line-height:1.4;color:#464646}.veu_childPage_list .wp-post-image{float:left;margin-right:1em;width:30%;border:solid 1px #ddd}.veu_childPage_list .childPage_list_body{overflow:hidden;color:#333;font-size:14px;margin-bottom:5px}.veu_childPage_list .childPage_list_body:hover{text-decoration:underline}.veu_childPage_list p{line-height:1.5em}.veu_childPage_list .childPage_list_text{overflow:hidden;margin-bottom:0}.veu_childPage_list .childPage_list_more{float:right;margin-bottom:20px}@media (max-width: 767px){.veu_childPage_list .wp-post-image{width:25%}}.veu_pageList_ancestor{margin:0 0 15px}.veu_pageList_ancestor .section_title.section_title{margin:0.5em 0}.veu_pageList_ancestor .section_title.section_title a{color:#333;font-size:23px}.veu_pageList_ancestor .pageList{display:flex;display:-ms-flexbox;display:-webkit-flex;display:flex;overflow:hidden;margin:0;padding:0;width:100%;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}.veu_pageList_ancestor .page_item{box-sizing:border-box;width:33.3%;list-style:none}.veu_pageList_ancestor .page_item a{display:block;padding:12px;color:#333;font-size:0.8em}.veu_pageList_ancestor .page_item a:hover{background-color:#F0F0F0}.veu_pageList_ancestor .current_page_item a{background-color:#F0F0F0}.veu_pageList_ancestor .children{margin:0;padding-left:20px}.veu_pageList_ancestor .children li{display:block;margin-bottom:0;width:100%}.veu_pageList_ancestor .children a{padding:5px;font-size:12px}@media screen and (max-width: 992px){.veu_pageList_ancestor .page_item{float:none;margin-bottom:0;width:100%}.veu_pageList_ancestor .children a{padding:5px}}.veu_cta{display:block;overflow:hidden;background-color:#efefef;margin-top:20px;margin-bottom:20px}.veu_cta h1.cta_title{display:block;overflow:hidden;background-color:#333;font-size:22px;color:#fff;padding:12px 20px 10px;line-height:1.2em}.veu_cta .cta_body{display:block;overflow:hidden;padding:1.5em 2em 2em;line-height:170%}.veu_cta .cta_body_image{margin-bottom:1.5em}.veu_cta .cta_body_image img{max-width:250px}.veu_cta .cta_body_image_center{display:block;overflow:hidden;text-align:center}.veu_cta .cta_body_image_center img{display:block;margin:0 auto 15px;max-width:100%}.veu_cta .cta_body_txt{display:block;overflow:hidden}.veu_cta .cta_body_link{clear:both;margin-top:1.5em}@media (max-width: 767px){.veu_cta .cta_body_image img{display:block;margin:0 auto 1.5em;max-width:100%}}@media (min-width: 768px){.veu_cta .cta_body_image_right{float:right;margin-left:30px}.veu_cta .cta_body_image_left{float:left;margin-right:30px}}.veu_contact{display:block;overflow:hidden}.veu_contact .contact_frame{display:block;overflow:hidden;padding:25px 24px 21px;border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px #fff;background-color:#f9f9f9}.veu_contact .contact_txt_catch,.veu_contact .contact_txt_tel,.veu_contact .contact_txt_time{display:block;overflow:hidden}.veu_contact .contact_txt_catch,.veu_contact .contact_txt_time{line-height:128.6%;font-size:14px}.veu_contact .contact_txt_tel{font-size:28px;line-height:110%;padding-top:4px}.veu_contact .contact_bt_txt:before{font-family:FontAwesome;content:"\f003";margin-right:7px}.veu_contact .contact_bt_txt:after{font-family:FontAwesome;content:"\f18e";margin-left:7px}.veu_contact .contact_bt_subTxt{display:block;overflow:hidden;font-size:14px}@media (max-width: 767px){.veu_contact .contact_txt{text-align:center}.veu_contact .contact_bt{display:block}}@media (min-width: 768px){.veu_contact p.contact_txt{margin-bottom:0}.veu_contact .contact_txt{float:left}.veu_contact .contact_bt{float:right}.veu_contact .contact_bt_subTxt_side{font-size:12px}.widget .veu_contact .contact_bt{margin-top:15px;float:none;display:inline-block}}.veu_insertAds{margin-top:1em;margin-bottom:1.5em}@media (max-width: 971px){.veu_insertAds{margin-bottom:0.5em}.veu_insertAds .col-md-6{margin-bottom:1em}}.veu_relatedPosts>.row{display:-ms-flexbox;display:-webkit-flex;display:flex;margin:0;margin-right:-3%;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}.veu_relatedPosts .relatedPosts_item{float:none;margin-right:2.9%;padding-right:0;padding-left:0;width:47%;border-bottom:solid 1px #e5e5e5}.veu_relatedPosts .relatedPosts_item>.media:first-child{border:none}.veu_relatedPosts .relatedPosts_item>.media{border:none}.veu_relatedPosts .relatedPosts_item:nth-child(1){border-top:solid 1px #e5e5e5}.veu_relatedPosts .relatedPosts_item:nth-child(2){border-top:solid 1px #e5e5e5}@media (max-width: 768px){.veu_relatedPosts .relatedPosts_item{display:block;width:100%}.veu_relatedPosts .relatedPosts_item:nth-child(2){border-top:none}}.veu_fbPagePlugin .fbPagePlugin_body{margin:0 auto;border:4px solid #efefef;background-color:#f9f9f9;text-align:center}.twitter-timeline iframe{margin-right:auto;margin-left:auto}.veu_newPosts h1.mainSection-title{margin-bottom:0}.veu_newPosts ul.postList{margin:15px 0 20px;padding:0}.veu_newPosts ul.postList li{display:block;overflow:hidden;border-bottom:1px dotted #666;padding:0;clear:both}.veu_newPosts ul.postList a{color:#464646}.veu_newPosts ul.postList .published,.veu_newPosts ul.postList .taxonomies a,.veu_newPosts ul.postList .entry-title{display:block;overflow:hidden;float:left}.veu_newPosts ul.postList .published{margin-right:10px;color:#d44950}.veu_newPosts ul.postList .published:before{content:'';margin:0}.veu_newPosts ul.postList .taxonomies a{background-color:#efefef;padding:2px 5px 1px;border-radius:3px;font-size:12px;margin-right:3px}.veu_newPosts ul.postList .entry-title{clear:both;display:block;margin:5px 0}.veu_newPosts .entry-meta_items.published:before{font-family:FontAwesome;content:"\f073";margin-right:5px}.veu_followSet{display:block;overflow:hidden;margin-top:20px;padding:15px;border:1px solid #f5f5f5;background-color:#efefef}.veu_followSet h3.followSet_title{padding:6px 10px 4px;border:none;background-color:#333;color:#fff;font-size:18px}.veu_followSet h3.followSet_title:after{border:none}.veu_followSet .follow_btn{float:left;margin-right:20px}.veu_profile .profile{overflow:hidden}.veu_profile .profile_media{display:block;margin:0.8em auto;max-width:100%}.veu_profile .media_round{border-radius:50%}.veu_profile .media_left .profile_media{margin-left:0}.veu_profile .media_float{float:left;padding-right:10px}.veu_profile .media_float .profile_media{margin:0.8em 0 0}.veu_profile .media_float+.profile_text{padding-top:0.8em}.veu_profile .profile_text{margin-bottom:0.5em;font-size:14px}.veu_profile .sns_btns{margin:0;padding:0;width:100%}.veu_profile .sns_btns li{float:left;margin-right:0.45em;list-style:none;text-align:center}.veu_profile .sns_btns a{display:block;display:table;width:45px;height:45px;border-radius:23px;color:#fff;text-decoration:none;font-size:20px}.veu_profile .sns_btns a:hover{color:#fff;text-decoration:none;opacity:0.8}.veu_profile .sns_btns .fa{display:table-cell;vertical-align:middle;text-align:center}.veu_profile .sns_btns .facebook_btn a{background:#3b5998}.veu_profile .sns_btns .twitter_btn a{background:#55acee}.veu_profile .sns_btns .mail_btn a{background:#2F915F}.veu_profile .sns_btns .youtube_btn a{background:#C81D1C}.veu_profile .sns_btns .rss_btn a{background:#f26522}.veu_profile .sns_btns .instagram_btn a{background:#3f729b}.veu_profile .sns_btns .linkedin_btn a{background:#0077b5}.veu_3prArea .subSection-title{font-size:18px}.veu_3prArea .media_pr{margin-top:0.8em;margin-bottom:0.8em}.veu_3prArea .media_pc{display:block}.veu_3prArea .media_sp{display:none}.veu_3prArea .summary{margin-bottom:0.5em;font-size:14px;line-height:1.4em}.veu_3prArea .linkurl a{text-decoration:none}@media screen and (max-width: 992px){.veu_3prArea .media_pc{display:none}.veu_3prArea .media_sp{display:block}.veu_3prArea .linkurl{margin-bottom:1.5em}}.veu_prBlocks{display:table;width:100%;table-layout:fixed}.veu_prBlocks .prArea{display:table-cell;padding:0 1em}.veu_prBlocks .prArea:first-child{padding-left:0}.veu_prBlocks .prArea:last-child{padding-right:0}.veu_prBlocks a{color:#333}.veu_prBlocks a:hover{color:#333;text-decoration:none}.veu_prBlocks a .summary:hover{text-decoration:underline}.veu_prBlocks .circle_icon{display:table;margin:0 auto;width:80px;height:80px;border-radius:50%}.veu_prBlocks .circle_icon .font_icon{display:table-cell;color:#fff;vertical-align:middle;text-align:center;font-size:40px}.veu_prBlocks .prBox_title{margin-top:1.5em;margin-bottom:1em;text-align:center;font-size:18px}.veu_prBlocks .media_pr{display:table;margin:0 auto}.veu_prBlocks .pr_image{display:table-cell;overflow:hidden;width:120px;height:120px;border-radius:50%;vertical-align:middle;text-align:center}.veu_prBlocks .summary{margin-bottom:0.5em;text-align:center;font-size:14px;line-height:1.4em}@media screen and (max-width: 767px){.veu_pr_blocks{display:block}.veu_pr_blocks .prArea{display:block;margin-bottom:3em}.veu_pr_blocks .prArea:first-child{padding-left:1em}.veu_pr_blocks .prArea:last-child{padding-right:1em}}
|
1 |
+
.media{border-bottom:1px solid #e5e5e5;padding:2em 0;margin-top:0}.media:first-child{border-top:1px solid #e5e5e5}.media .postList_thumbnail{width:160px;margin-bottom:0.5em;padding-right:30px;display:block;overflow:hidden;float:left}.media .postList_thumbnail a{position:relative;display:block;overflow:hidden}.media .postList_thumbnail img{width:100%;height:auto}.media .postList_thumbnail .postList_cateLabel{position:absolute;bottom:0;left:0}.media .media-body .media-heading{font-size:1.8em;line-height:1.3em;margin-top:0;margin-bottom:0.5em;font-weight:normal}.media .media-body .media-heading a{color:#464646}.media .media-body .media-heading a:hover{text-decoration:none}.media .media-body p{margin-bottom:0}.media .media-body a.media-body_excerpt{color:#464646}@media (max-width: 767px){.media .postList_thumbnail{padding-right:20px}.media .media-body .media-heading{font-size:1.2em;line-height:1.3em;margin-bottom:0.5em}}@media (max-width: 500px){.media .postList_thumbnail{width:100px}}.veu_leadTxt,p.veu_leadTxt{font-size:2em;line-height:150%;padding:0}dl.veu_qaItem{display:block;overflow:hidden;border-bottom:1px dotted #ccc;padding:0px 0px 20px;margin:0px 0px 20px;width:100%;position:relative}dl.veu_qaItem dt,dl.veu_qaItem dd{border:none;padding-left:35px}dl.veu_qaItem dt:before,dl.veu_qaItem dd:before{position:absolute;left:0;font-size:24px;line-height:105%}dl.veu_qaItem dt{margin-bottom:15px;font-size:18px}dl.veu_qaItem dt:before{font-family:"areal";content:"Q ";color:#e50000}dl.veu_qaItem dd{margin-bottom:0px}dl.veu_qaItem dd:before{content:"A ";color:#337ab7;font-family:""}.veu_flowBox{display:block;overflow:hidden}.veu_flowBox:after{font-family:FontAwesome;content:"\f0d7";font-size:50px;margin:0 auto 15px;position:relative;left:48%;line-height:120%;color:#ccc}.veu_flowBox:last-child{padding-bottom:0px;margin-bottom:30px}.veu_flowBox:last-child:after{content:"";font-size:0}.veu_flowBox dl{display:block;overflow:hidden;padding:20px 25px;border:3px solid #e5e5e5;margin:0}.veu_flowBox dl dt,.veu_flowBox dl dd{padding-left:0;border:none}.veu_flowBox dl dt{border-bottom:1px dotted #ccc;margin-bottom:10px;font-size:1.2em}.veu_flowBox dl dd{margin-bottom:0px}.veu_flowBox dl dd h4{margin:0px;padding:0px}.veu_flowBox dl dd p{margin-bottom:10px}.veu_flowBox dl dd ul{margin-bottom:0px}.veu_dummyImage{padding:20px;display:block;vertical-align:middle;text-align:center;background-color:#f5f5f5;border:1px solid #ccc;margin-bottom:15px}.veu_floatLeft{float:left;margin-right:20px}.veu_floatRight{float:right;margin-left:20px}html{font-size:inherit}.link-list li{padding:0.5em}@media (min-width: 768px){.mainSection .widget{margin-bottom:40px}}.widget .subSection-title{font-size:18px}h1.mainSection-title{font-size:24px}.veu_adminEdit{margin-top:5px}.veu_adminEdit a.btn:before{margin-right:5px;content:"\f040";font-family:FontAwesome}.veu_contentAddSection{display:block;clear:both;overflow:hidden;padding-top:20px}.relatedPosts h2{margin-bottom:10px}.veu_autoEyeCatchBox{display:block;overflow:hidden;margin-bottom:2em}.veu_sitemap .sectionBox{padding-top:0}.veu_sitemap .sitemap-col{padding-bottom:2em}.veu_sitemap .sitemap-col{margin-top:2.5em}.veu_sitemap .sitemap-col .link-list{margin-top:0;margin-bottom:0}.veu_sitemap .sitemap-col .page_item{padding:0}.veu_sitemap .sitemap-col .children{margin-bottom:2em}.veu_sitemap .sitemap-col .cat-item{padding:0}.veu_socialSet ul{margin:0px;padding:0}.veu_socialSet ul li{position:relative;display:block;float:left;overflow:visible;margin-right:10px;padding:0px;background:none}.veu_socialSet ul li.sb_icon a{display:block;overflow:hidden;padding:3px 5px 0px;border:1px solid #ccc;border-radius:3px;background-color:#fff;color:#333;text-decoration:none;line-height:100%}.veu_socialSet ul li.sb_icon a .sns_txt{position:relative;top:-2px;font-size:11px}.veu_socialSet ul li iframe{border:none}.veu_socialSet ul li a .icon_sns{margin-right:5px;font-size:100%}.veu_socialSet ul li.sb_icon.sb_facebook .icon_sns{color:#425dab}.veu_socialSet ul li.sb_icon.sb_hatena .icon_sns{color:#2c6ebd}.veu_socialSet ul li.sb_icon.sb_twitter .icon_sns{color:#00abec}.veu_socialSet ul li.sb_icon.sb_google .icon_sns{color:#dd4b39}.veu_socialSet ul li.sb_icon.sb_line .icon_sns{color:#6ebd30}.veu_socialSet ul li.sb_pocket{margin-left:5px}.veu_count_sns_fb,.veu_count_sns_hb{display:inline-block;margin-left:5px;padding:2px 5px;border-radius:5px;color:#ffffff;vertical-align:top;font-size:77%;line-height:1}.veu_count_sns_fb{background:#425dab}.veu_count_sns_hb{background:#2c6ebd}@font-face{font-weight:normal;font-style:normal;font-family:'vk_sns';src:url("../plugins/sns/icons/fonts/vk_sns.eot?-bq20cj");src:url("../plugins/sns/icons/fonts/vk_sns.eot?#iefix-bq20cj") format("embedded-opentype"),url("../plugins/sns/icons/fonts/vk_sns.woff?-bq20cj") format("woff"),url("../plugins/sns/icons/fonts/vk_sns.ttf?-bq20cj") format("truetype"),url("../plugins/sns/icons/fonts/vk_sns.svg?-bq20cj#vk_sns") format("svg")}[class^="vk_icon_w_r_sns_"],[class*=" vk_icon_w_r_sns_"]{text-transform:none;font-weight:normal;font-style:normal;font-variant:normal;font-family:'vk_sns';line-height:1;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.vk_icon_w_r_sns_twitter:before{content:"\e600"}.vk_icon_w_r_sns_line:before{content:"\e601"}.vk_icon_w_r_sns_hatena:before{content:"\e602"}.vk_icon_w_r_sns_google:before{content:"\e603"}.vk_icon_w_r_sns_fb:before{content:"\e604"}.veu_childPage_list{margin-top:2.5em;margin-bottom:1em}.veu_childPage_list a:hover{text-decoration:none}.veu_childPage_list .childPage_list_box{display:block;margin-bottom:1em}.veu_childPage_list .childPage_list_box_inner{position:relative;display:block;overflow:hidden;padding:0 20px;border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px #fff}.veu_childPage_list .childPage_list_title{margin-top:20px;color:#464646;font-size:16px;line-height:1.4}.veu_childPage_list .wp-post-image{float:left;margin-right:1em;width:30%;border:solid 1px #ddd}.veu_childPage_list .childPage_list_body{overflow:hidden;margin-bottom:5px;color:#333;font-size:14px}.veu_childPage_list .childPage_list_body:hover{text-decoration:underline}.veu_childPage_list p{line-height:1.5em}.veu_childPage_list .childPage_list_text{overflow:hidden;margin-bottom:0}.veu_childPage_list .childPage_list_more{float:right;margin-bottom:20px}@media (max-width: 767px){.veu_childPage_list .wp-post-image{width:25%}}.veu_pageList_ancestor{margin:0 0 15px;padding:0 20px;border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px #fff}.veu_pageList_ancestor .pageList{margin-top:1em;padding-left:0}.veu_pageList_ancestor .pageList a{display:block;padding:8px 5px;border-bottom:solid 1px #ddd;color:#333;font-size:0.8em}.veu_pageList_ancestor .pageList>.page_item{list-style:none}.veu_pageList_ancestor .pageList>.page_item:last-child a{border:none}.veu_pageList_ancestor .pageList .page_item{margin-bottom:0}.veu_pageList_ancestor .current_page_item>a{background-color:#F0F0F0;box-shadow:inset 0 0 5px #eee}.veu_pageList_ancestor .children{margin:0;padding-left:15px}.veu_pageList_ancestor .children .page_item{position:relative;list-style:none}.veu_pageList_ancestor .children .page_item:before{position:absolute;top:0.26em;left:5px;display:inline-block;content:"・"}.veu_pageList_ancestor .children .page_item a{padding-left:20px}.veu_pageList_ancestor .section_title.subSection-title{margin:0.5em 0}.veu_pageList_ancestor .section_title.subSection-title a{color:#333;font-size:23px}@media screen and (max-width: 992px){.page-template-default .veu_pageList_ancestor{display:none}}.veu_cta{display:block;overflow:hidden;margin-top:20px;margin-bottom:20px;background-color:#efefef}.veu_cta h1.cta_title{display:block;overflow:hidden;padding:12px 20px 10px;background-color:#333;color:#fff;font-size:22px;line-height:1.2em}.veu_cta .cta_body{display:block;overflow:hidden;padding:1.5em 2em 2em;line-height:170%}.veu_cta .cta_body_image{margin-bottom:1.5em}.veu_cta .cta_body_image img{max-width:250px}.veu_cta .cta_body_image_center{display:block;overflow:hidden;text-align:center}.veu_cta .cta_body_image_center img{display:block;margin:0 auto 15px;max-width:100%}.veu_cta .cta_body_txt{display:block;overflow:hidden}.veu_cta .cta_body_link{clear:both;margin-top:1.5em}@media (max-width: 767px){.veu_cta .cta_body_image img{display:block;margin:0 auto 1.5em;max-width:100%}}@media (min-width: 768px){.veu_cta .cta_body_image_right{float:right;margin-left:30px}.veu_cta .cta_body_image_left{float:left;margin-right:30px}}.veu_contact{display:block;overflow:hidden}.veu_contact .contact_frame{display:block;overflow:hidden;padding:25px 24px 21px;border:3px solid #efefef;background-color:#f9f9f9;box-shadow:inset 0px 0px 0px 1px #fff}.veu_contact .contact_txt_catch,.veu_contact .contact_txt_tel,.veu_contact .contact_txt_time{display:block;overflow:hidden}.veu_contact .contact_txt_catch,.veu_contact .contact_txt_time{font-size:14px;line-height:128.6%}.veu_contact .contact_txt_tel{padding-top:4px;font-size:28px;line-height:110%}.veu_contact .contact_bt_txt:before{margin-right:7px;content:"\f003";font-family:FontAwesome}.veu_contact .contact_bt_txt:after{margin-left:7px;content:"\f18e";font-family:FontAwesome}.veu_contact .contact_bt_subTxt{display:block;overflow:hidden;font-size:14px}@media (max-width: 767px){.veu_contact .contact_txt{text-align:center}.veu_contact .contact_bt{display:block}}@media (min-width: 768px){.veu_contact p.contact_txt{margin-bottom:0}.veu_contact .contact_txt{float:left}.veu_contact .contact_bt{float:right}.veu_contact .contact_bt_subTxt_side{font-size:12px}.widget .veu_contact .contact_bt{display:inline-block;float:none;margin-top:15px}}.veu_insertAds{margin-top:1em;margin-bottom:1.5em}@media (max-width: 971px){.veu_insertAds{margin-bottom:0.5em}.veu_insertAds .col-md-6{margin-bottom:1em}}.veu_relatedPosts>.row{display:-ms-flexbox;display:-webkit-flex;display:flex;margin:0;margin-right:-3%;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}.veu_relatedPosts .relatedPosts_item{float:none;margin-right:2.9%;padding-right:0;padding-left:0;width:47%;border-bottom:solid 1px #e5e5e5}.veu_relatedPosts .relatedPosts_item>.media:first-child{border:none}.veu_relatedPosts .relatedPosts_item>.media{border:none}.veu_relatedPosts .relatedPosts_item:nth-child(1){border-top:solid 1px #e5e5e5}.veu_relatedPosts .relatedPosts_item:nth-child(2){border-top:solid 1px #e5e5e5}@media (max-width: 768px){.veu_relatedPosts .relatedPosts_item{display:block;width:100%}.veu_relatedPosts .relatedPosts_item:nth-child(2){border-top:none}}.veu_fbPagePlugin .fbPagePlugin_body{margin:0 auto;border:4px solid #efefef;background-color:#f9f9f9;text-align:center}.twitter-timeline iframe{margin-right:auto;margin-left:auto}.veu_newPosts h1.mainSection-title{margin-bottom:0}.veu_newPosts ul.postList{margin:15px 0 20px;padding:0}.veu_newPosts ul.postList li{display:block;clear:both;overflow:hidden;padding:0;border-bottom:1px dotted #666}.veu_newPosts ul.postList a{color:#464646}.veu_newPosts ul.postList .published,.veu_newPosts ul.postList .taxonomies a,.veu_newPosts ul.postList .entry-title{display:block;float:left;overflow:hidden}.veu_newPosts ul.postList .published{margin-right:10px;color:#d44950}.veu_newPosts ul.postList .published:before{margin:0;content:''}.veu_newPosts ul.postList .taxonomies a{margin-right:3px;padding:2px 5px 1px;border-radius:3px;background-color:#efefef;font-size:12px}.veu_newPosts ul.postList .entry-title{display:block;clear:both;margin:5px 0}.veu_newPosts .entry-meta_items.published:before{margin-right:5px;content:"\f073";font-family:FontAwesome}.veu_followSet{display:block;overflow:hidden;margin-top:20px;padding:15px;border:1px solid #f5f5f5;background-color:#efefef}.veu_followSet h3.followSet_title{padding:6px 10px 4px;border:none;background-color:#333;color:#fff;font-size:18px}.veu_followSet h3.followSet_title:after{border:none}.veu_followSet .follow_btn{float:left;margin-right:20px}.veu_profile .profile{overflow:hidden}.veu_profile .profile_media{display:block;margin:0.8em auto;max-width:100%}.veu_profile .media_round{border-radius:50%}.veu_profile .media_left .profile_media{margin-left:0}.veu_profile .media_float{float:left;padding-right:10px}.veu_profile .media_float .profile_media{margin:0.8em 0 0}.veu_profile .media_float+.profile_text{padding-top:0.8em}.veu_profile .profile_text{margin-bottom:0.5em;font-size:14px}.veu_profile .sns_btns{margin:0;padding:0;width:100%}.veu_profile .sns_btns li{float:left;margin-right:0.45em;list-style:none;text-align:center}.veu_profile .sns_btns a{display:block;display:table;width:45px;height:45px;border-radius:23px;color:#fff;text-decoration:none;font-size:20px}.veu_profile .sns_btns a:hover{color:#fff;text-decoration:none;opacity:0.8}.veu_profile .sns_btns .fa{display:table-cell;vertical-align:middle;text-align:center}.veu_profile .sns_btns .facebook_btn a{background:#3b5998}.veu_profile .sns_btns .twitter_btn a{background:#55acee}.veu_profile .sns_btns .mail_btn a{background:#2F915F}.veu_profile .sns_btns .youtube_btn a{background:#C81D1C}.veu_profile .sns_btns .rss_btn a{background:#f26522}.veu_profile .sns_btns .instagram_btn a{background:#3f729b}.veu_profile .sns_btns .linkedin_btn a{background:#0077b5}.veu_3prArea .subSection-title{font-size:18px}.veu_3prArea .media_pr{margin-top:0.8em;margin-bottom:0.8em}.veu_3prArea .media_pc{display:block}.veu_3prArea .media_sp{display:none}.veu_3prArea .summary{margin-bottom:0.5em;font-size:14px;line-height:1.4em}.veu_3prArea .linkurl a{text-decoration:none}@media screen and (max-width: 992px){.veu_3prArea .media_pc{display:none}.veu_3prArea .media_sp{display:block}.veu_3prArea .linkurl{margin-bottom:1.5em}}.veu_prBlocks{display:table;width:100%;table-layout:fixed}.veu_prBlocks .prArea{display:table-cell;padding:0 1em}.veu_prBlocks .prArea:first-child{padding-left:0}.veu_prBlocks .prArea:last-child{padding-right:0}.veu_prBlocks a{color:#333}.veu_prBlocks a:hover{color:#333;text-decoration:none}.veu_prBlocks a .summary:hover{text-decoration:underline}.veu_prBlocks .circle_icon{display:table;margin:0 auto;width:80px;height:80px;border-radius:50%}.veu_prBlocks .circle_icon .font_icon{display:table-cell;color:#fff;vertical-align:middle;text-align:center;font-size:40px}.veu_prBlocks .prBox_title{margin-top:1.5em;margin-bottom:1em;text-align:center;font-size:18px}.veu_prBlocks .media_pr{display:table;margin:0 auto}.veu_prBlocks .pr_image{display:table-cell;overflow:hidden;width:120px;height:120px;border-radius:50%;vertical-align:middle;text-align:center}.veu_prBlocks .summary{margin-bottom:0.5em;text-align:center;font-size:14px;line-height:1.4em}@media screen and (max-width: 767px){.veu_pr_blocks{display:block}.veu_pr_blocks .prArea{display:block;margin-bottom:3em}.veu_pr_blocks .prArea:first-child{padding-left:1em}.veu_pr_blocks .prArea:last-child{padding-right:1em}}
|
css/vkExUnit_style_in_bs.css
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
/*!
|
2 |
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
3 |
* Copyright 2011-2015 Twitter, Inc.
|
4 |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
@@ -9,4 +9,4 @@
|
|
9 |
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
10 |
* Copyright 2011-2015 Twitter, Inc.
|
11 |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
12 |
-
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:hover,a:focus{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width: 768px){.container{width:750px}}@media (min-width: 992px){.container{width:970px}}@media (min-width: 1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width: 768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width: 992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width: 1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:focus,.btn-default.focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary:focus,.btn-primary.focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:focus,.btn-success.focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#fff;background-color:#398439;border-color:#255625}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:focus,.btn-info.focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:focus,.btn-warning.focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:focus,.btn-danger.focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#337ab7;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.clearfix:before,.clearfix:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after{content:" ";display:table}.clearfix:after,.container:after,.container-fluid:after,.row:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}.media{border-bottom:1px solid #e5e5e5;padding:2em 0;margin-top:0}.media:first-child{border-top:1px solid #e5e5e5}.media .postList_thumbnail{width:160px;margin-bottom:0.5em;padding-right:30px;display:block;overflow:hidden;float:left}.media .postList_thumbnail a{position:relative;display:block;overflow:hidden}.media .postList_thumbnail img{width:100%;height:auto}.media .postList_thumbnail .postList_cateLabel{position:absolute;bottom:0;left:0}.media .media-body .media-heading{font-size:1.8em;line-height:1.3em;margin-top:0;margin-bottom:0.5em;font-weight:normal}.media .media-body .media-heading a{color:#464646}.media .media-body .media-heading a:hover{text-decoration:none}.media .media-body p{margin-bottom:0}.media .media-body a.media-body_excerpt{color:#464646}@media (max-width: 767px){.media .postList_thumbnail{padding-right:20px}.media .media-body .media-heading{font-size:1.2em;line-height:1.3em;margin-bottom:0.5em}}@media (max-width: 500px){.media .postList_thumbnail{width:100px}}.veu_leadTxt,p.veu_leadTxt{font-size:2em;line-height:150%;padding:0}dl.veu_qaItem{display:block;overflow:hidden;border-bottom:1px dotted #ccc;padding:0px 0px 20px;margin:0px 0px 20px;width:100%;position:relative}dl.veu_qaItem dt,dl.veu_qaItem dd{border:none;padding-left:35px}dl.veu_qaItem dt:before,dl.veu_qaItem dd:before{position:absolute;left:0;font-size:24px;line-height:105%}dl.veu_qaItem dt{margin-bottom:15px;font-size:18px}dl.veu_qaItem dt:before{font-family:"areal";content:"Q ";color:#e50000}dl.veu_qaItem dd{margin-bottom:0px}dl.veu_qaItem dd:before{content:"A ";color:#337ab7;font-family:""}.veu_flowBox{display:block;overflow:hidden}.veu_flowBox:after{font-family:FontAwesome;content:"\f0d7";font-size:50px;margin:0 auto 15px;position:relative;left:48%;line-height:120%;color:#ccc}.veu_flowBox:last-child{padding-bottom:0px;margin-bottom:30px}.veu_flowBox:last-child:after{content:"";font-size:0}.veu_flowBox dl{display:block;overflow:hidden;padding:20px 25px;border:3px solid #e5e5e5;margin:0}.veu_flowBox dl dt,.veu_flowBox dl dd{padding-left:0;border:none}.veu_flowBox dl dt{border-bottom:1px dotted #ccc;margin-bottom:10px;font-size:1.2em}.veu_flowBox dl dd{margin-bottom:0px}.veu_flowBox dl dd h4{margin:0px;padding:0px}.veu_flowBox dl dd p{margin-bottom:10px}.veu_flowBox dl dd ul{margin-bottom:0px}.veu_dummyImage{padding:20px;display:block;vertical-align:middle;text-align:center;background-color:#f5f5f5;border:1px solid #ccc;margin-bottom:15px}.veu_floatLeft{float:left;margin-right:20px}.veu_floatRight{float:right;margin-left:20px}html{font-size:inherit}.link-list li{padding:0.5em}@media (min-width: 768px){.mainSection .widget{margin-bottom:40px}}.widget .subSection-title{font-size:18px}h1.mainSection-title{font-size:24px}.veu_adminEdit{margin-top:5px}.veu_adminEdit a.btn:before{margin-right:5px;font-family:FontAwesome;content:"\f040"}.veu_contentAddSection{display:block;clear:both;overflow:hidden;padding-top:20px}.relatedPosts h2{margin-bottom:10px}.veu_autoEyeCatchBox{display:block;overflow:hidden;margin-bottom:2em}.veu_sitemap .sectionBox{padding-top:0}.veu_sitemap .sitemap-col{padding-bottom:2em}.veu_sitemap .sitemap-col{margin-top:2.5em}.veu_sitemap .sitemap-col .link-list{margin-top:0;margin-bottom:0}.veu_sitemap .sitemap-col .page_item{padding:0}.veu_sitemap .sitemap-col .children{margin-bottom:2em}.veu_sitemap .sitemap-col .cat-item{padding:0}.veu_socialSet ul{margin:0px;padding:0}.veu_socialSet ul li{position:relative;display:block;float:left;overflow:visible;margin-right:10px;padding:0px;background:none}.veu_socialSet ul li.sb_icon a{display:block;overflow:hidden;padding:3px 5px 0px;border:1px solid #ccc;border-radius:3px;background-color:#fff;color:#333;text-decoration:none;line-height:100%}.veu_socialSet ul li.sb_icon a .sns_txt{position:relative;top:-2px;font-size:11px}.veu_socialSet ul li iframe{border:none}.veu_socialSet ul li a .icon_sns{margin-right:5px;font-size:100%}.veu_socialSet ul li.sb_icon.sb_facebook .icon_sns{color:#425dab}.veu_socialSet ul li.sb_icon.sb_hatena .icon_sns{color:#2c6ebd}.veu_socialSet ul li.sb_icon.sb_twitter .icon_sns{color:#00abec}.veu_socialSet ul li.sb_icon.sb_google .icon_sns{color:#dd4b39}.veu_socialSet ul li.sb_icon.sb_line .icon_sns{color:#6ebd30}.veu_socialSet ul li.sb_pocket{margin-left:5px}.veu_count_sns_fb,.veu_count_sns_hb{display:inline-block;margin-left:5px;padding:2px 5px;border-radius:5px;line-height:1;vertical-align:top;font-size:77%;color:#ffffff}.veu_count_sns_fb{background:#425dab}.veu_count_sns_hb{background:#2c6ebd}@font-face{font-weight:normal;font-style:normal;font-family:'vk_sns';src:url("../plugins/sns/icons/fonts/vk_sns.eot?-bq20cj");src:url("../plugins/sns/icons/fonts/vk_sns.eot?#iefix-bq20cj") format("embedded-opentype"),url("../plugins/sns/icons/fonts/vk_sns.woff?-bq20cj") format("woff"),url("../plugins/sns/icons/fonts/vk_sns.ttf?-bq20cj") format("truetype"),url("../plugins/sns/icons/fonts/vk_sns.svg?-bq20cj#vk_sns") format("svg")}[class^="vk_icon_w_r_sns_"],[class*=" vk_icon_w_r_sns_"]{text-transform:none;font-weight:normal;font-style:normal;font-variant:normal;font-family:'vk_sns';line-height:1;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.vk_icon_w_r_sns_twitter:before{content:"\e600"}.vk_icon_w_r_sns_line:before{content:"\e601"}.vk_icon_w_r_sns_hatena:before{content:"\e602"}.vk_icon_w_r_sns_google:before{content:"\e603"}.vk_icon_w_r_sns_fb:before{content:"\e604"}.veu_childPage_list{margin-top:2.5em;margin-bottom:1em}.veu_childPage_list a:hover{text-decoration:none}.veu_childPage_list .childPage_list_box{display:block;margin-bottom:1em}.veu_childPage_list .childPage_list_box_inner{display:block;overflow:hidden;position:relative;border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px #fff;padding:0 20px}.veu_childPage_list .childPage_list_title{margin-top:20px;font-size:16px;line-height:1.4;color:#464646}.veu_childPage_list .wp-post-image{float:left;margin-right:1em;width:30%;border:solid 1px #ddd}.veu_childPage_list .childPage_list_body{overflow:hidden;color:#333;font-size:14px;margin-bottom:5px}.veu_childPage_list .childPage_list_body:hover{text-decoration:underline}.veu_childPage_list p{line-height:1.5em}.veu_childPage_list .childPage_list_text{overflow:hidden;margin-bottom:0}.veu_childPage_list .childPage_list_more{float:right;margin-bottom:20px}@media (max-width: 767px){.veu_childPage_list .wp-post-image{width:25%}}.veu_pageList_ancestor{margin:0 0 15px}.veu_pageList_ancestor .section_title.section_title{margin:0.5em 0}.veu_pageList_ancestor .section_title.section_title a{color:#333;font-size:23px}.veu_pageList_ancestor .pageList{display:flex;display:-ms-flexbox;display:-webkit-flex;display:flex;overflow:hidden;margin:0;padding:0;width:100%;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}.veu_pageList_ancestor .page_item{box-sizing:border-box;width:33.3%;list-style:none}.veu_pageList_ancestor .page_item a{display:block;padding:12px;color:#333;font-size:0.8em}.veu_pageList_ancestor .page_item a:hover{background-color:#F0F0F0}.veu_pageList_ancestor .current_page_item a{background-color:#F0F0F0}.veu_pageList_ancestor .children{margin:0;padding-left:20px}.veu_pageList_ancestor .children li{display:block;margin-bottom:0;width:100%}.veu_pageList_ancestor .children a{padding:5px;font-size:12px}@media screen and (max-width: 992px){.veu_pageList_ancestor .page_item{float:none;margin-bottom:0;width:100%}.veu_pageList_ancestor .children a{padding:5px}}.veu_cta{display:block;overflow:hidden;background-color:#efefef;margin-top:20px;margin-bottom:20px}.veu_cta h1.cta_title{display:block;overflow:hidden;background-color:#333;font-size:22px;color:#fff;padding:12px 20px 10px;line-height:1.2em}.veu_cta .cta_body{display:block;overflow:hidden;padding:1.5em 2em 2em;line-height:170%}.veu_cta .cta_body_image{margin-bottom:1.5em}.veu_cta .cta_body_image img{max-width:250px}.veu_cta .cta_body_image_center{display:block;overflow:hidden;text-align:center}.veu_cta .cta_body_image_center img{display:block;margin:0 auto 15px;max-width:100%}.veu_cta .cta_body_txt{display:block;overflow:hidden}.veu_cta .cta_body_link{clear:both;margin-top:1.5em}@media (max-width: 767px){.veu_cta .cta_body_image img{display:block;margin:0 auto 1.5em;max-width:100%}}@media (min-width: 768px){.veu_cta .cta_body_image_right{float:right;margin-left:30px}.veu_cta .cta_body_image_left{float:left;margin-right:30px}}.veu_contact{display:block;overflow:hidden}.veu_contact .contact_frame{display:block;overflow:hidden;padding:25px 24px 21px;border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px #fff;background-color:#f9f9f9}.veu_contact .contact_txt_catch,.veu_contact .contact_txt_tel,.veu_contact .contact_txt_time{display:block;overflow:hidden}.veu_contact .contact_txt_catch,.veu_contact .contact_txt_time{line-height:128.6%;font-size:14px}.veu_contact .contact_txt_tel{font-size:28px;line-height:110%;padding-top:4px}.veu_contact .contact_bt_txt:before{font-family:FontAwesome;content:"\f003";margin-right:7px}.veu_contact .contact_bt_txt:after{font-family:FontAwesome;content:"\f18e";margin-left:7px}.veu_contact .contact_bt_subTxt{display:block;overflow:hidden;font-size:14px}@media (max-width: 767px){.veu_contact .contact_txt{text-align:center}.veu_contact .contact_bt{display:block}}@media (min-width: 768px){.veu_contact p.contact_txt{margin-bottom:0}.veu_contact .contact_txt{float:left}.veu_contact .contact_bt{float:right}.veu_contact .contact_bt_subTxt_side{font-size:12px}.widget .veu_contact .contact_bt{margin-top:15px;float:none;display:inline-block}}.veu_insertAds{margin-top:1em;margin-bottom:1.5em}@media (max-width: 971px){.veu_insertAds{margin-bottom:0.5em}.veu_insertAds .col-md-6{margin-bottom:1em}}.veu_relatedPosts>.row{display:-ms-flexbox;display:-webkit-flex;display:flex;margin:0;margin-right:-3%;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}.veu_relatedPosts .relatedPosts_item{float:none;margin-right:2.9%;padding-right:0;padding-left:0;width:47%;border-bottom:solid 1px #e5e5e5}.veu_relatedPosts .relatedPosts_item>.media:first-child{border:none}.veu_relatedPosts .relatedPosts_item>.media{border:none}.veu_relatedPosts .relatedPosts_item:nth-child(1){border-top:solid 1px #e5e5e5}.veu_relatedPosts .relatedPosts_item:nth-child(2){border-top:solid 1px #e5e5e5}@media (max-width: 768px){.veu_relatedPosts .relatedPosts_item{display:block;width:100%}.veu_relatedPosts .relatedPosts_item:nth-child(2){border-top:none}}.veu_fbPagePlugin .fbPagePlugin_body{margin:0 auto;border:4px solid #efefef;background-color:#f9f9f9;text-align:center}.twitter-timeline iframe{margin-right:auto;margin-left:auto}.veu_newPosts h1.mainSection-title{margin-bottom:0}.veu_newPosts ul.postList{margin:15px 0 20px;padding:0}.veu_newPosts ul.postList li{display:block;overflow:hidden;border-bottom:1px dotted #666;padding:0;clear:both}.veu_newPosts ul.postList a{color:#464646}.veu_newPosts ul.postList .published,.veu_newPosts ul.postList .taxonomies a,.veu_newPosts ul.postList .entry-title{display:block;overflow:hidden;float:left}.veu_newPosts ul.postList .published{margin-right:10px;color:#d44950}.veu_newPosts ul.postList .published:before{content:'';margin:0}.veu_newPosts ul.postList .taxonomies a{background-color:#efefef;padding:2px 5px 1px;border-radius:3px;font-size:12px;margin-right:3px}.veu_newPosts ul.postList .entry-title{clear:both;display:block;margin:5px 0}.veu_newPosts .entry-meta_items.published:before{font-family:FontAwesome;content:"\f073";margin-right:5px}.veu_followSet{display:block;overflow:hidden;margin-top:20px;padding:15px;border:1px solid #f5f5f5;background-color:#efefef}.veu_followSet h3.followSet_title{padding:6px 10px 4px;border:none;background-color:#333;color:#fff;font-size:18px}.veu_followSet h3.followSet_title:after{border:none}.veu_followSet .follow_btn{float:left;margin-right:20px}.veu_profile .profile{overflow:hidden}.veu_profile .profile_media{display:block;margin:0.8em auto;max-width:100%}.veu_profile .media_round{border-radius:50%}.veu_profile .media_left .profile_media{margin-left:0}.veu_profile .media_float{float:left;padding-right:10px}.veu_profile .media_float .profile_media{margin:0.8em 0 0}.veu_profile .media_float+.profile_text{padding-top:0.8em}.veu_profile .profile_text{margin-bottom:0.5em;font-size:14px}.veu_profile .sns_btns{margin:0;padding:0;width:100%}.veu_profile .sns_btns li{float:left;margin-right:0.45em;list-style:none;text-align:center}.veu_profile .sns_btns a{display:block;display:table;width:45px;height:45px;border-radius:23px;color:#fff;text-decoration:none;font-size:20px}.veu_profile .sns_btns a:hover{color:#fff;text-decoration:none;opacity:0.8}.veu_profile .sns_btns .fa{display:table-cell;vertical-align:middle;text-align:center}.veu_profile .sns_btns .facebook_btn a{background:#3b5998}.veu_profile .sns_btns .twitter_btn a{background:#55acee}.veu_profile .sns_btns .mail_btn a{background:#2F915F}.veu_profile .sns_btns .youtube_btn a{background:#C81D1C}.veu_profile .sns_btns .rss_btn a{background:#f26522}.veu_profile .sns_btns .instagram_btn a{background:#3f729b}.veu_profile .sns_btns .linkedin_btn a{background:#0077b5}.veu_3prArea .subSection-title{font-size:18px}.veu_3prArea .media_pr{margin-top:0.8em;margin-bottom:0.8em}.veu_3prArea .media_pc{display:block}.veu_3prArea .media_sp{display:none}.veu_3prArea .summary{margin-bottom:0.5em;font-size:14px;line-height:1.4em}.veu_3prArea .linkurl a{text-decoration:none}@media screen and (max-width: 992px){.veu_3prArea .media_pc{display:none}.veu_3prArea .media_sp{display:block}.veu_3prArea .linkurl{margin-bottom:1.5em}}.veu_prBlocks{display:table;width:100%;table-layout:fixed}.veu_prBlocks .prArea{display:table-cell;padding:0 1em}.veu_prBlocks .prArea:first-child{padding-left:0}.veu_prBlocks .prArea:last-child{padding-right:0}.veu_prBlocks a{color:#333}.veu_prBlocks a:hover{color:#333;text-decoration:none}.veu_prBlocks a .summary:hover{text-decoration:underline}.veu_prBlocks .circle_icon{display:table;margin:0 auto;width:80px;height:80px;border-radius:50%}.veu_prBlocks .circle_icon .font_icon{display:table-cell;color:#fff;vertical-align:middle;text-align:center;font-size:40px}.veu_prBlocks .prBox_title{margin-top:1.5em;margin-bottom:1em;text-align:center;font-size:18px}.veu_prBlocks .media_pr{display:table;margin:0 auto}.veu_prBlocks .pr_image{display:table-cell;overflow:hidden;width:120px;height:120px;border-radius:50%;vertical-align:middle;text-align:center}.veu_prBlocks .summary{margin-bottom:0.5em;text-align:center;font-size:14px;line-height:1.4em}@media screen and (max-width: 767px){.veu_pr_blocks{display:block}.veu_pr_blocks .prArea{display:block;margin-bottom:3em}.veu_pr_blocks .prArea:first-child{padding-left:1em}.veu_pr_blocks .prArea:last-child{padding-right:1em}}
|
1 |
+
/*!
|
2 |
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
3 |
* Copyright 2011-2015 Twitter, Inc.
|
4 |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
9 |
* Bootstrap v3.3.5 (http://getbootstrap.com)
|
10 |
* Copyright 2011-2015 Twitter, Inc.
|
11 |
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
|
12 |
+
*//*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}*:before,*:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:transparent}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#337ab7;text-decoration:none}a:hover,a:focus{color:#23527c;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive{display:block;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out;display:inline-block;max-width:100%;height:auto}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0, 0, 0, 0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}[role="button"]{cursor:pointer}.container{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}@media (min-width: 768px){.container{width:750px}}@media (min-width: 992px){.container{width:970px}}@media (min-width: 1200px){.container{width:1170px}}.container-fluid{margin-right:auto;margin-left:auto;padding-left:15px;padding-right:15px}.row{margin-left:-15px;margin-right:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-left:15px;padding-right:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width: 768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width: 992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width: 1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}.btn{display:inline-block;margin-bottom:0;font-weight:normal;text-align:center;vertical-align:middle;-ms-touch-action:manipulation;touch-action:manipulation;cursor:pointer;background-image:none;border:1px solid transparent;white-space:nowrap;padding:6px 12px;font-size:14px;line-height:1.42857143;border-radius:4px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.btn:focus,.btn:active:focus,.btn.active:focus,.btn.focus,.btn:active.focus,.btn.active.focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus,.btn.focus{color:#333;text-decoration:none}.btn:active,.btn.active{outline:0;background-image:none;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,0.125);box-shadow:inset 0 3px 5px rgba(0,0,0,0.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{cursor:not-allowed;opacity:.65;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none}a.btn.disabled,fieldset[disabled] a.btn{pointer-events:none}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:focus,.btn-default.focus{color:#333;background-color:#e6e6e6;border-color:#8c8c8c}.btn-default:hover{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active:hover,.btn-default.active:hover,.open>.dropdown-toggle.btn-default:hover,.btn-default:active:focus,.btn-default.active:focus,.open>.dropdown-toggle.btn-default:focus,.btn-default:active.focus,.btn-default.active.focus,.open>.dropdown-toggle.btn-default.focus{color:#333;background-color:#d4d4d4;border-color:#8c8c8c}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled.focus,.btn-default[disabled].focus,fieldset[disabled] .btn-default.focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#337ab7;border-color:#2e6da4}.btn-primary:focus,.btn-primary.focus{color:#fff;background-color:#286090;border-color:#122b40}.btn-primary:hover{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#286090;border-color:#204d74}.btn-primary:active:hover,.btn-primary.active:hover,.open>.dropdown-toggle.btn-primary:hover,.btn-primary:active:focus,.btn-primary.active:focus,.open>.dropdown-toggle.btn-primary:focus,.btn-primary:active.focus,.btn-primary.active.focus,.open>.dropdown-toggle.btn-primary.focus{color:#fff;background-color:#204d74;border-color:#122b40}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled.focus,.btn-primary[disabled].focus,fieldset[disabled] .btn-primary.focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#337ab7;border-color:#2e6da4}.btn-primary .badge{color:#337ab7;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:focus,.btn-success.focus{color:#fff;background-color:#449d44;border-color:#255625}.btn-success:hover{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active:hover,.btn-success.active:hover,.open>.dropdown-toggle.btn-success:hover,.btn-success:active:focus,.btn-success.active:focus,.open>.dropdown-toggle.btn-success:focus,.btn-success:active.focus,.btn-success.active.focus,.open>.dropdown-toggle.btn-success.focus{color:#fff;background-color:#398439;border-color:#255625}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled.focus,.btn-success[disabled].focus,fieldset[disabled] .btn-success.focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:focus,.btn-info.focus{color:#fff;background-color:#31b0d5;border-color:#1b6d85}.btn-info:hover{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active:hover,.btn-info.active:hover,.open>.dropdown-toggle.btn-info:hover,.btn-info:active:focus,.btn-info.active:focus,.open>.dropdown-toggle.btn-info:focus,.btn-info:active.focus,.btn-info.active.focus,.open>.dropdown-toggle.btn-info.focus{color:#fff;background-color:#269abc;border-color:#1b6d85}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled.focus,.btn-info[disabled].focus,fieldset[disabled] .btn-info.focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:focus,.btn-warning.focus{color:#fff;background-color:#ec971f;border-color:#985f0d}.btn-warning:hover{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active:hover,.btn-warning.active:hover,.open>.dropdown-toggle.btn-warning:hover,.btn-warning:active:focus,.btn-warning.active:focus,.open>.dropdown-toggle.btn-warning:focus,.btn-warning:active.focus,.btn-warning.active.focus,.open>.dropdown-toggle.btn-warning.focus{color:#fff;background-color:#d58512;border-color:#985f0d}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled.focus,.btn-warning[disabled].focus,fieldset[disabled] .btn-warning.focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:focus,.btn-danger.focus{color:#fff;background-color:#c9302c;border-color:#761c19}.btn-danger:hover{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active:hover,.btn-danger.active:hover,.open>.dropdown-toggle.btn-danger:hover,.btn-danger:active:focus,.btn-danger.active:focus,.open>.dropdown-toggle.btn-danger:focus,.btn-danger:active.focus,.btn-danger.active.focus,.open>.dropdown-toggle.btn-danger.focus{color:#fff;background-color:#ac2925;border-color:#761c19}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled.focus,.btn-danger[disabled].focus,fieldset[disabled] .btn-danger.focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{color:#337ab7;font-weight:normal;border-radius:0}.btn-link,.btn-link:active,.btn-link.active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#23527c;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg{padding:10px 16px;font-size:18px;line-height:1.3333333;border-radius:6px}.btn-sm{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type="submit"].btn-block,input[type="reset"].btn-block,input[type="button"].btn-block{width:100%}.media{margin-top:15px}.media:first-child{margin-top:0}.media,.media-body{zoom:1;overflow:hidden}.media-body{width:10000px}.media-object{display:block}.media-object.img-thumbnail{max-width:none}.media-right,.media>.pull-right{padding-left:10px}.media-left,.media>.pull-left{padding-right:10px}.media-left,.media-right,.media-body{display:table-cell;vertical-align:top}.media-middle{vertical-align:middle}.media-bottom{vertical-align:bottom}.media-heading{margin-top:0;margin-bottom:5px}.media-list{padding-left:0;list-style:none}.clearfix:before,.clearfix:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after{content:" ";display:table}.clearfix:after,.container:after,.container-fluid:after,.row:after{clear:both}.center-block{display:block;margin-left:auto;margin-right:auto}.pull-right{float:right !important}.pull-left{float:left !important}.hide{display:none !important}.show{display:block !important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none !important}.affix{position:fixed}.media{border-bottom:1px solid #e5e5e5;padding:2em 0;margin-top:0}.media:first-child{border-top:1px solid #e5e5e5}.media .postList_thumbnail{width:160px;margin-bottom:0.5em;padding-right:30px;display:block;overflow:hidden;float:left}.media .postList_thumbnail a{position:relative;display:block;overflow:hidden}.media .postList_thumbnail img{width:100%;height:auto}.media .postList_thumbnail .postList_cateLabel{position:absolute;bottom:0;left:0}.media .media-body .media-heading{font-size:1.8em;line-height:1.3em;margin-top:0;margin-bottom:0.5em;font-weight:normal}.media .media-body .media-heading a{color:#464646}.media .media-body .media-heading a:hover{text-decoration:none}.media .media-body p{margin-bottom:0}.media .media-body a.media-body_excerpt{color:#464646}@media (max-width: 767px){.media .postList_thumbnail{padding-right:20px}.media .media-body .media-heading{font-size:1.2em;line-height:1.3em;margin-bottom:0.5em}}@media (max-width: 500px){.media .postList_thumbnail{width:100px}}.veu_leadTxt,p.veu_leadTxt{font-size:2em;line-height:150%;padding:0}dl.veu_qaItem{display:block;overflow:hidden;border-bottom:1px dotted #ccc;padding:0px 0px 20px;margin:0px 0px 20px;width:100%;position:relative}dl.veu_qaItem dt,dl.veu_qaItem dd{border:none;padding-left:35px}dl.veu_qaItem dt:before,dl.veu_qaItem dd:before{position:absolute;left:0;font-size:24px;line-height:105%}dl.veu_qaItem dt{margin-bottom:15px;font-size:18px}dl.veu_qaItem dt:before{font-family:"areal";content:"Q ";color:#e50000}dl.veu_qaItem dd{margin-bottom:0px}dl.veu_qaItem dd:before{content:"A ";color:#337ab7;font-family:""}.veu_flowBox{display:block;overflow:hidden}.veu_flowBox:after{font-family:FontAwesome;content:"\f0d7";font-size:50px;margin:0 auto 15px;position:relative;left:48%;line-height:120%;color:#ccc}.veu_flowBox:last-child{padding-bottom:0px;margin-bottom:30px}.veu_flowBox:last-child:after{content:"";font-size:0}.veu_flowBox dl{display:block;overflow:hidden;padding:20px 25px;border:3px solid #e5e5e5;margin:0}.veu_flowBox dl dt,.veu_flowBox dl dd{padding-left:0;border:none}.veu_flowBox dl dt{border-bottom:1px dotted #ccc;margin-bottom:10px;font-size:1.2em}.veu_flowBox dl dd{margin-bottom:0px}.veu_flowBox dl dd h4{margin:0px;padding:0px}.veu_flowBox dl dd p{margin-bottom:10px}.veu_flowBox dl dd ul{margin-bottom:0px}.veu_dummyImage{padding:20px;display:block;vertical-align:middle;text-align:center;background-color:#f5f5f5;border:1px solid #ccc;margin-bottom:15px}.veu_floatLeft{float:left;margin-right:20px}.veu_floatRight{float:right;margin-left:20px}html{font-size:inherit}.link-list li{padding:0.5em}@media (min-width: 768px){.mainSection .widget{margin-bottom:40px}}.widget .subSection-title{font-size:18px}h1.mainSection-title{font-size:24px}.veu_adminEdit{margin-top:5px}.veu_adminEdit a.btn:before{margin-right:5px;content:"\f040";font-family:FontAwesome}.veu_contentAddSection{display:block;clear:both;overflow:hidden;padding-top:20px}.relatedPosts h2{margin-bottom:10px}.veu_autoEyeCatchBox{display:block;overflow:hidden;margin-bottom:2em}.veu_sitemap .sectionBox{padding-top:0}.veu_sitemap .sitemap-col{padding-bottom:2em}.veu_sitemap .sitemap-col{margin-top:2.5em}.veu_sitemap .sitemap-col .link-list{margin-top:0;margin-bottom:0}.veu_sitemap .sitemap-col .page_item{padding:0}.veu_sitemap .sitemap-col .children{margin-bottom:2em}.veu_sitemap .sitemap-col .cat-item{padding:0}.veu_socialSet ul{margin:0px;padding:0}.veu_socialSet ul li{position:relative;display:block;float:left;overflow:visible;margin-right:10px;padding:0px;background:none}.veu_socialSet ul li.sb_icon a{display:block;overflow:hidden;padding:3px 5px 0px;border:1px solid #ccc;border-radius:3px;background-color:#fff;color:#333;text-decoration:none;line-height:100%}.veu_socialSet ul li.sb_icon a .sns_txt{position:relative;top:-2px;font-size:11px}.veu_socialSet ul li iframe{border:none}.veu_socialSet ul li a .icon_sns{margin-right:5px;font-size:100%}.veu_socialSet ul li.sb_icon.sb_facebook .icon_sns{color:#425dab}.veu_socialSet ul li.sb_icon.sb_hatena .icon_sns{color:#2c6ebd}.veu_socialSet ul li.sb_icon.sb_twitter .icon_sns{color:#00abec}.veu_socialSet ul li.sb_icon.sb_google .icon_sns{color:#dd4b39}.veu_socialSet ul li.sb_icon.sb_line .icon_sns{color:#6ebd30}.veu_socialSet ul li.sb_pocket{margin-left:5px}.veu_count_sns_fb,.veu_count_sns_hb{display:inline-block;margin-left:5px;padding:2px 5px;border-radius:5px;color:#ffffff;vertical-align:top;font-size:77%;line-height:1}.veu_count_sns_fb{background:#425dab}.veu_count_sns_hb{background:#2c6ebd}@font-face{font-weight:normal;font-style:normal;font-family:'vk_sns';src:url("../plugins/sns/icons/fonts/vk_sns.eot?-bq20cj");src:url("../plugins/sns/icons/fonts/vk_sns.eot?#iefix-bq20cj") format("embedded-opentype"),url("../plugins/sns/icons/fonts/vk_sns.woff?-bq20cj") format("woff"),url("../plugins/sns/icons/fonts/vk_sns.ttf?-bq20cj") format("truetype"),url("../plugins/sns/icons/fonts/vk_sns.svg?-bq20cj#vk_sns") format("svg")}[class^="vk_icon_w_r_sns_"],[class*=" vk_icon_w_r_sns_"]{text-transform:none;font-weight:normal;font-style:normal;font-variant:normal;font-family:'vk_sns';line-height:1;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.vk_icon_w_r_sns_twitter:before{content:"\e600"}.vk_icon_w_r_sns_line:before{content:"\e601"}.vk_icon_w_r_sns_hatena:before{content:"\e602"}.vk_icon_w_r_sns_google:before{content:"\e603"}.vk_icon_w_r_sns_fb:before{content:"\e604"}.veu_childPage_list{margin-top:2.5em;margin-bottom:1em}.veu_childPage_list a:hover{text-decoration:none}.veu_childPage_list .childPage_list_box{display:block;margin-bottom:1em}.veu_childPage_list .childPage_list_box_inner{position:relative;display:block;overflow:hidden;padding:0 20px;border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px #fff}.veu_childPage_list .childPage_list_title{margin-top:20px;color:#464646;font-size:16px;line-height:1.4}.veu_childPage_list .wp-post-image{float:left;margin-right:1em;width:30%;border:solid 1px #ddd}.veu_childPage_list .childPage_list_body{overflow:hidden;margin-bottom:5px;color:#333;font-size:14px}.veu_childPage_list .childPage_list_body:hover{text-decoration:underline}.veu_childPage_list p{line-height:1.5em}.veu_childPage_list .childPage_list_text{overflow:hidden;margin-bottom:0}.veu_childPage_list .childPage_list_more{float:right;margin-bottom:20px}@media (max-width: 767px){.veu_childPage_list .wp-post-image{width:25%}}.veu_pageList_ancestor{margin:0 0 15px;padding:0 20px;border:3px solid #efefef;box-shadow:inset 0px 0px 0px 1px #fff}.veu_pageList_ancestor .pageList{margin-top:1em;padding-left:0}.veu_pageList_ancestor .pageList a{display:block;padding:8px 5px;border-bottom:solid 1px #ddd;color:#333;font-size:0.8em}.veu_pageList_ancestor .pageList>.page_item{list-style:none}.veu_pageList_ancestor .pageList>.page_item:last-child a{border:none}.veu_pageList_ancestor .pageList .page_item{margin-bottom:0}.veu_pageList_ancestor .current_page_item>a{background-color:#F0F0F0;box-shadow:inset 0 0 5px #eee}.veu_pageList_ancestor .children{margin:0;padding-left:15px}.veu_pageList_ancestor .children .page_item{position:relative;list-style:none}.veu_pageList_ancestor .children .page_item:before{position:absolute;top:0.26em;left:5px;display:inline-block;content:"・"}.veu_pageList_ancestor .children .page_item a{padding-left:20px}.veu_pageList_ancestor .section_title.subSection-title{margin:0.5em 0}.veu_pageList_ancestor .section_title.subSection-title a{color:#333;font-size:23px}@media screen and (max-width: 992px){.page-template-default .veu_pageList_ancestor{display:none}}.veu_cta{display:block;overflow:hidden;margin-top:20px;margin-bottom:20px;background-color:#efefef}.veu_cta h1.cta_title{display:block;overflow:hidden;padding:12px 20px 10px;background-color:#333;color:#fff;font-size:22px;line-height:1.2em}.veu_cta .cta_body{display:block;overflow:hidden;padding:1.5em 2em 2em;line-height:170%}.veu_cta .cta_body_image{margin-bottom:1.5em}.veu_cta .cta_body_image img{max-width:250px}.veu_cta .cta_body_image_center{display:block;overflow:hidden;text-align:center}.veu_cta .cta_body_image_center img{display:block;margin:0 auto 15px;max-width:100%}.veu_cta .cta_body_txt{display:block;overflow:hidden}.veu_cta .cta_body_link{clear:both;margin-top:1.5em}@media (max-width: 767px){.veu_cta .cta_body_image img{display:block;margin:0 auto 1.5em;max-width:100%}}@media (min-width: 768px){.veu_cta .cta_body_image_right{float:right;margin-left:30px}.veu_cta .cta_body_image_left{float:left;margin-right:30px}}.veu_contact{display:block;overflow:hidden}.veu_contact .contact_frame{display:block;overflow:hidden;padding:25px 24px 21px;border:3px solid #efefef;background-color:#f9f9f9;box-shadow:inset 0px 0px 0px 1px #fff}.veu_contact .contact_txt_catch,.veu_contact .contact_txt_tel,.veu_contact .contact_txt_time{display:block;overflow:hidden}.veu_contact .contact_txt_catch,.veu_contact .contact_txt_time{font-size:14px;line-height:128.6%}.veu_contact .contact_txt_tel{padding-top:4px;font-size:28px;line-height:110%}.veu_contact .contact_bt_txt:before{margin-right:7px;content:"\f003";font-family:FontAwesome}.veu_contact .contact_bt_txt:after{margin-left:7px;content:"\f18e";font-family:FontAwesome}.veu_contact .contact_bt_subTxt{display:block;overflow:hidden;font-size:14px}@media (max-width: 767px){.veu_contact .contact_txt{text-align:center}.veu_contact .contact_bt{display:block}}@media (min-width: 768px){.veu_contact p.contact_txt{margin-bottom:0}.veu_contact .contact_txt{float:left}.veu_contact .contact_bt{float:right}.veu_contact .contact_bt_subTxt_side{font-size:12px}.widget .veu_contact .contact_bt{display:inline-block;float:none;margin-top:15px}}.veu_insertAds{margin-top:1em;margin-bottom:1.5em}@media (max-width: 971px){.veu_insertAds{margin-bottom:0.5em}.veu_insertAds .col-md-6{margin-bottom:1em}}.veu_relatedPosts>.row{display:-ms-flexbox;display:-webkit-flex;display:flex;margin:0;margin-right:-3%;-ms-flex-wrap:wrap;-webkit-flex-wrap:wrap;flex-wrap:wrap}.veu_relatedPosts .relatedPosts_item{float:none;margin-right:2.9%;padding-right:0;padding-left:0;width:47%;border-bottom:solid 1px #e5e5e5}.veu_relatedPosts .relatedPosts_item>.media:first-child{border:none}.veu_relatedPosts .relatedPosts_item>.media{border:none}.veu_relatedPosts .relatedPosts_item:nth-child(1){border-top:solid 1px #e5e5e5}.veu_relatedPosts .relatedPosts_item:nth-child(2){border-top:solid 1px #e5e5e5}@media (max-width: 768px){.veu_relatedPosts .relatedPosts_item{display:block;width:100%}.veu_relatedPosts .relatedPosts_item:nth-child(2){border-top:none}}.veu_fbPagePlugin .fbPagePlugin_body{margin:0 auto;border:4px solid #efefef;background-color:#f9f9f9;text-align:center}.twitter-timeline iframe{margin-right:auto;margin-left:auto}.veu_newPosts h1.mainSection-title{margin-bottom:0}.veu_newPosts ul.postList{margin:15px 0 20px;padding:0}.veu_newPosts ul.postList li{display:block;clear:both;overflow:hidden;padding:0;border-bottom:1px dotted #666}.veu_newPosts ul.postList a{color:#464646}.veu_newPosts ul.postList .published,.veu_newPosts ul.postList .taxonomies a,.veu_newPosts ul.postList .entry-title{display:block;float:left;overflow:hidden}.veu_newPosts ul.postList .published{margin-right:10px;color:#d44950}.veu_newPosts ul.postList .published:before{margin:0;content:''}.veu_newPosts ul.postList .taxonomies a{margin-right:3px;padding:2px 5px 1px;border-radius:3px;background-color:#efefef;font-size:12px}.veu_newPosts ul.postList .entry-title{display:block;clear:both;margin:5px 0}.veu_newPosts .entry-meta_items.published:before{margin-right:5px;content:"\f073";font-family:FontAwesome}.veu_followSet{display:block;overflow:hidden;margin-top:20px;padding:15px;border:1px solid #f5f5f5;background-color:#efefef}.veu_followSet h3.followSet_title{padding:6px 10px 4px;border:none;background-color:#333;color:#fff;font-size:18px}.veu_followSet h3.followSet_title:after{border:none}.veu_followSet .follow_btn{float:left;margin-right:20px}.veu_profile .profile{overflow:hidden}.veu_profile .profile_media{display:block;margin:0.8em auto;max-width:100%}.veu_profile .media_round{border-radius:50%}.veu_profile .media_left .profile_media{margin-left:0}.veu_profile .media_float{float:left;padding-right:10px}.veu_profile .media_float .profile_media{margin:0.8em 0 0}.veu_profile .media_float+.profile_text{padding-top:0.8em}.veu_profile .profile_text{margin-bottom:0.5em;font-size:14px}.veu_profile .sns_btns{margin:0;padding:0;width:100%}.veu_profile .sns_btns li{float:left;margin-right:0.45em;list-style:none;text-align:center}.veu_profile .sns_btns a{display:block;display:table;width:45px;height:45px;border-radius:23px;color:#fff;text-decoration:none;font-size:20px}.veu_profile .sns_btns a:hover{color:#fff;text-decoration:none;opacity:0.8}.veu_profile .sns_btns .fa{display:table-cell;vertical-align:middle;text-align:center}.veu_profile .sns_btns .facebook_btn a{background:#3b5998}.veu_profile .sns_btns .twitter_btn a{background:#55acee}.veu_profile .sns_btns .mail_btn a{background:#2F915F}.veu_profile .sns_btns .youtube_btn a{background:#C81D1C}.veu_profile .sns_btns .rss_btn a{background:#f26522}.veu_profile .sns_btns .instagram_btn a{background:#3f729b}.veu_profile .sns_btns .linkedin_btn a{background:#0077b5}.veu_3prArea .subSection-title{font-size:18px}.veu_3prArea .media_pr{margin-top:0.8em;margin-bottom:0.8em}.veu_3prArea .media_pc{display:block}.veu_3prArea .media_sp{display:none}.veu_3prArea .summary{margin-bottom:0.5em;font-size:14px;line-height:1.4em}.veu_3prArea .linkurl a{text-decoration:none}@media screen and (max-width: 992px){.veu_3prArea .media_pc{display:none}.veu_3prArea .media_sp{display:block}.veu_3prArea .linkurl{margin-bottom:1.5em}}.veu_prBlocks{display:table;width:100%;table-layout:fixed}.veu_prBlocks .prArea{display:table-cell;padding:0 1em}.veu_prBlocks .prArea:first-child{padding-left:0}.veu_prBlocks .prArea:last-child{padding-right:0}.veu_prBlocks a{color:#333}.veu_prBlocks a:hover{color:#333;text-decoration:none}.veu_prBlocks a .summary:hover{text-decoration:underline}.veu_prBlocks .circle_icon{display:table;margin:0 auto;width:80px;height:80px;border-radius:50%}.veu_prBlocks .circle_icon .font_icon{display:table-cell;color:#fff;vertical-align:middle;text-align:center;font-size:40px}.veu_prBlocks .prBox_title{margin-top:1.5em;margin-bottom:1em;text-align:center;font-size:18px}.veu_prBlocks .media_pr{display:table;margin:0 auto}.veu_prBlocks .pr_image{display:table-cell;overflow:hidden;width:120px;height:120px;border-radius:50%;vertical-align:middle;text-align:center}.veu_prBlocks .summary{margin-bottom:0.5em;text-align:center;font-size:14px;line-height:1.4em}@media screen and (max-width: 767px){.veu_pr_blocks{display:block}.veu_pr_blocks .prArea{display:block;margin-bottom:3em}.veu_pr_blocks .prArea:first-child{padding-left:1em}.veu_pr_blocks .prArea:last-child{padding-right:1em}}
|
package_manager.php
CHANGED
@@ -10,54 +10,54 @@
|
|
10 |
vkExUnit_package_initilate();
|
11 |
|
12 |
|
13 |
-
function vkExUnit_package_initilate(){
|
14 |
global $vkExUnit_packages;
|
15 |
-
if(!is_array($vkExUnit_packages)) $vkExUnit_packages = array();
|
16 |
}
|
17 |
|
18 |
|
19 |
-
function vkExUnit_package_is_enable( $package_name ){
|
20 |
global $vkExUnit_packages;
|
21 |
-
if( !isset( $vkExUnit_packages[$package_name] ) ) return null;
|
22 |
$options = vkExUnit_get_common_options();
|
23 |
-
if( !isset($options['active_'.$package_name]) ) return $vkExUnit_packages[$package_name]['default'];
|
24 |
-
return $options['active_'.$package_name];
|
25 |
}
|
26 |
|
27 |
|
28 |
-
function vkExUnit_package_register( $args ){
|
29 |
$defaults = vkExUnit_package_default();
|
30 |
$args = wp_parse_args( $args, $defaults );
|
31 |
|
32 |
global $vkExUnit_packages;
|
33 |
-
$vkExUnit_packages[$args['name']] = $args;
|
34 |
}
|
35 |
|
36 |
|
37 |
-
function vkExUnit_package_include(){
|
38 |
global $vkExUnit_packages;
|
39 |
-
if( !count($vkExUnit_packages) || !is_array($vkExUnit_packages) ) return $output;
|
40 |
$options = vkExUnit_get_common_options();
|
41 |
-
$include_base=vkExUnit_get_directory().'/plugins/';
|
42 |
-
foreach($vkExUnit_packages as $package){
|
43 |
-
if(
|
44 |
-
$package['include'
|
45 |
(
|
46 |
( isset( $options[ 'active_' . $package['name'] ] ) and $options[ 'active_' . $package['name'] ] ) or
|
47 |
-
( !isset( $options[ 'active_' . $package['name'] ] ) and $package['default'] )
|
48 |
)
|
49 |
-
){
|
50 |
-
require_once $include_base . $package[
|
51 |
}
|
52 |
}
|
53 |
}
|
54 |
|
55 |
|
56 |
-
function vkExUnit_package_default(){
|
57 |
return array(
|
58 |
'name' => null,
|
59 |
'title' => 'noting',
|
60 |
-
'description' =>
|
61 |
'attr' => array(),
|
62 |
'default' => null,
|
63 |
'include' => false,
|
@@ -66,16 +66,16 @@ function vkExUnit_package_default(){
|
|
66 |
}
|
67 |
|
68 |
|
69 |
-
add_filter('vkExUnit_common_options_validate' , 'vkExUnit_common_package_options_validate', 10, 2);
|
70 |
-
function vkExUnit_common_package_options_validate( $output, $input ){
|
71 |
global $vkExUnit_packages;
|
72 |
-
if( !count($vkExUnit_packages) || !is_array($vkExUnit_packages) ) return $output;
|
73 |
-
foreach($vkExUnit_packages as $package){
|
74 |
-
if(
|
75 |
-
isset($output['active_'.$package['name']]) &&
|
76 |
-
$output['active_'.$package['name']] == (isset($input['active_'.$package['name']]) && $input['active_'.$package['name']]) ? true : false
|
77 |
-
) continue;
|
78 |
-
$output['active_'.$package['name']] = (isset($input['active_'.$package['name']])) ? true : false;
|
79 |
}
|
80 |
return $output;
|
81 |
-
}
|
10 |
vkExUnit_package_initilate();
|
11 |
|
12 |
|
13 |
+
function vkExUnit_package_initilate() {
|
14 |
global $vkExUnit_packages;
|
15 |
+
if ( ! is_array( $vkExUnit_packages ) ) { $vkExUnit_packages = array(); }
|
16 |
}
|
17 |
|
18 |
|
19 |
+
function vkExUnit_package_is_enable( $package_name ) {
|
20 |
global $vkExUnit_packages;
|
21 |
+
if ( ! isset( $vkExUnit_packages[ $package_name ] ) ) { return null; }
|
22 |
$options = vkExUnit_get_common_options();
|
23 |
+
if ( ! isset( $options[ 'active_'.$package_name ] ) ) { return $vkExUnit_packages[ $package_name ]['default']; }
|
24 |
+
return $options[ 'active_'.$package_name ];
|
25 |
}
|
26 |
|
27 |
|
28 |
+
function vkExUnit_package_register( $args ) {
|
29 |
$defaults = vkExUnit_package_default();
|
30 |
$args = wp_parse_args( $args, $defaults );
|
31 |
|
32 |
global $vkExUnit_packages;
|
33 |
+
$vkExUnit_packages[ $args['name'] ] = $args;
|
34 |
}
|
35 |
|
36 |
|
37 |
+
function vkExUnit_package_include() {
|
38 |
global $vkExUnit_packages;
|
39 |
+
if ( ! count( $vkExUnit_packages ) || ! is_array( $vkExUnit_packages ) ) { return $output; }
|
40 |
$options = vkExUnit_get_common_options();
|
41 |
+
$include_base = vkExUnit_get_directory().'/plugins/';
|
42 |
+
foreach ( $vkExUnit_packages as $package ) {
|
43 |
+
if (
|
44 |
+
$package['include'] and
|
45 |
(
|
46 |
( isset( $options[ 'active_' . $package['name'] ] ) and $options[ 'active_' . $package['name'] ] ) or
|
47 |
+
( ! isset( $options[ 'active_' . $package['name'] ] ) and $package['default'] )
|
48 |
)
|
49 |
+
) {
|
50 |
+
require_once $include_base . $package['include'];
|
51 |
}
|
52 |
}
|
53 |
}
|
54 |
|
55 |
|
56 |
+
function vkExUnit_package_default() {
|
57 |
return array(
|
58 |
'name' => null,
|
59 |
'title' => 'noting',
|
60 |
+
'description' => 'noting',
|
61 |
'attr' => array(),
|
62 |
'default' => null,
|
63 |
'include' => false,
|
66 |
}
|
67 |
|
68 |
|
69 |
+
add_filter( 'vkExUnit_common_options_validate' , 'vkExUnit_common_package_options_validate', 10, 2 );
|
70 |
+
function vkExUnit_common_package_options_validate( $output, $input ) {
|
71 |
global $vkExUnit_packages;
|
72 |
+
if ( ! count( $vkExUnit_packages ) || ! is_array( $vkExUnit_packages ) ) { return $output; }
|
73 |
+
foreach ( $vkExUnit_packages as $package ) {
|
74 |
+
if (
|
75 |
+
isset( $output[ 'active_'.$package['name'] ] ) &&
|
76 |
+
$output[ 'active_'.$package['name'] ] == (isset( $input[ 'active_'.$package['name'] ] ) && $input[ 'active_'.$package['name'] ]) ? true : false
|
77 |
+
) { continue; }
|
78 |
+
$output[ 'active_'.$package['name'] ] = (isset( $input[ 'active_'.$package['name'] ] )) ? true : false;
|
79 |
}
|
80 |
return $output;
|
81 |
+
}
|
packages.php
CHANGED
@@ -64,289 +64,311 @@ $required_packages[] = array(
|
|
64 |
/* bootstrap
|
65 |
/*-------------------------------------------*/
|
66 |
$required_packages[] = array(
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
);
|
72 |
|
73 |
/*-------------------------------------------*/
|
74 |
/* fontawesome
|
75 |
/*-------------------------------------------*/
|
76 |
$required_packages[] = array(
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
);
|
82 |
|
83 |
/*-------------------------------------------*/
|
84 |
/* icon
|
85 |
/*-------------------------------------------*/
|
86 |
$required_packages[] = array(
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
);
|
93 |
|
94 |
/*-------------------------------------------*/
|
95 |
/* wpTitle
|
96 |
/*-------------------------------------------*/
|
97 |
$required_packages[] = array(
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
);
|
103 |
|
104 |
/*-------------------------------------------*/
|
105 |
/* metaKeyword
|
106 |
/*-------------------------------------------*/
|
107 |
$required_packages[] = array(
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
|
120 |
);
|
121 |
/*-------------------------------------------*/
|
122 |
/* metaDescription
|
123 |
/*-------------------------------------------*/
|
124 |
$required_packages[] = array(
|
125 |
-
|
126 |
-
|
127 |
-
|
128 |
-
|
129 |
-
|
130 |
);
|
131 |
|
132 |
/*-------------------------------------------*/
|
133 |
/* sns
|
134 |
/*-------------------------------------------*/
|
135 |
$deskSns = array();
|
136 |
-
$settingPage = '<a href="'.admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_sns_options">'.__('Main setting page').'</a>';
|
137 |
$deskSns[] = '<ul>';
|
138 |
-
$deskSns[] = '<li>'.__('Print og tags to html head.','vkExUnit').'</li>';
|
139 |
-
$deskSns[] = '<li>'.__('Print twitter card tags to html head.','vkExUnit').'</li>';
|
140 |
-
$deskSns[] = '<li>'.__('Print social bookmark buttons.','vkExUnit').'</li>';
|
141 |
-
$deskSns[] = '<li>'.__('Facebook Page Plugin widget.','vkExUnit').'</li>';
|
142 |
-
$deskSns[] = '<li>'.__('Print Follow me box to content bottom.','vkExUnit').'</li>';
|
143 |
$deskSns[] = '</ul>';
|
144 |
$deskSns[] = '<p>'.sprintf( __( '* You can stop the function separately from the %s.', 'vkExUnit' ), $settingPage ).'</p>';
|
145 |
|
146 |
$required_packages[] = array(
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
);
|
160 |
|
161 |
/*-------------------------------------------*/
|
162 |
/* ga
|
163 |
/*-------------------------------------------*/
|
164 |
$required_packages[] = array(
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
-
|
177 |
);
|
178 |
|
179 |
/*-------------------------------------------*/
|
180 |
/* otherWidgets
|
181 |
/*-------------------------------------------*/
|
182 |
$desk = array();
|
183 |
-
$desk[] =
|
184 |
$desk[] = '<ul>';
|
185 |
-
$desk[] = '<li>'.__('VK_Recent Posts - display the link text and the date of the latest article title.','vkExUnit').'</li>';
|
186 |
-
$desk[] = '<li>'.__('VK_Page content to widget - display the contents of the page to the widgets.','vkExUnit').'</li>';
|
187 |
-
$desk[] = '<li>'.__('VK_Profile - display the profile entered in the widget.','vkExUnit').'</li>';
|
188 |
-
$desk[] = '<li>'.__('VK_FB Page Plugin - display the Facebook Page Plugin.','vkExUnit').'</li>';
|
189 |
-
$desk[] = '<li>'.__('VK_3PR area - display the 3PR area.','vkExUnit').'</li>';
|
190 |
$desk[] = '<li>VK_'.__( 'categories/tags list', 'vkExUnit' ).__( 'Displays a categories, tags or format list.', 'vkExUnit' ).'</li>';
|
191 |
$desk[] = '<li>VK_'.__( 'archive list', 'vkExUnit' ).__( 'Displays a list of archives. You can choose the post type and also to display archives by month or by year.', 'vkExUnit' ).'</li>';
|
192 |
$desk[] = '</ul>';
|
193 |
|
194 |
$required_packages[] = array(
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
|
199 |
-
|
200 |
-
|
201 |
-
|
202 |
-
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
);
|
208 |
|
209 |
/*-------------------------------------------*/
|
210 |
/* css_customize
|
211 |
/*-------------------------------------------*/
|
212 |
$required_packages[] = array(
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
);
|
226 |
|
227 |
/*-------------------------------------------*/
|
228 |
/* Contact Section
|
229 |
/*-------------------------------------------*/
|
230 |
$required_packages[] = array(
|
231 |
-
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
|
236 |
-
|
237 |
-
|
238 |
-
|
239 |
-
|
240 |
-
|
241 |
-
|
242 |
-
|
243 |
);
|
244 |
|
245 |
-
|
246 |
-
|
247 |
/*-------------------------------------------*/
|
248 |
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
|
253 |
-
|
254 |
-
|
255 |
-
|
256 |
|
257 |
|
258 |
-
/*-------------------------------------------*/
|
259 |
-
/*
|
260 |
-
/*-------------------------------------------*/
|
261 |
-
$required_packages[] = array(
|
262 |
-
|
263 |
-
|
264 |
-
|
265 |
-
|
266 |
-
|
267 |
-
);
|
268 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
269 |
|
270 |
-
/*-------------------------------------------*/
|
271 |
-
/* Call To Action
|
272 |
-
/*-------------------------------------------*/
|
273 |
-
$cta_description = __('Display the CTA at the end of the post content.', 'vkExUnit');
|
274 |
-
$cta_description .= '<br>';
|
275 |
-
$cta_description .= __('The CTA stands for "Call to action" and this is the area that prompts the user behavior.', 'vkExUnit');
|
276 |
-
$cta_description .= '<br>';
|
277 |
-
$cta_description .= __('As an example, text message and a link button for induction to the free sample download page.', 'vkExUnit');
|
278 |
|
279 |
-
|
280 |
-
|
281 |
-
|
282 |
-
|
283 |
-
|
284 |
-
|
285 |
-
|
286 |
-
|
287 |
-
'enable_only' => 1,
|
288 |
-
),
|
289 |
-
array(
|
290 |
-
'name'=>__('Contents setting','vkExUnit'),
|
291 |
-
'url'=> admin_url().'edit.php?post_type=cta',
|
292 |
-
'enable_only' => 1,
|
293 |
-
)
|
294 |
-
),
|
295 |
-
'default' => true,
|
296 |
-
'include' => 'call_to_action/call_to_action.php',
|
297 |
-
);
|
298 |
|
299 |
-
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
|
318 |
-
/*-------------------------------------------*/
|
319 |
-
$required_packages[] = array(
|
320 |
-
'name' => 'relatedPosts',
|
321 |
-
'title' => __('Related posts', 'vkExUnit'),
|
322 |
-
'description' => __('Print Related posts lists to post content bottom.', 'vkExUnit'),
|
323 |
-
'default' => true,
|
324 |
-
'include' => 'related_posts/related_posts.php',
|
325 |
-
);
|
326 |
|
327 |
-
/*-------------------------------------------*/
|
328 |
-
/*
|
329 |
-
/*-------------------------------------------*/
|
330 |
-
$required_packages[] = array(
|
331 |
-
|
332 |
-
|
333 |
-
|
334 |
-
|
335 |
-
|
336 |
-
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
337 |
|
338 |
-
/*-------------------------------------------*/
|
339 |
-
/* disable_ping-back
|
340 |
-
/*-------------------------------------------*/
|
341 |
-
$required_packages[] = array(
|
342 |
-
'name' => 'disable_ping-back',
|
343 |
-
'title' => __('Disable ping back', 'vkExUnit'),
|
344 |
-
'description' => __('Disable xmlrpc ping back.', 'vkExUnit'),
|
345 |
-
'default' => false,
|
346 |
-
'include' => 'disable_ping-back.php',
|
347 |
-
'hidden' => true
|
348 |
-
);
|
349 |
|
350 |
-
foreach( $required_packages as $package ){
|
351 |
-
|
352 |
-
}
|
64 |
/* bootstrap
|
65 |
/*-------------------------------------------*/
|
66 |
$required_packages[] = array(
|
67 |
+
'name' => 'bootstrap',
|
68 |
+
'title' => __( 'Print Bootstrap css and js', 'vkExUnit' ),
|
69 |
+
'description' => __( 'If your using theme has already including Bootstrap, you deactivate this item.', 'vkExUnit' ),
|
70 |
+
'default' => false,
|
71 |
);
|
72 |
|
73 |
/*-------------------------------------------*/
|
74 |
/* fontawesome
|
75 |
/*-------------------------------------------*/
|
76 |
$required_packages[] = array(
|
77 |
+
'name' => 'fontawesome',
|
78 |
+
'title' => __( 'Print link fontawesome', 'vkExUnit' ),
|
79 |
+
'description' => __( 'Print fontawesome link tag to html head.', 'vkExUnit' ),
|
80 |
+
'default' => false,
|
81 |
);
|
82 |
|
83 |
/*-------------------------------------------*/
|
84 |
/* icon
|
85 |
/*-------------------------------------------*/
|
86 |
$required_packages[] = array(
|
87 |
+
'name' => 'icon',
|
88 |
+
'title' => __( 'Favicon setting', 'vkExUnit' ),
|
89 |
+
'description' => __( 'About favicon.', 'vkExUnit' ),
|
90 |
+
'default' => true,
|
91 |
+
'include' => 'icons.php',
|
92 |
);
|
93 |
|
94 |
/*-------------------------------------------*/
|
95 |
/* wpTitle
|
96 |
/*-------------------------------------------*/
|
97 |
$required_packages[] = array(
|
98 |
+
'name' => 'wpTitle',
|
99 |
+
'title' => __( 'Rewrite the title tag', 'vkExUnit' ),
|
100 |
+
'description' => __( 'Print is rewritten by its own rules to html head.', 'vkExUnit' ),
|
101 |
+
'default' => true,
|
102 |
);
|
103 |
|
104 |
/*-------------------------------------------*/
|
105 |
/* metaKeyword
|
106 |
/*-------------------------------------------*/
|
107 |
$required_packages[] = array(
|
108 |
+
'name' => 'metaKeyword',
|
109 |
+
'title' => __( 'Print meta Keyword', 'vkExUnit' ),
|
110 |
+
'description' => __( 'Print meta Keyword to html head.', 'vkExUnit' ),
|
111 |
+
'attr' => array(
|
112 |
+
array(
|
113 |
+
'name' => __( 'Setting','vkExUnit' ),
|
114 |
+
'url' => admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_common_keywords',
|
115 |
+
'enable_only' => 1,
|
116 |
+
),
|
117 |
+
),
|
118 |
+
'default' => true,
|
119 |
+
'include' => 'meta_keyword.php',
|
120 |
);
|
121 |
/*-------------------------------------------*/
|
122 |
/* metaDescription
|
123 |
/*-------------------------------------------*/
|
124 |
$required_packages[] = array(
|
125 |
+
'name' => 'metaDescription',
|
126 |
+
'title' => __( 'Print meta description', 'vkExUnit' ),
|
127 |
+
'description' => __( 'Print meta description to html head.', 'vkExUnit' ),
|
128 |
+
'default' => true,
|
129 |
+
'include' => 'meta_description.php',
|
130 |
);
|
131 |
|
132 |
/*-------------------------------------------*/
|
133 |
/* sns
|
134 |
/*-------------------------------------------*/
|
135 |
$deskSns = array();
|
136 |
+
$settingPage = '<a href="'.admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_sns_options">'.__( 'Main setting page' ).'</a>';
|
137 |
$deskSns[] = '<ul>';
|
138 |
+
$deskSns[] = '<li>'.__( 'Print og tags to html head.','vkExUnit' ).'</li>';
|
139 |
+
$deskSns[] = '<li>'.__( 'Print twitter card tags to html head.','vkExUnit' ).'</li>';
|
140 |
+
$deskSns[] = '<li>'.__( 'Print social bookmark buttons.','vkExUnit' ).'</li>';
|
141 |
+
$deskSns[] = '<li>'.__( 'Facebook Page Plugin widget.','vkExUnit' ).'</li>';
|
142 |
+
$deskSns[] = '<li>'.__( 'Print Follow me box to content bottom.','vkExUnit' ).'</li>';
|
143 |
$deskSns[] = '</ul>';
|
144 |
$deskSns[] = '<p>'.sprintf( __( '* You can stop the function separately from the %s.', 'vkExUnit' ), $settingPage ).'</p>';
|
145 |
|
146 |
$required_packages[] = array(
|
147 |
+
'name' => 'sns',
|
148 |
+
'title' => __( 'Social media cooperation', 'vkExUnit' ),
|
149 |
+
'description' => $deskSns,
|
150 |
+
'attr' => array(
|
151 |
+
array(
|
152 |
+
'name' => __( 'Setting','vkExUnit' ),
|
153 |
+
'url' => admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_sns_options',
|
154 |
+
'enable_only' => 1,
|
155 |
+
),
|
156 |
+
),
|
157 |
+
'default' => true,
|
158 |
+
'include' => 'sns/sns.php',
|
159 |
);
|
160 |
|
161 |
/*-------------------------------------------*/
|
162 |
/* ga
|
163 |
/*-------------------------------------------*/
|
164 |
$required_packages[] = array(
|
165 |
+
'name' => 'ga',
|
166 |
+
'title' => 'Google Analytics',
|
167 |
+
'description' => __( 'Print Google Analytics tracking code.', 'vkExUnit' ),
|
168 |
+
'attr' => array(
|
169 |
+
array(
|
170 |
+
'name' => __( 'Setting','vkExUnit' ),
|
171 |
+
'url' => admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_ga_options',
|
172 |
+
'enable_only' => 1,
|
173 |
+
),
|
174 |
+
),
|
175 |
+
'default' => true,
|
176 |
+
'include' => 'google_analytics/google_analytics.php',
|
177 |
);
|
178 |
|
179 |
/*-------------------------------------------*/
|
180 |
/* otherWidgets
|
181 |
/*-------------------------------------------*/
|
182 |
$desk = array();
|
183 |
+
$desk[] = '<p>'.__( 'You can use various widgets.', 'vkExUnit' ).'</p>';
|
184 |
$desk[] = '<ul>';
|
185 |
+
$desk[] = '<li>'.__( 'VK_Recent Posts - display the link text and the date of the latest article title.','vkExUnit' ).'</li>';
|
186 |
+
$desk[] = '<li>'.__( 'VK_Page content to widget - display the contents of the page to the widgets.','vkExUnit' ).'</li>';
|
187 |
+
$desk[] = '<li>'.__( 'VK_Profile - display the profile entered in the widget.','vkExUnit' ).'</li>';
|
188 |
+
$desk[] = '<li>'.__( 'VK_FB Page Plugin - display the Facebook Page Plugin.','vkExUnit' ).'</li>';
|
189 |
+
$desk[] = '<li>'.__( 'VK_3PR area - display the 3PR area.','vkExUnit' ).'</li>';
|
190 |
$desk[] = '<li>VK_'.__( 'categories/tags list', 'vkExUnit' ).__( 'Displays a categories, tags or format list.', 'vkExUnit' ).'</li>';
|
191 |
$desk[] = '<li>VK_'.__( 'archive list', 'vkExUnit' ).__( 'Displays a list of archives. You can choose the post type and also to display archives by month or by year.', 'vkExUnit' ).'</li>';
|
192 |
$desk[] = '</ul>';
|
193 |
|
194 |
$required_packages[] = array(
|
195 |
+
'name' => 'otherWidgets',
|
196 |
+
'title' => __( 'Widgets', 'vkExUnit' ),
|
197 |
+
'description' => $desk,
|
198 |
+
'attr' => array(
|
199 |
+
array(
|
200 |
+
'name' => __( 'Setting','vkExUnit' ),
|
201 |
+
'url' => admin_url().'widgets.php',
|
202 |
+
'enable_only' => 1,
|
203 |
+
),
|
204 |
+
),
|
205 |
+
'default' => true,
|
206 |
+
'include' => 'other_widget/other_widget.php',
|
207 |
);
|
208 |
|
209 |
/*-------------------------------------------*/
|
210 |
/* css_customize
|
211 |
/*-------------------------------------------*/
|
212 |
$required_packages[] = array(
|
213 |
+
'name' => 'css_customize',
|
214 |
+
'title' => __( 'CSS customize', 'vkExUnit' ),
|
215 |
+
'description' => __( 'You can set Customize CSS.', 'vkExUnit' ),
|
216 |
+
'attr' => array(
|
217 |
+
array(
|
218 |
+
'name' => __( 'Setting','vkExUnit' ),
|
219 |
+
'url' => admin_url().'admin.php?page=vkExUnit_css_customize',
|
220 |
+
'enable_only' => 1,
|
221 |
+
),
|
222 |
+
),
|
223 |
+
'default' => true,
|
224 |
+
'include' => 'css_customize/css_customize.php',
|
225 |
);
|
226 |
|
227 |
/*-------------------------------------------*/
|
228 |
/* Contact Section
|
229 |
/*-------------------------------------------*/
|
230 |
$required_packages[] = array(
|
231 |
+
'name' => 'contact_section',
|
232 |
+
'title' => __( 'Contact Section', 'vkExUnit' ),
|
233 |
+
'description' => __( 'Display Contact Section at after content.', 'vkExUnit' ),
|
234 |
+
'attr' => array(
|
235 |
+
array(
|
236 |
+
'name' => __( 'Setting','vkExUnit' ),
|
237 |
+
'url' => admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_contact',
|
238 |
+
'enable_only' => 1,
|
239 |
+
),
|
240 |
+
),
|
241 |
+
'default' => true,
|
242 |
+
'include' => 'contact_section.php',
|
243 |
);
|
244 |
|
245 |
+
/*-------------------------------------------*/
|
246 |
+
/* ChildPageIndex
|
247 |
/*-------------------------------------------*/
|
248 |
|
249 |
+
$required_packages[] = array(
|
250 |
+
'name' => 'childPageIndex',
|
251 |
+
'title' => __( 'Child page index', 'vkExUnit' ),
|
252 |
+
'description' => __( 'At the bottom of the specified page, it will display a list of the child page.', 'vkExUnit' ),
|
253 |
+
'default' => true,
|
254 |
+
'include' => 'child_page_index.php',
|
255 |
+
);
|
256 |
|
257 |
|
258 |
+
/*-------------------------------------------*/
|
259 |
+
/* pageList_ancestor
|
260 |
+
/*-------------------------------------------*/
|
261 |
+
$required_packages[] = array(
|
262 |
+
'name' => 'pageList_ancestor',
|
263 |
+
'title' => __( 'Page list from ancestor', 'vkExUnit' ),
|
264 |
+
'description' => __( 'Display Page list from ancestor at after content.', 'vkExUnit' ),
|
265 |
+
'default' => true,
|
266 |
+
'include' => 'pageList_ancestor.php',
|
267 |
+
);
|
268 |
|
269 |
+
/*-------------------------------------------*/
|
270 |
+
/* Sitemap_page
|
271 |
+
/*-------------------------------------------*/
|
272 |
+
$required_packages[] = array(
|
273 |
+
'name' => 'sitemap_page',
|
274 |
+
'title' => __( 'Display HTML Site Map', 'vkExUnit' ),
|
275 |
+
'description' => __( 'It displays a HTML Site Map to the specified page.', 'vkExUnit' ),
|
276 |
+
'default' => true,
|
277 |
+
'include' => 'sitemap_page/sitemap_page.php',
|
278 |
+
);
|
279 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
280 |
|
281 |
+
/*-------------------------------------------*/
|
282 |
+
/* Call To Action
|
283 |
+
/*-------------------------------------------*/
|
284 |
+
$cta_description = __( 'Display the CTA at the end of the post content.', 'vkExUnit' );
|
285 |
+
$cta_description .= '<br>';
|
286 |
+
$cta_description .= __( 'The CTA stands for "Call to action" and this is the area that prompts the user behavior.', 'vkExUnit' );
|
287 |
+
$cta_description .= '<br>';
|
288 |
+
$cta_description .= __( 'As an example, text message and a link button for induction to the free sample download page.', 'vkExUnit' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
289 |
|
290 |
+
$required_packages[] = array(
|
291 |
+
'name' => 'call_to_action',
|
292 |
+
'title' => __( 'Call To Action', 'vkExUnit' ),
|
293 |
+
'description' => $cta_description,
|
294 |
+
'attr' => array(
|
295 |
+
array(
|
296 |
+
'name' => __( 'Setting','vkExUnit' ),
|
297 |
+
'url' => admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_cta_settings',
|
298 |
+
'enable_only' => 1,
|
299 |
+
),
|
300 |
+
array(
|
301 |
+
'name' => __( 'Contents setting','vkExUnit' ),
|
302 |
+
'url' => admin_url().'edit.php?post_type=cta',
|
303 |
+
'enable_only' => 1,
|
304 |
+
),
|
305 |
+
),
|
306 |
+
'default' => true,
|
307 |
+
'include' => 'call_to_action/call_to_action.php',
|
308 |
+
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
309 |
|
310 |
+
/*-------------------------------------------*/
|
311 |
+
/* insert_ads
|
312 |
+
/*-------------------------------------------*/
|
313 |
+
$required_packages[] = array(
|
314 |
+
'name' => 'insert_ads',
|
315 |
+
'title' => __( 'Insert ads', 'vkExUnit' ),
|
316 |
+
'description' => __( 'Insert ads to content.', 'vkExUnit' ),
|
317 |
+
'attr' => array(
|
318 |
+
array(
|
319 |
+
'name' => __( 'Setting','vkExUnit' ),
|
320 |
+
'url' => admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_Ads',
|
321 |
+
'enable_only' => 1,
|
322 |
+
),
|
323 |
+
),
|
324 |
+
'default' => true,
|
325 |
+
'include' => 'insert_ads.php',
|
326 |
+
);
|
327 |
+
/*-------------------------------------------*/
|
328 |
+
/* relatedPosts
|
329 |
+
/*-------------------------------------------*/
|
330 |
+
$required_packages[] = array(
|
331 |
+
'name' => 'relatedPosts',
|
332 |
+
'title' => __( 'Related posts', 'vkExUnit' ),
|
333 |
+
'description' => __( 'Print Related posts lists to post content bottom.', 'vkExUnit' ),
|
334 |
+
'default' => true,
|
335 |
+
'include' => 'related_posts/related_posts.php',
|
336 |
+
);
|
337 |
+
|
338 |
+
/*-------------------------------------------*/
|
339 |
+
/* auto_eyecatch
|
340 |
+
/*-------------------------------------------*/
|
341 |
+
$required_packages[] = array(
|
342 |
+
'name' => 'auto_eyecatch',
|
343 |
+
'title' => __( 'Automatic Eye Catch insert', 'vkExUnit' ),
|
344 |
+
'description' => __( 'Display Eye Catch image at before content.', 'vkExUnit' ),
|
345 |
+
'default' => false,
|
346 |
+
'include' => 'auto_eyecatch.php',
|
347 |
+
);
|
348 |
+
|
349 |
+
/*-------------------------------------------*/
|
350 |
+
/* disable_ping-back
|
351 |
+
/*-------------------------------------------*/
|
352 |
+
$required_packages[] = array(
|
353 |
+
'name' => 'disable_ping-back',
|
354 |
+
'title' => __( 'Disable ping back', 'vkExUnit' ),
|
355 |
+
'description' => __( 'Disable xmlrpc ping back.', 'vkExUnit' ),
|
356 |
+
'default' => false,
|
357 |
+
'include' => 'disable_ping-back.php',
|
358 |
+
'hidden' => true,
|
359 |
+
);
|
360 |
+
|
361 |
+
|
362 |
+
$required_packages[] = array(
|
363 |
+
'name' => 'disable_dashbord',
|
364 |
+
'title' => __( 'Disable dashbord', 'vkExUnit' ),
|
365 |
+
'description' => __( 'Disable dashbord', 'vkExUnit' ),
|
366 |
+
'default' => false,
|
367 |
+
'include' => 'disable_dashbord.php',
|
368 |
+
'hidden' => true,
|
369 |
+
);
|
370 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
371 |
|
372 |
+
foreach ( $required_packages as $package ) {
|
373 |
+
vkExUnit_package_register( $package );
|
374 |
+
}
|
plugins/auto_eyecatch.php
CHANGED
@@ -14,8 +14,8 @@ class vExUnit_eyecatch {
|
|
14 |
public static $allowed_post_types = array( 'post', 'page' );
|
15 |
|
16 |
public static function instance() {
|
17 |
-
if ( isset( self::$instance ) )
|
18 |
-
return self::$instance;
|
19 |
|
20 |
self::$instance = new vExUnit_eyecatch;
|
21 |
self::$instance->run_init();
|
@@ -29,61 +29,61 @@ class vExUnit_eyecatch {
|
|
29 |
|
30 |
|
31 |
protected function run_init() {
|
32 |
-
add_action('admin_menu', array($this, 'add_custom_field'));
|
33 |
-
add_action('save_post' , array($this, 'save_custom_field'));
|
34 |
-
add_filter('the_content', array($this, 'set_eyecatch' ), 1);
|
35 |
}
|
36 |
|
37 |
|
38 |
-
public function add_custom_field(){
|
39 |
-
foreach( self::$allowed_post_types as $post_type ){
|
40 |
-
add_meta_box('vkExUnit_EyeCatch', __('Automatic EyeCatch', 'vkExUnit'), array( $this, 'render_meta_box' ), $post_type, 'normal', 'high');
|
41 |
}
|
42 |
}
|
43 |
|
44 |
|
45 |
-
public function render_meta_box(){
|
46 |
global $post;
|
47 |
-
$disable_autoeyecatch = get_post_meta(get_the_id(), 'vkExUnit_EyeCatch_disable', true);
|
48 |
|
49 |
-
echo '<input type="hidden" name="_nonce_vkExUnit__custom_auto_eyecatch" id="_nonce_vkExUnit__custom_auto_eyecatch_noonce" value="'.wp_create_nonce(plugin_basename(__FILE__)).'" />';
|
50 |
-
echo '<label ><input type="checkbox" name="vkExUnit_auto_eyecatch" value="true" ' . ( ($disable_autoeyecatch)? 'checked' : '' ) . ' />'.__(
|
51 |
|
52 |
}
|
53 |
|
54 |
|
55 |
-
public function save_custom_field($post_id){
|
56 |
|
57 |
-
$metaKeyword = isset($_POST['_nonce_vkExUnit__custom_auto_eyecatch']) ? htmlspecialchars($_POST['_nonce_vkExUnit__custom_auto_eyecatch']) : null;
|
58 |
|
59 |
-
$keyword = get_post_meta($post_id, 'vkExUnit_metaKeyword', true);
|
60 |
|
61 |
// if autosave then deny
|
62 |
-
if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
63 |
-
|
64 |
|
65 |
-
if(!wp_verify_nonce($metaKeyword, plugin_basename(__FILE__))){
|
66 |
return $post_id;
|
67 |
}
|
68 |
|
69 |
-
delete_post_meta($post_id, 'vkExUnit_EyeCatch_disable');
|
70 |
-
if( isset($_POST['vkExUnit_auto_eyecatch']) && $_POST['vkExUnit_auto_eyecatch'] ){
|
71 |
-
add_post_meta($post_id, 'vkExUnit_EyeCatch_disable', true );
|
72 |
}
|
73 |
}
|
74 |
|
75 |
|
76 |
-
public static function is_my_turn(){
|
77 |
|
78 |
-
if( vkExUnit_is_excerpt() ) return false;
|
79 |
|
80 |
-
if(get_the_id()){
|
81 |
|
82 |
-
if( in_array( get_post_type(get_the_id()), self::$allowed_post_types ) ){
|
83 |
|
84 |
-
if( has_post_thumbnail( get_the_id() ) ){
|
85 |
|
86 |
-
if(!get_post_meta( get_the_id(), 'vkExUnit_EyeCatch_disable', true) ){
|
87 |
|
88 |
return true;
|
89 |
}
|
@@ -95,9 +95,9 @@ class vExUnit_eyecatch {
|
|
95 |
}
|
96 |
|
97 |
|
98 |
-
public function set_eyecatch($content){
|
99 |
|
100 |
-
if( !self::is_my_turn() ){
|
101 |
|
102 |
$imageHtml = self::render_eyecatch( get_the_id() );
|
103 |
|
@@ -107,7 +107,7 @@ class vExUnit_eyecatch {
|
|
107 |
}
|
108 |
|
109 |
|
110 |
-
public function render_eyecatch($post_id){
|
111 |
$html = '';
|
112 |
|
113 |
$image_tag = get_the_post_thumbnail( $post_id, 'large' );
|
@@ -115,7 +115,6 @@ class vExUnit_eyecatch {
|
|
115 |
$html = '<div class="veu_autoEyeCatchBox">' . $image_tag . '</div>';
|
116 |
return $html;
|
117 |
}
|
118 |
-
|
119 |
}
|
120 |
|
121 |
-
vExUnit_eyecatch::instance();
|
14 |
public static $allowed_post_types = array( 'post', 'page' );
|
15 |
|
16 |
public static function instance() {
|
17 |
+
if ( isset( self::$instance ) ) {
|
18 |
+
return self::$instance; }
|
19 |
|
20 |
self::$instance = new vExUnit_eyecatch;
|
21 |
self::$instance->run_init();
|
29 |
|
30 |
|
31 |
protected function run_init() {
|
32 |
+
add_action( 'admin_menu', array( $this, 'add_custom_field' ) );
|
33 |
+
add_action( 'save_post' , array( $this, 'save_custom_field' ) );
|
34 |
+
add_filter( 'the_content', array( $this, 'set_eyecatch' ), 1 );
|
35 |
}
|
36 |
|
37 |
|
38 |
+
public function add_custom_field() {
|
39 |
+
foreach ( self::$allowed_post_types as $post_type ) {
|
40 |
+
add_meta_box( 'vkExUnit_EyeCatch', __( 'Automatic EyeCatch', 'vkExUnit' ), array( $this, 'render_meta_box' ), $post_type, 'normal', 'high' );
|
41 |
}
|
42 |
}
|
43 |
|
44 |
|
45 |
+
public function render_meta_box() {
|
46 |
global $post;
|
47 |
+
$disable_autoeyecatch = get_post_meta( get_the_id(), 'vkExUnit_EyeCatch_disable', true );
|
48 |
|
49 |
+
echo '<input type="hidden" name="_nonce_vkExUnit__custom_auto_eyecatch" id="_nonce_vkExUnit__custom_auto_eyecatch_noonce" value="'.wp_create_nonce( plugin_basename( __FILE__ ) ).'" />';
|
50 |
+
echo '<label ><input type="checkbox" name="vkExUnit_auto_eyecatch" value="true" ' . ( ($disable_autoeyecatch)? 'checked' : '' ) . ' />'.__( 'Do not set eyecatch image automatic.', 'vkExUnit' ).'</label>';
|
51 |
|
52 |
}
|
53 |
|
54 |
|
55 |
+
public function save_custom_field( $post_id ) {
|
56 |
|
57 |
+
$metaKeyword = isset( $_POST['_nonce_vkExUnit__custom_auto_eyecatch'] ) ? htmlspecialchars( $_POST['_nonce_vkExUnit__custom_auto_eyecatch'] ) : null;
|
58 |
|
59 |
+
$keyword = get_post_meta( $post_id, 'vkExUnit_metaKeyword', true );
|
60 |
|
61 |
// if autosave then deny
|
62 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
63 |
+
return $post_id; }
|
64 |
|
65 |
+
if ( ! wp_verify_nonce( $metaKeyword, plugin_basename( __FILE__ ) ) ) {
|
66 |
return $post_id;
|
67 |
}
|
68 |
|
69 |
+
delete_post_meta( $post_id, 'vkExUnit_EyeCatch_disable' );
|
70 |
+
if ( isset( $_POST['vkExUnit_auto_eyecatch'] ) && $_POST['vkExUnit_auto_eyecatch'] ) {
|
71 |
+
add_post_meta( $post_id, 'vkExUnit_EyeCatch_disable', true );
|
72 |
}
|
73 |
}
|
74 |
|
75 |
|
76 |
+
public static function is_my_turn() {
|
77 |
|
78 |
+
if ( vkExUnit_is_excerpt() ) { return false; }
|
79 |
|
80 |
+
if ( get_the_id() ) {
|
81 |
|
82 |
+
if ( in_array( get_post_type( get_the_id() ), self::$allowed_post_types ) ) {
|
83 |
|
84 |
+
if ( has_post_thumbnail( get_the_id() ) ) {
|
85 |
|
86 |
+
if ( ! get_post_meta( get_the_id(), 'vkExUnit_EyeCatch_disable', true ) ) {
|
87 |
|
88 |
return true;
|
89 |
}
|
95 |
}
|
96 |
|
97 |
|
98 |
+
public function set_eyecatch( $content ) {
|
99 |
|
100 |
+
if ( ! self::is_my_turn() ) { return $content; }
|
101 |
|
102 |
$imageHtml = self::render_eyecatch( get_the_id() );
|
103 |
|
107 |
}
|
108 |
|
109 |
|
110 |
+
public function render_eyecatch( $post_id ) {
|
111 |
$html = '';
|
112 |
|
113 |
$image_tag = get_the_post_thumbnail( $post_id, 'large' );
|
115 |
$html = '<div class="veu_autoEyeCatchBox">' . $image_tag . '</div>';
|
116 |
return $html;
|
117 |
}
|
|
|
118 |
}
|
119 |
|
120 |
+
vExUnit_eyecatch::instance();
|
plugins/call_to_action/call_to_action.php
CHANGED
@@ -10,4 +10,4 @@
|
|
10 |
|
11 |
require_once vkExUnit_get_directory() . '/plugins/call_to_action/class.call_to_action.php';
|
12 |
|
13 |
-
vExUnit_call_responce::instance();
|
10 |
|
11 |
require_once vkExUnit_get_directory() . '/plugins/call_to_action/class.call_to_action.php';
|
12 |
|
13 |
+
vExUnit_call_responce::instance();
|
plugins/call_to_action/class.call_to_action.php
CHANGED
@@ -8,8 +8,8 @@ class vExUnit_call_responce {
|
|
8 |
public $content_number = 100;
|
9 |
|
10 |
public static function instance() {
|
11 |
-
if ( isset( self::$instance ) )
|
12 |
-
return self::$instance;
|
13 |
|
14 |
self::$instance = new vExUnit_call_responce;
|
15 |
self::$instance->run_init();
|
@@ -23,11 +23,11 @@ class vExUnit_call_responce {
|
|
23 |
|
24 |
|
25 |
protected function run_init() {
|
26 |
-
add_action( 'init', array($this, 'set_posttype') );
|
27 |
-
add_action( 'admin_init', array($this, 'option_init') );
|
28 |
-
add_action( 'admin_menu', array($this, 'add_custom_field') );
|
29 |
-
add_action( 'save_post', array($this, 'save_custom_field') );
|
30 |
-
add_filter( 'the_content', array($this, 'content_filter'), $this->content_number, 1 );
|
31 |
}
|
32 |
|
33 |
|
@@ -41,13 +41,13 @@ class vExUnit_call_responce {
|
|
41 |
}
|
42 |
|
43 |
|
44 |
-
public function set_posttype(){
|
45 |
$labels = array(
|
46 |
'name' => 'CTA',
|
47 |
'singular_name' => 'CTA',
|
48 |
-
'edit_item' => __('Edit CTA', 'vkExUnit'),
|
49 |
-
'add_new_item' => __('Add new CTA', 'vkExUnit'),
|
50 |
-
'new_item' => __('New CTA', 'vkExUnit'),
|
51 |
);
|
52 |
|
53 |
$args = array(
|
@@ -70,46 +70,46 @@ class vExUnit_call_responce {
|
|
70 |
}
|
71 |
|
72 |
|
73 |
-
public function add_custom_field(){
|
74 |
$post_types = get_post_types( array( '_builtin' => false, 'public' => true ) );
|
75 |
-
while( list($key, $post ) = each( $post_types ) ){
|
76 |
-
add_meta_box('vkExUnit_cta', __('Call to Action setting', 'vkExUnit'), array( $this, 'render_meta_box' ), $post, 'normal', 'high');
|
77 |
}
|
78 |
-
add_meta_box('vkExUnit_cta', __('Call to Action setting', 'vkExUnit'), array( $this, 'render_meta_box' ), 'page', 'normal', 'high');
|
79 |
-
add_meta_box('vkExUnit_cta', __('Call to Action setting', 'vkExUnit'), array( $this, 'render_meta_box' ), 'post', 'normal', 'high');
|
80 |
|
81 |
-
add_meta_box('vkExUnit_cta_url', __('CTA Contents', 'vkExUnit'), array( $this, 'render_meta_box_cta' ), self::$posttype_name, 'normal', 'high');
|
82 |
}
|
83 |
|
84 |
|
85 |
-
public function render_meta_box(){
|
86 |
-
echo '<input type="hidden" name="_nonce_vkExUnit_custom_cta" id="_nonce_vkExUnit__custom_field_metaKeyword" value="'.wp_create_nonce(plugin_basename(__FILE__)).'" />';
|
87 |
|
88 |
-
$ctas = self::get_ctas(true, ' - ');
|
89 |
-
array_unshift( $ctas, array( 'key' => 0, 'label' => __('Follow common setting', 'vkExUnit') ) );
|
90 |
-
$ctas[] = array( 'key' => 'disable', 'label' => __('Disable display', 'vkExUnit') );
|
91 |
-
$now = get_post_meta(get_the_id(),'vkexunit_cta_each_option', true);
|
92 |
?>
|
93 |
<input type="hidden" name="_vkExUnit_cta_switch" value="cta_number" />
|
94 |
|
95 |
<select name="vkexunit_cta_each_option" id="vkexunit_cta_each_option">
|
96 |
-
<?php foreach($ctas as $cta):
|
97 |
<option value="<?php echo $cta['key'] ?>" <?php echo($cta['key'] == $now)? 'selected':''; ?> ><?php echo $cta['label'] ?></option>
|
98 |
<?php endforeach; ?>
|
99 |
</select>
|
100 |
<p>
|
101 |
-
<a href="<?php echo admin_url('admin.php?page=vkExUnit_main_setting#vkExUnit_cta_settings'); ?>" class="button button-default" target="_blank"><?php _e('CTA common setting', 'vkExUnit'); ?></a>
|
102 |
-
<a href="<?php echo admin_url('edit.php?post_type=cta') ?>" class="button button-default" target="_blank"><?php _e('Show CTA index page', 'vkExUnit'); ?></a>
|
103 |
</p>
|
104 |
<?php
|
105 |
}
|
106 |
|
107 |
|
108 |
-
public function render_meta_box_cta(){
|
109 |
-
echo '<input type="hidden" name="_nonce_vkExUnit_custom_cta" id="_nonce_vkExUnit__custom_field_metaKeyword" value="'.wp_create_nonce(plugin_basename(__FILE__)).'" />';
|
110 |
-
$imgid = get_post_meta(get_the_id(), 'vkExUnit_cta_img', true);
|
111 |
-
$cta_image = wp_get_attachment_image_src($imgid);
|
112 |
-
$image_position = get_post_meta(get_the_id(), 'vkExUnit_cta_img_position', true);
|
113 |
?>
|
114 |
<style>
|
115 |
#message.updated a {display:none;}
|
@@ -128,265 +128,264 @@ class vExUnit_call_responce {
|
|
128 |
</style>
|
129 |
<script type="text/javascript">
|
130 |
jQuery(document).ready(function($){
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
|
135 |
-
|
136 |
-
|
137 |
-
|
138 |
-
|
139 |
-
|
140 |
-
|
141 |
-
|
142 |
-
|
143 |
-
|
144 |
-
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
|
151 |
-
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
-
|
159 |
-
|
160 |
-
|
161 |
-
|
162 |
});
|
163 |
</script>
|
164 |
<input type="hidden" name="_vkExUnit_cta_switch" value="cta_content" />
|
165 |
<table class="form-table">
|
166 |
<tr>
|
167 |
-
<th><?php _e('CTA image', 'vkExUnit'); ?></th>
|
168 |
<td>
|
169 |
-
|
170 |
<img id="cta-thumbnail_image" src="<?php echo ($cta_image)? $cta_image[0] : ''; ?>" class="<?php echo ($cta_image)? '' : 'noimage'; ?>" />
|
171 |
-
|
172 |
<div id="cta-thumbnail_control" class="<?php echo ($cta_image)? 'change' : 'add'; ?>">
|
173 |
-
<button id="media_thumb_url_add" class="cta-media_btn button button-default"><?php _e('Add image', 'vkExUnit'); ?></button>
|
174 |
-
<button id="media_thumb_url_change" class="cta-media_btn button button-default"><?php _e('Change image', 'vkExUnit'); ?></button>
|
175 |
-
<button id="media_thumb_url_remove" class="button button-default"><?php _e('Remove image', 'vkExUnit'); ?></button>
|
176 |
-
|
177 |
<input type="hidden" name="vkExUnit_cta_img" class="vkExUnit_cta_img" value="<?php echo $imgid; ?>" />
|
178 |
</td>
|
179 |
</tr>
|
180 |
-
<tr><th><label for="vkExUnit_cta_img_position"><?php _e('CTA image position', 'vkExUnit'); ?></label></th>
|
181 |
<td>
|
182 |
-
|
183 |
-
<option value="right" <?php echo ($image_position == 'right')? 'selected' : ''; ?> ><?php _e('right', 'vkExUnit'); ?></option>
|
184 |
-
<option value="center" <?php echo ($image_position == 'center')? 'selected' : ''; ?> ><?php _e('center', 'vkExUnit'); ?></option>
|
185 |
-
<option value="left" <?php echo ($image_position == 'left')? 'selected' : ''; ?> ><?php _e('left', 'vkExUnit'); ?></option>
|
186 |
-
|
187 |
</td></tr>
|
188 |
<tr><th>
|
189 |
-
<label for="vkExUnit_cta_button_text"><?php _e('Button text', 'vkExUnit'); ?></label></th><td>
|
190 |
-
<input type="text" name="vkExUnit_cta_button_text" id="vkExUnit_cta_button_text" value="<?php echo get_post_meta(get_the_id(), 'vkExUnit_cta_button_text', true); ?>" />
|
191 |
</td></tr><tr><th>
|
192 |
-
<label for="vkExUnit_cta_url"><?php _e('Button link url', 'vkExUnit'); ?></label></th><td>
|
193 |
-
<input type="url" name="vkExUnit_cta_url" id="vkExUnit_cta_url" placeholder="http://" value="<?php echo get_post_meta(get_the_id(), 'vkExUnit_cta_url', true); ?>" />
|
194 |
</td></tr>
|
195 |
-
<tr><th><label for="vkExUnit_cta_text"><?php _e('Text message', 'vkExUnit'); ?>
|
196 |
</th>
|
197 |
<td>
|
198 |
-
<textarea name="vkExUnit_cta_text" id="vkExUnit_cta_text" rows="10em" cols="50em"><?php echo get_post_meta(get_the_id(), 'vkExUnit_cta_text', true); ?></textarea>
|
199 |
</td></tr>
|
200 |
</table>
|
201 |
-
<a href="<?php echo admin_url('admin.php?page=vkExUnit_main_setting#vkExUnit_cta_settings'); ?>" class="button button-default" target="_blank"><?php _e('CTA setting', 'vkExUnit'); ?></a>
|
202 |
<?php
|
203 |
}
|
204 |
|
205 |
|
206 |
-
public function save_custom_field( $post_id ){
|
207 |
-
if( !isset( $_POST['_vkExUnit_cta_switch'] ) ) return $post_id;
|
208 |
-
$noonce = isset($_POST['_nonce_vkExUnit_custom_cta']) ? htmlspecialchars($_POST['_nonce_vkExUnit_custom_cta']) : null;
|
209 |
|
210 |
// if autosave is to deny
|
211 |
-
if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
212 |
-
|
213 |
|
214 |
-
if(!wp_verify_nonce($noonce, plugin_basename(__FILE__))){
|
215 |
return $post_id;
|
216 |
}
|
217 |
|
218 |
-
if( $_POST['_vkExUnit_cta_switch'] == 'cta_number' ){
|
219 |
$data = $_POST['vkexunit_cta_each_option'];
|
220 |
|
221 |
-
if(get_post_meta($post_id, 'vkexunit_cta_each_option') ==
|
222 |
-
add_post_meta($post_id, 'vkexunit_cta_each_option', $data, true);
|
223 |
-
}elseif($data != get_post_meta($post_id, 'vkexunit_cta_each_option', true)){
|
224 |
-
update_post_meta($post_id, 'vkexunit_cta_each_option', $data);
|
225 |
-
}elseif(
|
226 |
-
delete_post_meta($post_id, 'vkexunit_cta_each_option', get_post_meta($post_id, 'vkexunit_cta_each_option', true));
|
227 |
}
|
228 |
return $post_id;
|
229 |
-
}
|
230 |
-
elseif( $_POST['_vkExUnit_cta_switch'] == 'cta_content' ){
|
231 |
$data = $_POST['vkExUnit_cta_img'];
|
232 |
-
if(get_post_meta($post_id, 'vkExUnit_cta_img') ==
|
233 |
-
add_post_meta($post_id, 'vkExUnit_cta_img', $data, true);
|
234 |
-
}elseif($data != get_post_meta($post_id, 'vkExUnit_cta_img', true)){
|
235 |
-
update_post_meta($post_id, 'vkExUnit_cta_img', $data);
|
236 |
-
}elseif(
|
237 |
-
delete_post_meta($post_id, 'vkExUnit_cta_img', get_post_meta($post_id, 'vkExUnit_cta_img', true));
|
238 |
}
|
239 |
|
240 |
$data = $_POST['vkExUnit_cta_img_position'];
|
241 |
-
if(get_post_meta($post_id, 'vkExUnit_cta_img_position') ==
|
242 |
-
add_post_meta($post_id, 'vkExUnit_cta_img_position', $data, true);
|
243 |
-
}elseif($data != get_post_meta($post_id, 'vkExUnit_cta_img_position', true)){
|
244 |
-
update_post_meta($post_id, 'vkExUnit_cta_img_position', $data);
|
245 |
-
}elseif(
|
246 |
-
delete_post_meta($post_id, 'vkExUnit_cta_img_position', get_post_meta($post_id, 'vkExUnit_cta_img_position', true));
|
247 |
}
|
248 |
|
249 |
-
$data = stripslashes($_POST['vkExUnit_cta_button_text']);
|
250 |
-
if(get_post_meta($post_id, 'vkExUnit_cta_button_text') ==
|
251 |
-
add_post_meta($post_id, 'vkExUnit_cta_button_text', $data, true);
|
252 |
-
}elseif($data != get_post_meta($post_id, 'vkExUnit_cta_button_text', true)){
|
253 |
-
update_post_meta($post_id, 'vkExUnit_cta_button_text', $data);
|
254 |
-
}elseif(
|
255 |
-
delete_post_meta($post_id, 'vkExUnit_cta_button_text', get_post_meta($post_id, 'vkExUnit_cta_button_text', true));
|
256 |
}
|
257 |
|
258 |
$data = $_POST['vkExUnit_cta_url'];
|
259 |
|
260 |
-
if(get_post_meta($post_id, 'vkExUnit_cta_url') ==
|
261 |
-
add_post_meta($post_id, 'vkExUnit_cta_url', $data, true);
|
262 |
-
}elseif($data != get_post_meta($post_id, 'vkExUnit_cta_url', true)){
|
263 |
-
update_post_meta($post_id, 'vkExUnit_cta_url', $data);
|
264 |
-
}elseif(
|
265 |
-
delete_post_meta($post_id, 'vkExUnit_cta_url', get_post_meta($post_id, 'vkExUnit_cta_url', true));
|
266 |
}
|
267 |
|
268 |
-
$data = stripslashes($_POST['vkExUnit_cta_text']);
|
269 |
-
if(get_post_meta($post_id, 'vkExUnit_cta_text') ==
|
270 |
-
add_post_meta($post_id, 'vkExUnit_cta_text', $data, true);
|
271 |
-
}elseif($data != get_post_meta($post_id, 'vkExUnit_cta_text', true)){
|
272 |
-
update_post_meta($post_id, 'vkExUnit_cta_text', $data);
|
273 |
-
}elseif(
|
274 |
-
delete_post_meta($post_id, 'vkExUnit_cta_text', get_post_meta($post_id, 'vkExUnit_cta_text', true));
|
275 |
}
|
276 |
return $post_id;
|
277 |
}
|
278 |
}
|
279 |
|
280 |
|
281 |
-
public static function get_cta_post( $id ){
|
282 |
$args = array(
|
283 |
'post_type' => self::$posttype_name,
|
284 |
'p' => $id,
|
285 |
-
'post_count' => 1
|
286 |
);
|
287 |
$query = new WP_Query( $args );
|
288 |
-
if(
|
289 |
|
290 |
return $query->posts[0];
|
291 |
}
|
292 |
|
293 |
|
294 |
-
public static function render_cta_content( $id ){
|
295 |
-
if(
|
296 |
-
$post = self::get_cta_post($id);
|
297 |
-
if(
|
298 |
|
299 |
include vkExUnit_get_directory() . '/plugins/call_to_action/view.actionbox.php';
|
300 |
return $content;
|
301 |
}
|
302 |
|
303 |
|
304 |
-
public function is_cta_id( $id=null ){
|
305 |
-
if(
|
306 |
-
if(
|
307 |
|
308 |
$post_config = get_post_meta( $id, 'vkexunit_cta_each_option', true );
|
309 |
|
310 |
-
if( $post_config ){
|
311 |
-
if( $post_config == 'disable' ) return null;
|
312 |
return $post_config;
|
313 |
}
|
314 |
|
315 |
$post_type = get_post_type( $id );
|
316 |
$option = self::get_option();
|
317 |
-
if( isset( $option[$post_type] ) && is_numeric( $option[$post_type] ) ) return $option[$post_type] ;
|
318 |
return null;
|
319 |
}
|
320 |
|
321 |
|
322 |
-
public function content_filter( $content ){
|
323 |
-
if( self::is_pagewidget() ) return $content;
|
324 |
-
if( vkExUnit_is_excerpt() ) return $content;
|
325 |
$content .= self::render_cta_content( $this->is_cta_id() );
|
326 |
return $content;
|
327 |
}
|
328 |
|
329 |
|
330 |
-
public static function is_pagewidget(){
|
331 |
global $is_pagewidget;
|
332 |
return ($is_pagewidget)? true : false;
|
333 |
}
|
334 |
|
335 |
|
336 |
-
public function sanitize_config( $input ){
|
337 |
-
$posttypes = array_merge( array( 'post'=>'post', 'page'=>'page' ), get_post_types( array( 'public'=>true, '_builtin'=>false ), 'names' ) );
|
338 |
$option = get_option( 'vkExUnit_cta_settings' );
|
339 |
-
if(
|
340 |
|
341 |
-
while(list($key, $value) = each($input)){
|
342 |
-
$option[$key] = ( is_numeric( $value ) )? $value : 0 ;
|
343 |
}
|
344 |
return $option;
|
345 |
}
|
346 |
|
347 |
|
348 |
-
public static function get_default_option(){
|
349 |
$option = array();
|
350 |
-
$posttypes = array_merge( array( 'post'=>'post', 'page'=>'page'), get_post_types( array( 'public'=>true, '_builtin'=>false ), 'names' ));
|
351 |
-
while( list($key, $posttype) = each( $posttypes ) ){
|
352 |
$option[ $posttype ] = false;
|
353 |
}
|
354 |
return $option;
|
355 |
}
|
356 |
|
357 |
|
358 |
-
public static function get_option( $show_label=false ){
|
359 |
$default = self::get_default_option();
|
360 |
$option = get_option( 'vkExUnit_cta_settings' );
|
361 |
|
362 |
-
if(
|
363 |
|
364 |
-
$posttypes = array_merge( array( 'post'=>'post', 'page'=>'page' ), get_post_types( array( 'public'=>true, '_builtin'=>false ), 'names' ));
|
365 |
|
366 |
$output_option = array();
|
367 |
-
while(list($key, $value) = each($posttypes)){
|
368 |
-
$output_option[$value] = ( isset( $option[$value] ) )? $option[$value] : $default[$value];
|
369 |
}
|
370 |
|
371 |
return $output_option;
|
372 |
}
|
373 |
|
374 |
|
375 |
-
public function get_ctas( $show_label=false, $head='' ){
|
376 |
$args = array(
|
377 |
'post_type' => self::$posttype_name,
|
378 |
'nopaging' => true,
|
379 |
-
'post_count' => -1
|
380 |
);
|
381 |
-
$query = new WP_Query($args);
|
382 |
$ctas = array();
|
383 |
-
while( list($key, $post) = each( $query->posts ) ){
|
384 |
-
if($show_label){
|
385 |
$ctas[] = array(
|
386 |
'key' => $post->ID,
|
387 |
-
'label' => $head . $post->post_title
|
388 |
);
|
389 |
-
}else{
|
390 |
$ctas[] = $post->ID;
|
391 |
}
|
392 |
}
|
@@ -394,11 +393,11 @@ jQuery(document).ready(function($){
|
|
394 |
}
|
395 |
|
396 |
|
397 |
-
public function render_configPage(){
|
398 |
$options = self::get_option();
|
399 |
-
$ctas = self::get_ctas(true, ' - ');
|
400 |
-
array_unshift( $ctas, array( 'key' => 0, 'label' => __('Disable display', 'vkExUnit') ) );
|
401 |
|
402 |
include vkExUnit_get_directory() . '/plugins/call_to_action/view.adminsetting.php';
|
403 |
}
|
404 |
-
}
|
8 |
public $content_number = 100;
|
9 |
|
10 |
public static function instance() {
|
11 |
+
if ( isset( self::$instance ) ) {
|
12 |
+
return self::$instance; }
|
13 |
|
14 |
self::$instance = new vExUnit_call_responce;
|
15 |
self::$instance->run_init();
|
23 |
|
24 |
|
25 |
protected function run_init() {
|
26 |
+
add_action( 'init', array( $this, 'set_posttype' ) );
|
27 |
+
add_action( 'admin_init', array( $this, 'option_init' ) );
|
28 |
+
add_action( 'admin_menu', array( $this, 'add_custom_field' ) );
|
29 |
+
add_action( 'save_post', array( $this, 'save_custom_field' ) );
|
30 |
+
add_filter( 'the_content', array( $this, 'content_filter' ), $this->content_number, 1 );
|
31 |
}
|
32 |
|
33 |
|
41 |
}
|
42 |
|
43 |
|
44 |
+
public function set_posttype() {
|
45 |
$labels = array(
|
46 |
'name' => 'CTA',
|
47 |
'singular_name' => 'CTA',
|
48 |
+
'edit_item' => __( 'Edit CTA', 'vkExUnit' ),
|
49 |
+
'add_new_item' => __( 'Add new CTA', 'vkExUnit' ),
|
50 |
+
'new_item' => __( 'New CTA', 'vkExUnit' ),
|
51 |
);
|
52 |
|
53 |
$args = array(
|
70 |
}
|
71 |
|
72 |
|
73 |
+
public function add_custom_field() {
|
74 |
$post_types = get_post_types( array( '_builtin' => false, 'public' => true ) );
|
75 |
+
while ( list($key, $post ) = each( $post_types ) ) {
|
76 |
+
add_meta_box( 'vkExUnit_cta', __( 'Call to Action setting', 'vkExUnit' ), array( $this, 'render_meta_box' ), $post, 'normal', 'high' );
|
77 |
}
|
78 |
+
add_meta_box( 'vkExUnit_cta', __( 'Call to Action setting', 'vkExUnit' ), array( $this, 'render_meta_box' ), 'page', 'normal', 'high' );
|
79 |
+
add_meta_box( 'vkExUnit_cta', __( 'Call to Action setting', 'vkExUnit' ), array( $this, 'render_meta_box' ), 'post', 'normal', 'high' );
|
80 |
|
81 |
+
add_meta_box( 'vkExUnit_cta_url', __( 'CTA Contents', 'vkExUnit' ), array( $this, 'render_meta_box_cta' ), self::$posttype_name, 'normal', 'high' );
|
82 |
}
|
83 |
|
84 |
|
85 |
+
public function render_meta_box() {
|
86 |
+
echo '<input type="hidden" name="_nonce_vkExUnit_custom_cta" id="_nonce_vkExUnit__custom_field_metaKeyword" value="'.wp_create_nonce( plugin_basename( __FILE__ ) ).'" />';
|
87 |
|
88 |
+
$ctas = self::get_ctas( true, ' - ' );
|
89 |
+
array_unshift( $ctas, array( 'key' => 0, 'label' => __( 'Follow common setting', 'vkExUnit' ) ) );
|
90 |
+
$ctas[] = array( 'key' => 'disable', 'label' => __( 'Disable display', 'vkExUnit' ) );
|
91 |
+
$now = get_post_meta( get_the_id(),'vkexunit_cta_each_option', true );
|
92 |
?>
|
93 |
<input type="hidden" name="_vkExUnit_cta_switch" value="cta_number" />
|
94 |
|
95 |
<select name="vkexunit_cta_each_option" id="vkexunit_cta_each_option">
|
96 |
+
<?php foreach ( $ctas as $cta ) : ?>
|
97 |
<option value="<?php echo $cta['key'] ?>" <?php echo($cta['key'] == $now)? 'selected':''; ?> ><?php echo $cta['label'] ?></option>
|
98 |
<?php endforeach; ?>
|
99 |
</select>
|
100 |
<p>
|
101 |
+
<a href="<?php echo admin_url( 'admin.php?page=vkExUnit_main_setting#vkExUnit_cta_settings' ); ?>" class="button button-default" target="_blank"><?php _e( 'CTA common setting', 'vkExUnit' ); ?></a>
|
102 |
+
<a href="<?php echo admin_url( 'edit.php?post_type=cta' ) ?>" class="button button-default" target="_blank"><?php _e( 'Show CTA index page', 'vkExUnit' ); ?></a>
|
103 |
</p>
|
104 |
<?php
|
105 |
}
|
106 |
|
107 |
|
108 |
+
public function render_meta_box_cta() {
|
109 |
+
echo '<input type="hidden" name="_nonce_vkExUnit_custom_cta" id="_nonce_vkExUnit__custom_field_metaKeyword" value="'.wp_create_nonce( plugin_basename( __FILE__ ) ).'" />';
|
110 |
+
$imgid = get_post_meta( get_the_id(), 'vkExUnit_cta_img', true );
|
111 |
+
$cta_image = wp_get_attachment_image_src( $imgid, 'large' );
|
112 |
+
$image_position = get_post_meta( get_the_id(), 'vkExUnit_cta_img_position', true );
|
113 |
?>
|
114 |
<style>
|
115 |
#message.updated a {display:none;}
|
128 |
</style>
|
129 |
<script type="text/javascript">
|
130 |
jQuery(document).ready(function($){
|
131 |
+
var custom_uploader;
|
132 |
+
jQuery('.cta-media_btn').click(function(e) {
|
133 |
+
e.preventDefault();
|
134 |
+
|
135 |
+
if (custom_uploader) {
|
136 |
+
custom_uploader.open();
|
137 |
+
return;
|
138 |
+
}
|
139 |
+
custom_uploader = wp.media({
|
140 |
+
title: 'Choose Image',
|
141 |
+
library: {type: 'image'},
|
142 |
+
button: {text: 'Choose Image'},
|
143 |
+
multiple: false,
|
144 |
+
});
|
145 |
+
|
146 |
+
custom_uploader.on('select', function() {
|
147 |
+
var images = custom_uploader.state().get('selection');
|
148 |
+
images.each(function(file){
|
149 |
+
jQuery('#cta-thumbnail_image').attr('src', file.toJSON().url).removeClass("noimage");
|
150 |
+
jQuery('.vkExUnit_cta_img').val(file.toJSON().id);
|
151 |
+
jQuery('#cta-thumbnail_control').removeClass("add").addClass("change");
|
152 |
+
});
|
153 |
+
});
|
154 |
+
custom_uploader.open();
|
155 |
+
});
|
156 |
+
jQuery('#cta-thumbnail_control #media_thumb_url_remove').on('click', function(){
|
157 |
+
jQuery('#cta-thumbnail_image').attr('src', '').addClass("noimage");
|
158 |
+
jQuery('.vkExUnit_cta_img').val('');
|
159 |
+
jQuery('#cta-thumbnail_control').removeClass("change").addClass("add");
|
160 |
+
return false;
|
161 |
+
});
|
162 |
});
|
163 |
</script>
|
164 |
<input type="hidden" name="_vkExUnit_cta_switch" value="cta_content" />
|
165 |
<table class="form-table">
|
166 |
<tr>
|
167 |
+
<th><?php _e( 'CTA image', 'vkExUnit' ); ?></th>
|
168 |
<td>
|
169 |
+
<div id="cta-thumbnail_box" >
|
170 |
<img id="cta-thumbnail_image" src="<?php echo ($cta_image)? $cta_image[0] : ''; ?>" class="<?php echo ($cta_image)? '' : 'noimage'; ?>" />
|
171 |
+
</div>
|
172 |
<div id="cta-thumbnail_control" class="<?php echo ($cta_image)? 'change' : 'add'; ?>">
|
173 |
+
<button id="media_thumb_url_add" class="cta-media_btn button button-default"><?php _e( 'Add image', 'vkExUnit' ); ?></button>
|
174 |
+
<button id="media_thumb_url_change" class="cta-media_btn button button-default"><?php _e( 'Change image', 'vkExUnit' ); ?></button>
|
175 |
+
<button id="media_thumb_url_remove" class="button button-default"><?php _e( 'Remove image', 'vkExUnit' ); ?></button>
|
176 |
+
</div>
|
177 |
<input type="hidden" name="vkExUnit_cta_img" class="vkExUnit_cta_img" value="<?php echo $imgid; ?>" />
|
178 |
</td>
|
179 |
</tr>
|
180 |
+
<tr><th><label for="vkExUnit_cta_img_position"><?php _e( 'CTA image position', 'vkExUnit' ); ?></label></th>
|
181 |
<td>
|
182 |
+
<select name="vkExUnit_cta_img_position" id="vkExUnit_cta_img_position">
|
183 |
+
<option value="right" <?php echo ($image_position == 'right')? 'selected' : ''; ?> ><?php _e( 'right', 'vkExUnit' ); ?></option>
|
184 |
+
<option value="center" <?php echo ($image_position == 'center')? 'selected' : ''; ?> ><?php _e( 'center', 'vkExUnit' ); ?></option>
|
185 |
+
<option value="left" <?php echo ($image_position == 'left')? 'selected' : ''; ?> ><?php _e( 'left', 'vkExUnit' ); ?></option>
|
186 |
+
</select>
|
187 |
</td></tr>
|
188 |
<tr><th>
|
189 |
+
<label for="vkExUnit_cta_button_text"><?php _e( 'Button text', 'vkExUnit' ); ?></label></th><td>
|
190 |
+
<input type="text" name="vkExUnit_cta_button_text" id="vkExUnit_cta_button_text" value="<?php echo get_post_meta( get_the_id(), 'vkExUnit_cta_button_text', true ); ?>" />
|
191 |
</td></tr><tr><th>
|
192 |
+
<label for="vkExUnit_cta_url"><?php _e( 'Button link url', 'vkExUnit' ); ?></label></th><td>
|
193 |
+
<input type="url" name="vkExUnit_cta_url" id="vkExUnit_cta_url" placeholder="http://" value="<?php echo get_post_meta( get_the_id(), 'vkExUnit_cta_url', true ); ?>" />
|
194 |
</td></tr>
|
195 |
+
<tr><th><label for="vkExUnit_cta_text"><?php _e( 'Text message', 'vkExUnit' ); ?>
|
196 |
</th>
|
197 |
<td>
|
198 |
+
<textarea name="vkExUnit_cta_text" id="vkExUnit_cta_text" rows="10em" cols="50em"><?php echo get_post_meta( get_the_id(), 'vkExUnit_cta_text', true ); ?></textarea>
|
199 |
</td></tr>
|
200 |
</table>
|
201 |
+
<a href="<?php echo admin_url( 'admin.php?page=vkExUnit_main_setting#vkExUnit_cta_settings' ); ?>" class="button button-default" target="_blank"><?php _e( 'CTA setting', 'vkExUnit' ); ?></a>
|
202 |
<?php
|
203 |
}
|
204 |
|
205 |
|
206 |
+
public function save_custom_field( $post_id ) {
|
207 |
+
if ( ! isset( $_POST['_vkExUnit_cta_switch'] ) ) { return $post_id; }
|
208 |
+
$noonce = isset( $_POST['_nonce_vkExUnit_custom_cta'] ) ? htmlspecialchars( $_POST['_nonce_vkExUnit_custom_cta'] ) : null;
|
209 |
|
210 |
// if autosave is to deny
|
211 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
212 |
+
return $post_id; }
|
213 |
|
214 |
+
if ( ! wp_verify_nonce( $noonce, plugin_basename( __FILE__ ) ) ) {
|
215 |
return $post_id;
|
216 |
}
|
217 |
|
218 |
+
if ( $_POST['_vkExUnit_cta_switch'] == 'cta_number' ) {
|
219 |
$data = $_POST['vkexunit_cta_each_option'];
|
220 |
|
221 |
+
if ( get_post_meta( $post_id, 'vkexunit_cta_each_option' ) == '' ) {
|
222 |
+
add_post_meta( $post_id, 'vkexunit_cta_each_option', $data, true );
|
223 |
+
} elseif ( $data != get_post_meta( $post_id, 'vkexunit_cta_each_option', true ) ) {
|
224 |
+
update_post_meta( $post_id, 'vkexunit_cta_each_option', $data );
|
225 |
+
} elseif ( ! $data ) {
|
226 |
+
delete_post_meta( $post_id, 'vkexunit_cta_each_option', get_post_meta( $post_id, 'vkexunit_cta_each_option', true ) );
|
227 |
}
|
228 |
return $post_id;
|
229 |
+
} elseif ( $_POST['_vkExUnit_cta_switch'] == 'cta_content' ) {
|
|
|
230 |
$data = $_POST['vkExUnit_cta_img'];
|
231 |
+
if ( get_post_meta( $post_id, 'vkExUnit_cta_img' ) == '' ) {
|
232 |
+
add_post_meta( $post_id, 'vkExUnit_cta_img', $data, true );
|
233 |
+
} elseif ( $data != get_post_meta( $post_id, 'vkExUnit_cta_img', true ) ) {
|
234 |
+
update_post_meta( $post_id, 'vkExUnit_cta_img', $data );
|
235 |
+
} elseif ( ! $data ) {
|
236 |
+
delete_post_meta( $post_id, 'vkExUnit_cta_img', get_post_meta( $post_id, 'vkExUnit_cta_img', true ) );
|
237 |
}
|
238 |
|
239 |
$data = $_POST['vkExUnit_cta_img_position'];
|
240 |
+
if ( get_post_meta( $post_id, 'vkExUnit_cta_img_position' ) == '' ) {
|
241 |
+
add_post_meta( $post_id, 'vkExUnit_cta_img_position', $data, true );
|
242 |
+
} elseif ( $data != get_post_meta( $post_id, 'vkExUnit_cta_img_position', true ) ) {
|
243 |
+
update_post_meta( $post_id, 'vkExUnit_cta_img_position', $data );
|
244 |
+
} elseif ( ! $data ) {
|
245 |
+
delete_post_meta( $post_id, 'vkExUnit_cta_img_position', get_post_meta( $post_id, 'vkExUnit_cta_img_position', true ) );
|
246 |
}
|
247 |
|
248 |
+
$data = stripslashes( $_POST['vkExUnit_cta_button_text'] );
|
249 |
+
if ( get_post_meta( $post_id, 'vkExUnit_cta_button_text' ) == '' ) {
|
250 |
+
add_post_meta( $post_id, 'vkExUnit_cta_button_text', $data, true );
|
251 |
+
} elseif ( $data != get_post_meta( $post_id, 'vkExUnit_cta_button_text', true ) ) {
|
252 |
+
update_post_meta( $post_id, 'vkExUnit_cta_button_text', $data );
|
253 |
+
} elseif ( ! $data ) {
|
254 |
+
delete_post_meta( $post_id, 'vkExUnit_cta_button_text', get_post_meta( $post_id, 'vkExUnit_cta_button_text', true ) );
|
255 |
}
|
256 |
|
257 |
$data = $_POST['vkExUnit_cta_url'];
|
258 |
|
259 |
+
if ( get_post_meta( $post_id, 'vkExUnit_cta_url' ) == '' ) {
|
260 |
+
add_post_meta( $post_id, 'vkExUnit_cta_url', $data, true );
|
261 |
+
} elseif ( $data != get_post_meta( $post_id, 'vkExUnit_cta_url', true ) ) {
|
262 |
+
update_post_meta( $post_id, 'vkExUnit_cta_url', $data );
|
263 |
+
} elseif ( ! $data ) {
|
264 |
+
delete_post_meta( $post_id, 'vkExUnit_cta_url', get_post_meta( $post_id, 'vkExUnit_cta_url', true ) );
|
265 |
}
|
266 |
|
267 |
+
$data = stripslashes( $_POST['vkExUnit_cta_text'] );
|
268 |
+
if ( get_post_meta( $post_id, 'vkExUnit_cta_text' ) == '' ) {
|
269 |
+
add_post_meta( $post_id, 'vkExUnit_cta_text', $data, true );
|
270 |
+
} elseif ( $data != get_post_meta( $post_id, 'vkExUnit_cta_text', true ) ) {
|
271 |
+
update_post_meta( $post_id, 'vkExUnit_cta_text', $data );
|
272 |
+
} elseif ( ! $data ) {
|
273 |
+
delete_post_meta( $post_id, 'vkExUnit_cta_text', get_post_meta( $post_id, 'vkExUnit_cta_text', true ) );
|
274 |
}
|
275 |
return $post_id;
|
276 |
}
|
277 |
}
|
278 |
|
279 |
|
280 |
+
public static function get_cta_post( $id ) {
|
281 |
$args = array(
|
282 |
'post_type' => self::$posttype_name,
|
283 |
'p' => $id,
|
284 |
+
'post_count' => 1,
|
285 |
);
|
286 |
$query = new WP_Query( $args );
|
287 |
+
if ( ! $query->post_count ) { return null; }
|
288 |
|
289 |
return $query->posts[0];
|
290 |
}
|
291 |
|
292 |
|
293 |
+
public static function render_cta_content( $id ) {
|
294 |
+
if ( ! $id ) { return ''; }
|
295 |
+
$post = self::get_cta_post( $id );
|
296 |
+
if ( ! $post ) { return ''; }
|
297 |
|
298 |
include vkExUnit_get_directory() . '/plugins/call_to_action/view.actionbox.php';
|
299 |
return $content;
|
300 |
}
|
301 |
|
302 |
|
303 |
+
public function is_cta_id( $id = null ) {
|
304 |
+
if ( ! $id ) { $id = get_the_id(); }
|
305 |
+
if ( ! $id ) { return null; }
|
306 |
|
307 |
$post_config = get_post_meta( $id, 'vkexunit_cta_each_option', true );
|
308 |
|
309 |
+
if ( $post_config ) {
|
310 |
+
if ( $post_config == 'disable' ) { return null; }
|
311 |
return $post_config;
|
312 |
}
|
313 |
|
314 |
$post_type = get_post_type( $id );
|
315 |
$option = self::get_option();
|
316 |
+
if ( isset( $option[ $post_type ] ) && is_numeric( $option[ $post_type ] ) ) { return $option[ $post_type ] ; }
|
317 |
return null;
|
318 |
}
|
319 |
|
320 |
|
321 |
+
public function content_filter( $content ) {
|
322 |
+
if ( self::is_pagewidget() ) { return $content; }
|
323 |
+
if ( vkExUnit_is_excerpt() ) { return $content; }
|
324 |
$content .= self::render_cta_content( $this->is_cta_id() );
|
325 |
return $content;
|
326 |
}
|
327 |
|
328 |
|
329 |
+
public static function is_pagewidget() {
|
330 |
global $is_pagewidget;
|
331 |
return ($is_pagewidget)? true : false;
|
332 |
}
|
333 |
|
334 |
|
335 |
+
public function sanitize_config( $input ) {
|
336 |
+
$posttypes = array_merge( array( 'post' => 'post', 'page' => 'page' ), get_post_types( array( 'public' => true, '_builtin' => false ), 'names' ) );
|
337 |
$option = get_option( 'vkExUnit_cta_settings' );
|
338 |
+
if ( ! $option ) { $current_option = self::get_default_option(); }
|
339 |
|
340 |
+
while ( list($key, $value) = each( $input ) ) {
|
341 |
+
$option[ $key ] = ( is_numeric( $value ) )? $value : 0 ;
|
342 |
}
|
343 |
return $option;
|
344 |
}
|
345 |
|
346 |
|
347 |
+
public static function get_default_option() {
|
348 |
$option = array();
|
349 |
+
$posttypes = array_merge( array( 'post' => 'post', 'page' => 'page' ), get_post_types( array( 'public' => true, '_builtin' => false ), 'names' ) );
|
350 |
+
while ( list($key, $posttype) = each( $posttypes ) ) {
|
351 |
$option[ $posttype ] = false;
|
352 |
}
|
353 |
return $option;
|
354 |
}
|
355 |
|
356 |
|
357 |
+
public static function get_option( $show_label = false ) {
|
358 |
$default = self::get_default_option();
|
359 |
$option = get_option( 'vkExUnit_cta_settings' );
|
360 |
|
361 |
+
if ( ! $option || ! is_array( $option ) ) { return $default; }
|
362 |
|
363 |
+
$posttypes = array_merge( array( 'post' => 'post', 'page' => 'page' ), get_post_types( array( 'public' => true, '_builtin' => false ), 'names' ) );
|
364 |
|
365 |
$output_option = array();
|
366 |
+
while ( list($key, $value) = each( $posttypes ) ) {
|
367 |
+
$output_option[ $value ] = ( isset( $option[ $value ] ) )? $option[ $value ] : $default[ $value ];
|
368 |
}
|
369 |
|
370 |
return $output_option;
|
371 |
}
|
372 |
|
373 |
|
374 |
+
public function get_ctas( $show_label = false, $head = '' ) {
|
375 |
$args = array(
|
376 |
'post_type' => self::$posttype_name,
|
377 |
'nopaging' => true,
|
378 |
+
'post_count' => -1,
|
379 |
);
|
380 |
+
$query = new WP_Query( $args );
|
381 |
$ctas = array();
|
382 |
+
while ( list($key, $post) = each( $query->posts ) ) {
|
383 |
+
if ( $show_label ) {
|
384 |
$ctas[] = array(
|
385 |
'key' => $post->ID,
|
386 |
+
'label' => $head . $post->post_title,
|
387 |
);
|
388 |
+
} else {
|
389 |
$ctas[] = $post->ID;
|
390 |
}
|
391 |
}
|
393 |
}
|
394 |
|
395 |
|
396 |
+
public function render_configPage() {
|
397 |
$options = self::get_option();
|
398 |
+
$ctas = self::get_ctas( true, ' - ' );
|
399 |
+
array_unshift( $ctas, array( 'key' => 0, 'label' => __( 'Disable display', 'vkExUnit' ) ) );
|
400 |
|
401 |
include vkExUnit_get_directory() . '/plugins/call_to_action/view.adminsetting.php';
|
402 |
}
|
403 |
+
}
|
plugins/call_to_action/view.actionbox.php
CHANGED
@@ -2,19 +2,19 @@
|
|
2 |
|
3 |
$btn_text = get_post_meta( $id, 'vkExUnit_cta_button_text', true );
|
4 |
$url = get_post_meta( $id, 'vkExUnit_cta_url', true );
|
5 |
-
$text = get_post_meta( $id, 'vkExUnit_cta_text', true);
|
6 |
-
$text = preg_replace('/\n/', '<br/>', $text);
|
7 |
-
$imgid = get_post_meta( $id, 'vkExUnit_cta_img', true);
|
8 |
|
9 |
|
10 |
-
$image_position = get_post_meta( $id, 'vkExUnit_cta_img_position', true);
|
11 |
-
if(
|
12 |
|
13 |
$content = '';
|
14 |
$content .= '<section class="veu_cta">';
|
15 |
$content .= '<h1 class="cta_title">' . $post->post_title . '</h1>';
|
16 |
$content .= '<div class="cta_body">';
|
17 |
-
if( $imgid ){
|
18 |
$cta_image = wp_get_attachment_image_src( $imgid, 'large' );
|
19 |
$content .= '<div class="cta_body_image cta_body_image_'.$image_position.'">';
|
20 |
$content .= ( $url )? '<a href="'.$url.'" target="_blank">':'';
|
@@ -25,7 +25,7 @@ if( $imgid ){
|
|
25 |
$content .= '<div class="cta_body_txt '.(($imgid)? 'image_exist' : 'image_no').'">';
|
26 |
$content .= $text;
|
27 |
$content .= '</div>';
|
28 |
-
if( $url && $btn_text ){
|
29 |
$content .= '<div class="cta_body_link">';
|
30 |
$content .= '<a href="'.$url.'" class="btn btn-primary btn-block btn-lg" target="_blank">';
|
31 |
$content .= $btn_text;
|
@@ -36,5 +36,5 @@ $content .= '</div><!-- [ /.vkExUnit_cta_body ] -->';
|
|
36 |
$content .= '</section>';
|
37 |
|
38 |
if ( $url = get_edit_post_link( $post->ID ) ) {
|
39 |
-
$content .= '<div class="veu_adminEdit"><a href="'.$url.'" class="btn btn-default">'.__('Edit CTA','vkExUnit').'</a></div>';
|
40 |
-
}
|
2 |
|
3 |
$btn_text = get_post_meta( $id, 'vkExUnit_cta_button_text', true );
|
4 |
$url = get_post_meta( $id, 'vkExUnit_cta_url', true );
|
5 |
+
$text = get_post_meta( $id, 'vkExUnit_cta_text', true );
|
6 |
+
$text = preg_replace( '/\n/', '<br/>', $text );
|
7 |
+
$imgid = get_post_meta( $id, 'vkExUnit_cta_img', true );
|
8 |
|
9 |
|
10 |
+
$image_position = get_post_meta( $id, 'vkExUnit_cta_img_position', true );
|
11 |
+
if ( ! $image_position ) { $image_position = 'right'; }
|
12 |
|
13 |
$content = '';
|
14 |
$content .= '<section class="veu_cta">';
|
15 |
$content .= '<h1 class="cta_title">' . $post->post_title . '</h1>';
|
16 |
$content .= '<div class="cta_body">';
|
17 |
+
if ( $imgid ) {
|
18 |
$cta_image = wp_get_attachment_image_src( $imgid, 'large' );
|
19 |
$content .= '<div class="cta_body_image cta_body_image_'.$image_position.'">';
|
20 |
$content .= ( $url )? '<a href="'.$url.'" target="_blank">':'';
|
25 |
$content .= '<div class="cta_body_txt '.(($imgid)? 'image_exist' : 'image_no').'">';
|
26 |
$content .= $text;
|
27 |
$content .= '</div>';
|
28 |
+
if ( $url && $btn_text ) {
|
29 |
$content .= '<div class="cta_body_link">';
|
30 |
$content .= '<a href="'.$url.'" class="btn btn-primary btn-block btn-lg" target="_blank">';
|
31 |
$content .= $btn_text;
|
36 |
$content .= '</section>';
|
37 |
|
38 |
if ( $url = get_edit_post_link( $post->ID ) ) {
|
39 |
+
$content .= '<div class="veu_adminEdit"><a href="'.$url.'" class="btn btn-default">'.__( 'Edit CTA','vkExUnit' ).'</a></div>';
|
40 |
+
}
|
plugins/call_to_action/view.adminsetting.php
CHANGED
@@ -3,35 +3,35 @@
|
|
3 |
Main setting Page
|
4 |
*/
|
5 |
?>
|
6 |
-
<h3><?php _e('Call To Action', 'vkExUnit'); ?></h3>
|
7 |
|
8 |
<div id="on_setting" class="sectionBox">
|
9 |
<p>
|
10 |
-
<?php _e('Display the CTA at the end of the post content.', 'vkExUnit'); ?><br/>
|
11 |
-
<?php _e('The CTA stands for "Call to action" and this is the area that prompts the user behavior.', 'vkExUnit'); ?><br/>
|
12 |
-
<?php _e('As an example, text message and a link button for induction to the free sample download page.', 'vkExUnit'); ?></p>
|
13 |
|
14 |
-
<h4><?php _e('How to use','vkExUnit');?></h4>
|
15 |
|
16 |
<ol>
|
17 |
-
<li><?php _e('You register the contents on "CTA" that you want to display to bottom of the content.', 'vkExUnit'); ?></li>
|
18 |
-
<li><?php _e('Choose the CTA to be displayed from the following.', 'vkExUnit'); ?></li>
|
19 |
-
<li><?php _e('If you want to switch the CTA to be displayed on each post, please set in the details page of such posting.', 'vkExUnit'); ?></li>
|
20 |
</ol>
|
21 |
|
22 |
-
<a href="<?php echo admin_url('edit.php?post_type=cta') ?>" class="button button-default" target="_blank"><?php _e('Show CTA index page', 'vkExUnit'); ?></a>
|
23 |
|
24 |
<table class="form-table">
|
25 |
-
<?php while( list($type, $value) = each( $options ) ):
|
26 |
-
<tr><th><label ><?php echo get_post_type_object($type)->label; ?></label></th>
|
27 |
<td><select name="vkExUnit_cta_settings[<?php echo $type; ?>]" id="vkExUnit_cta_settings">
|
28 |
-
<?php foreach($ctas as $cta):
|
29 |
<option value="<?php echo $cta['key'] ?>" <?php echo($value == $cta['key'])? 'selected':''; ?> ><?php echo $cta['label'] ?></option>
|
30 |
<?php endforeach; ?>
|
31 |
</select>
|
32 |
-
<a href="<?php echo admin_url('edit.php?post_type=' . $type) ?>" class="button button-default" target="_blank"><?php _e('Show index page', 'vkExUnit'); ?></a>
|
33 |
</td></tr>
|
34 |
<?php endwhile;?>
|
35 |
</table>
|
36 |
<?php submit_button(); ?>
|
37 |
-
</div>
|
3 |
Main setting Page
|
4 |
*/
|
5 |
?>
|
6 |
+
<h3><?php _e( 'Call To Action', 'vkExUnit' ); ?></h3>
|
7 |
|
8 |
<div id="on_setting" class="sectionBox">
|
9 |
<p>
|
10 |
+
<?php _e( 'Display the CTA at the end of the post content.', 'vkExUnit' ); ?><br/>
|
11 |
+
<?php _e( 'The CTA stands for "Call to action" and this is the area that prompts the user behavior.', 'vkExUnit' ); ?><br/>
|
12 |
+
<?php _e( 'As an example, text message and a link button for induction to the free sample download page.', 'vkExUnit' ); ?></p>
|
13 |
|
14 |
+
<h4><?php _e( 'How to use','vkExUnit' );?></h4>
|
15 |
|
16 |
<ol>
|
17 |
+
<li><?php _e( 'You register the contents on "CTA" that you want to display to bottom of the content.', 'vkExUnit' ); ?></li>
|
18 |
+
<li><?php _e( 'Choose the CTA to be displayed from the following.', 'vkExUnit' ); ?></li>
|
19 |
+
<li><?php _e( 'If you want to switch the CTA to be displayed on each post, please set in the details page of such posting.', 'vkExUnit' ); ?></li>
|
20 |
</ol>
|
21 |
|
22 |
+
<a href="<?php echo admin_url( 'edit.php?post_type=cta' ) ?>" class="button button-default" target="_blank"><?php _e( 'Show CTA index page', 'vkExUnit' ); ?></a>
|
23 |
|
24 |
<table class="form-table">
|
25 |
+
<?php while ( list($type, $value) = each( $options ) ) : ?>
|
26 |
+
<tr><th><label ><?php echo get_post_type_object( $type )->label; ?></label></th>
|
27 |
<td><select name="vkExUnit_cta_settings[<?php echo $type; ?>]" id="vkExUnit_cta_settings">
|
28 |
+
<?php foreach ( $ctas as $cta ) : ?>
|
29 |
<option value="<?php echo $cta['key'] ?>" <?php echo($value == $cta['key'])? 'selected':''; ?> ><?php echo $cta['label'] ?></option>
|
30 |
<?php endforeach; ?>
|
31 |
</select>
|
32 |
+
<a href="<?php echo admin_url( 'edit.php?post_type=' . $type ) ?>" class="button button-default" target="_blank"><?php _e( 'Show index page', 'vkExUnit' ); ?></a>
|
33 |
</td></tr>
|
34 |
<?php endwhile;?>
|
35 |
</table>
|
36 |
<?php submit_button(); ?>
|
37 |
+
</div>
|
plugins/child_page_index.php
CHANGED
@@ -1,14 +1,14 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
|
7 |
|
8 |
-
add_shortcode('vkExUnit_childs', 'vkExUnit_childPageIndex_shortcode');
|
9 |
-
function vkExUnit_childPageIndex_shortcode(){
|
10 |
global $post;
|
11 |
-
if( !is_page() || !get_post_meta( $post->ID, 'vkExUnit_childPageIndex', true ) ) return;
|
12 |
|
13 |
$parentId = $post->ID;
|
14 |
$args = array(
|
@@ -18,27 +18,26 @@ function vkExUnit_childPageIndex_shortcode(){
|
|
18 |
'orderby' => 'menu_order',
|
19 |
'post_parent' => $parentId,
|
20 |
);
|
21 |
-
$childrens = new WP_Query($args);
|
22 |
|
23 |
-
|
24 |
-
if( !$childrens->have_posts() ) return;
|
25 |
|
26 |
$childPageList_html = PHP_EOL.'<div class="row veu_childPage_list">'.PHP_EOL;
|
27 |
while ( $childrens->have_posts() ) : $childrens->the_post();
|
28 |
|
29 |
// Set Excerpt
|
30 |
$postExcerpt = $post->post_excerpt;
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
|
36 |
// Page Item build
|
37 |
-
$childPageList_html .= '<a href="'.esc_url(get_permalink()).'" class="col-sm-6 childPage_list_box"><div class="childPage_list_box_inner">';
|
38 |
-
$childPageList_html .= '<h3 class="childPage_list_title">'.esc_html(get_the_title()).'</h3>';
|
39 |
$childPageList_html .= '<div class="childPage_list_body">'.get_the_post_thumbnail( $post->ID, 'large' );
|
40 |
-
$childPageList_html .= '<p class="childPage_list_text">'.esc_html($postExcerpt).'</p></div>';
|
41 |
-
$childPageList_html .= '<span class="childPage_list_more btn btn-primary btn-xs">'.__('Read more', 'vkExUnit').'</span>';
|
42 |
$childPageList_html .= '</div></a>'.PHP_EOL;
|
43 |
|
44 |
endwhile;
|
@@ -49,13 +48,13 @@ function vkExUnit_childPageIndex_shortcode(){
|
|
49 |
}
|
50 |
|
51 |
|
52 |
-
add_filter('the_content', 'vkExUnit_childPageIndex_contentHook', 7, 1);
|
53 |
-
function vkExUnit_childPageIndex_contentHook( $content ){
|
54 |
-
if( vkExUnit_is_excerpt() ) return $content;
|
55 |
global $is_pagewidget;
|
56 |
-
if( $is_pagewidget ) return $content;
|
57 |
global $post;
|
58 |
-
if( !is_page() || !get_post_meta( $post->ID, 'vkExUnit_childPageIndex',true ) ) return $content;
|
59 |
|
60 |
$content .= "\n[vkExUnit_childs]";
|
61 |
|
@@ -64,23 +63,23 @@ function vkExUnit_childPageIndex_contentHook( $content ){
|
|
64 |
|
65 |
|
66 |
|
67 |
-
add_filter('vkExUnit_customField_Page_activation', 'vkExUnit_childPageIndex_activate_meta_box', 10, 1);
|
68 |
-
function vkExUnit_childPageIndex_activate_meta_box( $flag ){
|
69 |
return true;
|
70 |
}
|
71 |
|
72 |
|
73 |
|
74 |
-
add_action('vkExUnit_customField_Page_box', 'vkExUnit_childPageIndex_meta_box');
|
75 |
-
function vkExUnit_childPageIndex_meta_box(){
|
76 |
global $post;
|
77 |
// childPageIndex display
|
78 |
-
$enable = get_post_meta( $post->ID, 'vkExUnit_childPageIndex', true);?>
|
79 |
<div>
|
80 |
-
<input type="hidden" name="_nonce_vkExUnit__custom_field_childPageIndex" id="_nonce_vkExUnit__custom_field_childPageIndex" value="<?php echo wp_create_nonce(plugin_basename(__FILE__));?>" />
|
81 |
<label for="vkExUnit_childPageIndex">
|
82 |
<input type="checkbox" id="vkExUnit_childPageIndex" name="vkExUnit_childPageIndex"<?php echo ($enable)? ' checked' : ''; ?> />
|
83 |
-
<?php _e('Display a child page index', 'vkExUnit');?>
|
84 |
</label>
|
85 |
</div>
|
86 |
|
@@ -89,30 +88,30 @@ function vkExUnit_childPageIndex_meta_box(){
|
|
89 |
|
90 |
|
91 |
// save custom field childPageIndex
|
92 |
-
add_action('save_post', 'vkExUnit_save_custom_field_postdata');
|
93 |
function vkExUnit_save_custom_field_postdata( $post_id ) {
|
94 |
-
$childPageIndex = isset($_POST['_nonce_vkExUnit__custom_field_childPageIndex']) ? htmlspecialchars($_POST['_nonce_vkExUnit__custom_field_childPageIndex']) : null;
|
95 |
|
96 |
-
if( !wp_verify_nonce( $childPageIndex, plugin_basename(__FILE__) )){
|
97 |
return $post_id;
|
98 |
}
|
99 |
|
100 |
-
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
101 |
-
|
102 |
|
103 |
-
$data = isset($_POST['vkExUnit_childPageIndex']) ? htmlspecialchars($_POST['vkExUnit_childPageIndex']) : null;
|
104 |
|
105 |
-
if('page' == $data){
|
106 |
-
if(!current_user_can('edit_page', $post_id)) return $post_id;
|
107 |
}
|
108 |
|
109 |
-
if (
|
110 |
-
add_post_meta( $post_id, 'vkExUnit_childPageIndex', $data, true )
|
111 |
-
} else if ( $data != get_post_meta( $post_id, 'vkExUnit_childPageIndex' )) {
|
112 |
-
update_post_meta( $post_id, 'vkExUnit_childPageIndex', $data )
|
113 |
-
} else if (
|
114 |
-
delete_post_meta( $post_id, 'vkExUnit_childPageIndex' )
|
115 |
}
|
116 |
|
117 |
-
do_action('vkExUnit_customField_Page_save_customField');
|
118 |
-
}
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* Child page index
|
5 |
/*-------------------------------------------*/
|
6 |
|
7 |
|
8 |
+
add_shortcode( 'vkExUnit_childs', 'vkExUnit_childPageIndex_shortcode' );
|
9 |
+
function vkExUnit_childPageIndex_shortcode() {
|
10 |
global $post;
|
11 |
+
if ( ! is_page() || ! get_post_meta( $post->ID, 'vkExUnit_childPageIndex', true ) ) { return; }
|
12 |
|
13 |
$parentId = $post->ID;
|
14 |
$args = array(
|
18 |
'orderby' => 'menu_order',
|
19 |
'post_parent' => $parentId,
|
20 |
);
|
21 |
+
$childrens = new WP_Query( $args );
|
22 |
|
23 |
+
if ( ! $childrens->have_posts() ) { return; }
|
|
|
24 |
|
25 |
$childPageList_html = PHP_EOL.'<div class="row veu_childPage_list">'.PHP_EOL;
|
26 |
while ( $childrens->have_posts() ) : $childrens->the_post();
|
27 |
|
28 |
// Set Excerpt
|
29 |
$postExcerpt = $post->post_excerpt;
|
30 |
+
if ( ! $postExcerpt ) {
|
31 |
+
$postExcerpt = esc_html( mb_substr( strip_tags( $post->post_content ), 0, 90 ) ); // kill tags and trim 120 chara
|
32 |
+
if ( mb_strlen( $postExcerpt ) >= 90 ) { $postExcerpt .= '...'; }
|
33 |
+
}
|
34 |
|
35 |
// Page Item build
|
36 |
+
$childPageList_html .= '<a href="'.esc_url( get_permalink() ).'" class="col-sm-6 childPage_list_box"><div class="childPage_list_box_inner">';
|
37 |
+
$childPageList_html .= '<h3 class="childPage_list_title">'.esc_html( get_the_title() ).'</h3>';
|
38 |
$childPageList_html .= '<div class="childPage_list_body">'.get_the_post_thumbnail( $post->ID, 'large' );
|
39 |
+
$childPageList_html .= '<p class="childPage_list_text">'.esc_html( $postExcerpt ).'</p></div>';
|
40 |
+
$childPageList_html .= '<span class="childPage_list_more btn btn-primary btn-xs">'.__( 'Read more', 'vkExUnit' ).'</span>';
|
41 |
$childPageList_html .= '</div></a>'.PHP_EOL;
|
42 |
|
43 |
endwhile;
|
48 |
}
|
49 |
|
50 |
|
51 |
+
add_filter( 'the_content', 'vkExUnit_childPageIndex_contentHook', 7, 1 );
|
52 |
+
function vkExUnit_childPageIndex_contentHook( $content ) {
|
53 |
+
if ( vkExUnit_is_excerpt() ) { return $content; }
|
54 |
global $is_pagewidget;
|
55 |
+
if ( $is_pagewidget ) { return $content; }
|
56 |
global $post;
|
57 |
+
if ( ! is_page() || ! get_post_meta( $post->ID, 'vkExUnit_childPageIndex',true ) ) { return $content; }
|
58 |
|
59 |
$content .= "\n[vkExUnit_childs]";
|
60 |
|
63 |
|
64 |
|
65 |
|
66 |
+
add_filter( 'vkExUnit_customField_Page_activation', 'vkExUnit_childPageIndex_activate_meta_box', 10, 1 );
|
67 |
+
function vkExUnit_childPageIndex_activate_meta_box( $flag ) {
|
68 |
return true;
|
69 |
}
|
70 |
|
71 |
|
72 |
|
73 |
+
add_action( 'vkExUnit_customField_Page_box', 'vkExUnit_childPageIndex_meta_box' );
|
74 |
+
function vkExUnit_childPageIndex_meta_box() {
|
75 |
global $post;
|
76 |
// childPageIndex display
|
77 |
+
$enable = get_post_meta( $post->ID, 'vkExUnit_childPageIndex', true );?>
|
78 |
<div>
|
79 |
+
<input type="hidden" name="_nonce_vkExUnit__custom_field_childPageIndex" id="_nonce_vkExUnit__custom_field_childPageIndex" value="<?php echo wp_create_nonce( plugin_basename( __FILE__ ) );?>" />
|
80 |
<label for="vkExUnit_childPageIndex">
|
81 |
<input type="checkbox" id="vkExUnit_childPageIndex" name="vkExUnit_childPageIndex"<?php echo ($enable)? ' checked' : ''; ?> />
|
82 |
+
<?php _e( 'Display a child page index', 'vkExUnit' );?>
|
83 |
</label>
|
84 |
</div>
|
85 |
|
88 |
|
89 |
|
90 |
// save custom field childPageIndex
|
91 |
+
add_action( 'save_post', 'vkExUnit_save_custom_field_postdata' );
|
92 |
function vkExUnit_save_custom_field_postdata( $post_id ) {
|
93 |
+
$childPageIndex = isset( $_POST['_nonce_vkExUnit__custom_field_childPageIndex'] ) ? htmlspecialchars( $_POST['_nonce_vkExUnit__custom_field_childPageIndex'] ) : null;
|
94 |
|
95 |
+
if ( ! wp_verify_nonce( $childPageIndex, plugin_basename( __FILE__ ) ) ) {
|
96 |
return $post_id;
|
97 |
}
|
98 |
|
99 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
100 |
+
return $post_id; }
|
101 |
|
102 |
+
$data = isset( $_POST['vkExUnit_childPageIndex'] ) ? htmlspecialchars( $_POST['vkExUnit_childPageIndex'] ) : null;
|
103 |
|
104 |
+
if ( 'page' == $data ) {
|
105 |
+
if ( ! current_user_can( 'edit_page', $post_id ) ) { return $post_id; }
|
106 |
}
|
107 |
|
108 |
+
if ( '' == get_post_meta( $post_id, 'vkExUnit_childPageIndex' ) ) {
|
109 |
+
add_post_meta( $post_id, 'vkExUnit_childPageIndex', $data, true );
|
110 |
+
} else if ( $data != get_post_meta( $post_id, 'vkExUnit_childPageIndex' ) ) {
|
111 |
+
update_post_meta( $post_id, 'vkExUnit_childPageIndex', $data );
|
112 |
+
} else if ( '' == $data ) {
|
113 |
+
delete_post_meta( $post_id, 'vkExUnit_childPageIndex' );
|
114 |
}
|
115 |
|
116 |
+
do_action( 'vkExUnit_customField_Page_save_customField' );
|
117 |
+
}
|
plugins/contact_section.php
CHANGED
@@ -13,8 +13,8 @@ class vExUnit_Contact {
|
|
13 |
private static $instance;
|
14 |
|
15 |
public static function instance() {
|
16 |
-
if ( isset( self::$instance ) )
|
17 |
-
return self::$instance;
|
18 |
|
19 |
self::$instance = new vExUnit_Contact;
|
20 |
self::$instance->run_init();
|
@@ -27,39 +27,39 @@ class vExUnit_Contact {
|
|
27 |
|
28 |
|
29 |
protected function run_init() {
|
30 |
-
add_action( 'admin_init', array($this, 'options_init') );
|
31 |
-
add_action('save_post', array($this, 'save_custom_field_postdata') );
|
32 |
-
add_shortcode('vkExUnit_contact_section', array($this, 'shortcode') );
|
33 |
-
add_filter('the_content', array($this, 'set_content' ), 10,1);
|
34 |
-
add_filter('vkExUnit_customField_Page_activation', array($this, 'activate_metavox'), 10, 1);
|
35 |
-
add_action('vkExUnit_customField_Page_box', array($this, 'render_meta_box') );
|
36 |
}
|
37 |
|
38 |
|
39 |
-
public function activate_metavox( $flag ){
|
40 |
return true;
|
41 |
}
|
42 |
|
43 |
|
44 |
public function options_init() {
|
45 |
vkExUnit_register_setting(
|
46 |
-
__('Contact Information', 'vkExUnit'), // tab label.
|
47 |
'vkExUnit_contact', // name attr
|
48 |
-
array($this, 'option_sanitaize'), // sanitaise function name
|
49 |
-
array($this, 'options_page') // setting_page function name
|
50 |
);
|
51 |
}
|
52 |
|
53 |
|
54 |
-
public static function get_option(){
|
55 |
$default = array(
|
56 |
-
'contact_txt' => __('Please feel free to inquire.', 'vkExUnit'),
|
57 |
'tel_number' => '000-000-0000',
|
58 |
-
'contact_time' => __('Office hours 9:00 - 18:00 [ Weekdays except holidays ]', 'vkExUnit'),
|
59 |
'contact_link' => '',
|
60 |
'button_text' => '',
|
61 |
'button_text_small' => '',
|
62 |
-
'short_text' => __( 'Contact us' , 'vkExUnit' )
|
63 |
);
|
64 |
$option = get_option( 'vkExUnit_contact' );
|
65 |
return wp_parse_args( $option, $default );
|
@@ -69,62 +69,62 @@ class vExUnit_Contact {
|
|
69 |
public function options_page() {
|
70 |
$options = self::get_option();
|
71 |
?>
|
72 |
-
<h3><?php _e('Contact Information', 'vkExUnit'); ?></h3>
|
73 |
<div id="meta_description" class="sectionBox">
|
74 |
<table class="form-table">
|
75 |
<tr>
|
76 |
-
<th scope="row"><label for="contact_txt"><?php _e('Message', 'vkExUnit')
|
77 |
<td>
|
78 |
<input type="text" name="vkExUnit_contact[contact_txt]" id="contact_txt" value="<?php echo esc_attr( $options['contact_txt'] ); ?>" style="width:50%;" /><br />
|
79 |
-
<span><?php _e('ex) ', 'vkExUnit')
|
80 |
</td>
|
81 |
</tr>
|
82 |
<tr>
|
83 |
-
<th scope="row"><label for="tel_number"><?php _e('Phone number', 'vkExUnit')
|
84 |
<td>
|
85 |
<input type="text" name="vkExUnit_contact[tel_number]" id="tel_number" value="<?php echo esc_attr( $options['tel_number'] ); ?>" style="width:50%;" /><br />
|
86 |
-
<span><?php _e('ex) ', 'vkExUnit')
|
87 |
</td>
|
88 |
</tr>
|
89 |
<tr>
|
90 |
-
<th scope="row"><label for="contact_time"><?php _e('Office hours', 'vkExUnit')
|
91 |
<td>
|
92 |
<textarea cols="20" rows="2" name="vkExUnit_contact[contact_time]" id="contact_time" value="" style="width:50%;" /><?php echo esc_attr( $options['contact_time'] ); ?></textarea><br />
|
93 |
-
<span><?php _e('ex) ', 'vkExUnit')
|
94 |
</td>
|
95 |
</tr>
|
96 |
<!-- he URL of contact page -->
|
97 |
<tr>
|
98 |
-
<th scope="row"><label for="contact_link"><?php _e('The contact page URL', 'vkExUnit')
|
99 |
<td>
|
100 |
<input type="text" name="vkExUnit_contact[contact_link]" id="contact_link" value="<?php echo esc_attr( $options['contact_link'] ); ?>" class="width-500" /><br />
|
101 |
-
<span><?php _e('ex) ', 'vkExUnit')
|
102 |
-
<?php _e('* If you fill in the blank, contact button does not appear.', 'vkExUnit')
|
103 |
</td>
|
104 |
</tr>
|
105 |
<tr>
|
106 |
-
<th scope="row"><label for="sub_sitename"><?php _e('Contact button Text', 'vkExUnit')
|
107 |
<td>
|
108 |
<textarea cols="20" rows="2" name="vkExUnit_contact[button_text]" id="sub_sitename" value="" style="width:50%;" /><?php echo esc_attr( $options['button_text'] ); ?></textarea><br />
|
109 |
-
<span><?php _e('ex) ', 'vkExUnit')
|
110 |
</td>
|
111 |
</tr>
|
112 |
<!-- Company address -->
|
113 |
<tr>
|
114 |
-
<th scope="row"><label for="button_text_small"><?php _e('Contact button text( sub )', 'vkExUnit')
|
115 |
<td>
|
116 |
<textarea cols="20" rows="2" name="vkExUnit_contact[button_text_small]" id="button_text_small" value="" style="width:50%;" /><?php echo $options['button_text_small'] ?></textarea><br />
|
117 |
-
<span><?php _e('ex) ', 'vkExUnit')
|
118 |
-
<?php _e('Email contact form', 'vkExUnit')
|
119 |
-
|
120 |
</td>
|
121 |
</tr>
|
122 |
<tr>
|
123 |
-
<th scope="row"><label for="widget_text"><?php _e('Contact button short text for side widget', 'vkExUnit')
|
124 |
<td>
|
125 |
-
<?php $short_text = ( isset($options['short_text']) && $options['short_text'] ) ? $options['short_text'] : ''; ?>
|
126 |
<input type="text" name="vkExUnit_contact[short_text]" id="widget_text" value="<?php echo esc_attr( $short_text ); ?>" style="width:50%;" /><br />
|
127 |
-
<span><?php _e( 'This will used to "Contact Button" widget.' , 'vkExUnit' )
|
128 |
</td>
|
129 |
</tr>
|
130 |
</table>
|
@@ -140,53 +140,53 @@ class vExUnit_Contact {
|
|
140 |
|
141 |
|
142 |
public function render_meta_box() {
|
143 |
-
$enable = get_post_meta(get_the_id(), 'vkExUnit_contact_enable', true); ?>
|
144 |
<div>
|
145 |
-
<input type="hidden" name="_nonce_vkExUnit_contact" id="_nonce_vkExUnit__custom_auto_eyecatch_noonce" value="<?php echo wp_create_nonce(plugin_basename(__FILE__)); ?>" />
|
146 |
<label for="vkExUnit_contact">
|
147 |
<input type="checkbox" id="vkExUnit_contact" name="vkExUnit_contact_enable"<?php echo ($enable)? ' checked' : ''; ?> />
|
148 |
-
<?php _e('Display Contact Section','vkExUnit'); ?>
|
149 |
</label>
|
150 |
</div>
|
151 |
<?php
|
152 |
}
|
153 |
|
154 |
public function save_custom_field_postdata( $post_id ) {
|
155 |
-
$childPageIndex = isset($_POST['_nonce_vkExUnit_contact']) ? htmlspecialchars($_POST['_nonce_vkExUnit_contact']) : null;
|
156 |
|
157 |
-
if( !wp_verify_nonce( $childPageIndex, plugin_basename(__FILE__) )){
|
158 |
return $post_id;
|
159 |
}
|
160 |
|
161 |
-
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
162 |
-
|
163 |
|
164 |
-
$data = isset($_POST['vkExUnit_contact_enable']) ? htmlspecialchars($_POST['vkExUnit_contact_enable']) : null;
|
165 |
|
166 |
-
if('page' == $data){
|
167 |
-
if(!current_user_can('edit_page', $post_id)) return $post_id;
|
168 |
}
|
169 |
|
170 |
-
if (
|
171 |
-
add_post_meta( $post_id, 'vkExUnit_contact_enable', $data, true )
|
172 |
-
} else if ( $data != get_post_meta( $post_id, 'vkExUnit_contact_enable' )) {
|
173 |
-
update_post_meta( $post_id, 'vkExUnit_contact_enable', $data )
|
174 |
-
} else if (
|
175 |
-
delete_post_meta( $post_id, 'vkExUnit_contact_enable' )
|
176 |
}
|
177 |
}
|
178 |
|
179 |
|
180 |
-
public static function is_my_turn(){
|
181 |
-
if( vkExUnit_is_excerpt() ) return false;
|
182 |
-
if( !is_page() ) return false;
|
183 |
-
if( get_post_meta(get_the_id(), 'vkExUnit_contact_enable', true) ) return true;
|
184 |
return false;
|
185 |
}
|
186 |
|
187 |
|
188 |
-
public function set_content($content){
|
189 |
-
if( !self::is_my_turn() ) return $content;
|
190 |
|
191 |
$content .= '[vkExUnit_contact_section]';
|
192 |
return $content;
|
@@ -197,22 +197,22 @@ class vExUnit_Contact {
|
|
197 |
/* contact bottom html
|
198 |
/*-------------------------------------------*/
|
199 |
|
200 |
-
public static function render_contact_html(){
|
201 |
$options = self::get_option();
|
202 |
$cont = '';
|
203 |
$cont .= '<section class="veu_contact veu_contentAddSection">';
|
204 |
$cont .= '<div class="contact_frame">';
|
205 |
$cont .= '<p class="contact_txt">';
|
206 |
-
$cont .= '<span class="contact_txt_catch">'.nl2br(esc_textarea($options['contact_txt'])).'</span>';
|
207 |
$cont .= '<span class="contact_txt_tel veu_color_txt_key">'.$options['tel_number'].'</span>';
|
208 |
-
$cont .= '<span class="contact_txt_time">'.nl2br(esc_textarea($options['contact_time'])).'</span>';
|
209 |
$cont .= '</p>';
|
210 |
|
211 |
if ( $options['contact_link'] && $options['button_text'] ) {
|
212 |
$cont .= '<a href="'.$options['contact_link'].'" class="btn btn-primary btn-lg contact_bt">';
|
213 |
$cont .= '<span class="contact_bt_txt">'.$options['button_text'].'</span>';
|
214 |
|
215 |
-
if ( isset($options['button_text_small']) && $options['button_text_small'] ){
|
216 |
$cont .= '<span class="contact_bt_subTxt">'.$options['button_text_small'].'</span>';
|
217 |
}
|
218 |
|
@@ -220,10 +220,10 @@ class vExUnit_Contact {
|
|
220 |
}
|
221 |
$cont .= '</div>';
|
222 |
$cont .= '</section>';
|
223 |
-
if ( current_user_can('edit_theme_options') ) {
|
224 |
-
$cont .= '<div class="veu_adminEdit"><a href="'.admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_contact" class="btn btn-default" target="_blank">'.__('Edit contact information', 'vkExUnit').'</a></div>';
|
225 |
}
|
226 |
-
$cont = apply_filters('vkExUnit_contact_custom',$cont);
|
227 |
return $cont;
|
228 |
}
|
229 |
|
@@ -231,30 +231,30 @@ class vExUnit_Contact {
|
|
231 |
/* widget html
|
232 |
/*-------------------------------------------*/
|
233 |
|
234 |
-
public static function render_widget_html(){
|
235 |
$options = self::get_option();
|
236 |
$cont = '';
|
237 |
|
238 |
if (
|
239 |
-
( isset($options['contact_link']) && $options['contact_link'] ) &&
|
240 |
-
( isset($options['short_text']) && $options['short_text'] )
|
241 |
) {
|
242 |
$cont .= '<a href="'.$options['contact_link'].'" class="btn btn-primary btn-lg btn-block contact_bt"><span class="contact_bt_txt">';
|
243 |
$cont .= $options['short_text'];
|
244 |
$cont .= '</span>';
|
245 |
-
if ( isset($options['button_text_small']) && $options['button_text_small'] ){
|
246 |
$cont .= '<span class="contact_bt_subTxt contact_bt_subTxt_side">'.$options['button_text_small'].'</span>';
|
247 |
}
|
248 |
$cont .= '</a>';
|
249 |
}
|
250 |
-
if ( current_user_can('edit_theme_options') ) {
|
251 |
-
$cont .= '<div class="veu_adminEdit"><a href="'.admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_contact" class="btn btn-default" target="_blank">'.__('Edit contact information', 'vkExUnit').'</a></div>';
|
252 |
}
|
253 |
return $cont;
|
254 |
}
|
255 |
|
256 |
|
257 |
-
public function shortcode(){
|
258 |
return self::render_contact_html();
|
259 |
}
|
260 |
}
|
@@ -267,13 +267,13 @@ vExUnit_Contact::instance();
|
|
267 |
class WP_Widget_vkExUnit_contact_link extends WP_Widget {
|
268 |
|
269 |
function __construct() {
|
270 |
-
$widget_name = vkExUnit_get_short_name().'_'.__('Contact Button', 'vkExUnit');
|
271 |
|
272 |
parent::__construct(
|
273 |
'vkExUnit_contact',
|
274 |
$widget_name,
|
275 |
-
array(
|
276 |
-
'description' => sprintf(__('*It is necessary to set the "%s" -> "Contact Information" section in "Main setting" page.', 'vkExUnit'),vkExUnit_get_little_short_name())
|
277 |
)
|
278 |
);
|
279 |
}
|
@@ -288,17 +288,16 @@ class WP_Widget_vkExUnit_contact_link extends WP_Widget {
|
|
288 |
}
|
289 |
|
290 |
|
291 |
-
function update($new_instance, $old_instance) {
|
292 |
return $new_instance;
|
293 |
}
|
294 |
|
295 |
|
296 |
-
function form($instance) {
|
297 |
echo '<div style="padding:1em 0;">';
|
298 |
-
_e(sprintf(__('*It is necessary to set the "%s" -> "Contact Information" section in "Main setting" page.', 'vkExUnit'),vkExUnit_get_little_short_name()));
|
299 |
echo '</div>';
|
300 |
return $instance;
|
301 |
}
|
302 |
-
|
303 |
}
|
304 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_vkExUnit_contact_link");'));
|
13 |
private static $instance;
|
14 |
|
15 |
public static function instance() {
|
16 |
+
if ( isset( self::$instance ) ) {
|
17 |
+
return self::$instance; }
|
18 |
|
19 |
self::$instance = new vExUnit_Contact;
|
20 |
self::$instance->run_init();
|
27 |
|
28 |
|
29 |
protected function run_init() {
|
30 |
+
add_action( 'admin_init', array( $this, 'options_init' ) );
|
31 |
+
add_action( 'save_post', array( $this, 'save_custom_field_postdata' ) );
|
32 |
+
add_shortcode( 'vkExUnit_contact_section', array( $this, 'shortcode' ) );
|
33 |
+
add_filter( 'the_content', array( $this, 'set_content' ), 10,1 );
|
34 |
+
add_filter( 'vkExUnit_customField_Page_activation', array( $this, 'activate_metavox' ), 10, 1 );
|
35 |
+
add_action( 'vkExUnit_customField_Page_box', array( $this, 'render_meta_box' ) );
|
36 |
}
|
37 |
|
38 |
|
39 |
+
public function activate_metavox( $flag ) {
|
40 |
return true;
|
41 |
}
|
42 |
|
43 |
|
44 |
public function options_init() {
|
45 |
vkExUnit_register_setting(
|
46 |
+
__( 'Contact Information', 'vkExUnit' ), // tab label.
|
47 |
'vkExUnit_contact', // name attr
|
48 |
+
array( $this, 'option_sanitaize' ), // sanitaise function name
|
49 |
+
array( $this, 'options_page' ) // setting_page function name
|
50 |
);
|
51 |
}
|
52 |
|
53 |
|
54 |
+
public static function get_option() {
|
55 |
$default = array(
|
56 |
+
'contact_txt' => __( 'Please feel free to inquire.', 'vkExUnit' ),
|
57 |
'tel_number' => '000-000-0000',
|
58 |
+
'contact_time' => __( 'Office hours 9:00 - 18:00 [ Weekdays except holidays ]', 'vkExUnit' ),
|
59 |
'contact_link' => '',
|
60 |
'button_text' => '',
|
61 |
'button_text_small' => '',
|
62 |
+
'short_text' => __( 'Contact us' , 'vkExUnit' ),
|
63 |
);
|
64 |
$option = get_option( 'vkExUnit_contact' );
|
65 |
return wp_parse_args( $option, $default );
|
69 |
public function options_page() {
|
70 |
$options = self::get_option();
|
71 |
?>
|
72 |
+
<h3><?php _e( 'Contact Information', 'vkExUnit' ); ?></h3>
|
73 |
<div id="meta_description" class="sectionBox">
|
74 |
<table class="form-table">
|
75 |
<tr>
|
76 |
+
<th scope="row"><label for="contact_txt"><?php _e( 'Message', 'vkExUnit' );?></label></th>
|
77 |
<td>
|
78 |
<input type="text" name="vkExUnit_contact[contact_txt]" id="contact_txt" value="<?php echo esc_attr( $options['contact_txt'] ); ?>" style="width:50%;" /><br />
|
79 |
+
<span><?php _e( 'ex) ', 'vkExUnit' );?><?php _e( 'Please feel free to inquire.', 'vkExUnit' );?></span>
|
80 |
</td>
|
81 |
</tr>
|
82 |
<tr>
|
83 |
+
<th scope="row"><label for="tel_number"><?php _e( 'Phone number', 'vkExUnit' );?></label></th>
|
84 |
<td>
|
85 |
<input type="text" name="vkExUnit_contact[tel_number]" id="tel_number" value="<?php echo esc_attr( $options['tel_number'] ); ?>" style="width:50%;" /><br />
|
86 |
+
<span><?php _e( 'ex) ', 'vkExUnit' );?>000-000-0000</span>
|
87 |
</td>
|
88 |
</tr>
|
89 |
<tr>
|
90 |
+
<th scope="row"><label for="contact_time"><?php _e( 'Office hours', 'vkExUnit' );?></label></th>
|
91 |
<td>
|
92 |
<textarea cols="20" rows="2" name="vkExUnit_contact[contact_time]" id="contact_time" value="" style="width:50%;" /><?php echo esc_attr( $options['contact_time'] ); ?></textarea><br />
|
93 |
+
<span><?php _e( 'ex) ', 'vkExUnit' );?><?php _e( 'Office hours', 'vkExUnit' );?> 9:00 - 18:00 [ <?php _e( 'Weekdays except holidays', 'vkExUnit' );?> ]</span>
|
94 |
</td>
|
95 |
</tr>
|
96 |
<!-- he URL of contact page -->
|
97 |
<tr>
|
98 |
+
<th scope="row"><label for="contact_link"><?php _e( 'The contact page URL', 'vkExUnit' );?></label></th>
|
99 |
<td>
|
100 |
<input type="text" name="vkExUnit_contact[contact_link]" id="contact_link" value="<?php echo esc_attr( $options['contact_link'] ); ?>" class="width-500" /><br />
|
101 |
+
<span><?php _e( 'ex) ', 'vkExUnit' );?>http://www.********.co.jp/contact/ <?php _e( 'or', 'vkExUnit' );?> /******/</span><br />
|
102 |
+
<?php _e( '* If you fill in the blank, contact button does not appear.', 'vkExUnit' );?>
|
103 |
</td>
|
104 |
</tr>
|
105 |
<tr>
|
106 |
+
<th scope="row"><label for="sub_sitename"><?php _e( 'Contact button Text', 'vkExUnit' );?></label></th>
|
107 |
<td>
|
108 |
<textarea cols="20" rows="2" name="vkExUnit_contact[button_text]" id="sub_sitename" value="" style="width:50%;" /><?php echo esc_attr( $options['button_text'] ); ?></textarea><br />
|
109 |
+
<span><?php _e( 'ex) ', 'vkExUnit' );?><?php _e( 'Contact Us from email.', 'vkExUnit' );?></span>
|
110 |
</td>
|
111 |
</tr>
|
112 |
<!-- Company address -->
|
113 |
<tr>
|
114 |
+
<th scope="row"><label for="button_text_small"><?php _e( 'Contact button text( sub )', 'vkExUnit' );?></label></th>
|
115 |
<td>
|
116 |
<textarea cols="20" rows="2" name="vkExUnit_contact[button_text_small]" id="button_text_small" value="" style="width:50%;" /><?php echo $options['button_text_small'] ?></textarea><br />
|
117 |
+
<span><?php _e( 'ex) ', 'vkExUnit' );?>
|
118 |
+
<?php _e( 'Email contact form', 'vkExUnit' );?>
|
119 |
+
</span>
|
120 |
</td>
|
121 |
</tr>
|
122 |
<tr>
|
123 |
+
<th scope="row"><label for="widget_text"><?php _e( 'Contact button short text for side widget', 'vkExUnit' );?></label></th>
|
124 |
<td>
|
125 |
+
<?php $short_text = ( isset( $options['short_text'] ) && $options['short_text'] ) ? $options['short_text'] : ''; ?>
|
126 |
<input type="text" name="vkExUnit_contact[short_text]" id="widget_text" value="<?php echo esc_attr( $short_text ); ?>" style="width:50%;" /><br />
|
127 |
+
<span><?php _e( 'This will used to "Contact Button" widget.' , 'vkExUnit' );?></span>
|
128 |
</td>
|
129 |
</tr>
|
130 |
</table>
|
140 |
|
141 |
|
142 |
public function render_meta_box() {
|
143 |
+
$enable = get_post_meta( get_the_id(), 'vkExUnit_contact_enable', true ); ?>
|
144 |
<div>
|
145 |
+
<input type="hidden" name="_nonce_vkExUnit_contact" id="_nonce_vkExUnit__custom_auto_eyecatch_noonce" value="<?php echo wp_create_nonce( plugin_basename( __FILE__ ) ); ?>" />
|
146 |
<label for="vkExUnit_contact">
|
147 |
<input type="checkbox" id="vkExUnit_contact" name="vkExUnit_contact_enable"<?php echo ($enable)? ' checked' : ''; ?> />
|
148 |
+
<?php _e( 'Display Contact Section','vkExUnit' ); ?>
|
149 |
</label>
|
150 |
</div>
|
151 |
<?php
|
152 |
}
|
153 |
|
154 |
public function save_custom_field_postdata( $post_id ) {
|
155 |
+
$childPageIndex = isset( $_POST['_nonce_vkExUnit_contact'] ) ? htmlspecialchars( $_POST['_nonce_vkExUnit_contact'] ) : null;
|
156 |
|
157 |
+
if ( ! wp_verify_nonce( $childPageIndex, plugin_basename( __FILE__ ) ) ) {
|
158 |
return $post_id;
|
159 |
}
|
160 |
|
161 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
162 |
+
return $post_id; }
|
163 |
|
164 |
+
$data = isset( $_POST['vkExUnit_contact_enable'] ) ? htmlspecialchars( $_POST['vkExUnit_contact_enable'] ) : null;
|
165 |
|
166 |
+
if ( 'page' == $data ) {
|
167 |
+
if ( ! current_user_can( 'edit_page', $post_id ) ) { return $post_id; }
|
168 |
}
|
169 |
|
170 |
+
if ( '' == get_post_meta( $post_id, 'vkExUnit_contact_enable' ) ) {
|
171 |
+
add_post_meta( $post_id, 'vkExUnit_contact_enable', $data, true );
|
172 |
+
} else if ( $data != get_post_meta( $post_id, 'vkExUnit_contact_enable' ) ) {
|
173 |
+
update_post_meta( $post_id, 'vkExUnit_contact_enable', $data );
|
174 |
+
} else if ( '' == $data ) {
|
175 |
+
delete_post_meta( $post_id, 'vkExUnit_contact_enable' );
|
176 |
}
|
177 |
}
|
178 |
|
179 |
|
180 |
+
public static function is_my_turn() {
|
181 |
+
if ( vkExUnit_is_excerpt() ) { return false; }
|
182 |
+
if ( ! is_page() ) { return false; }
|
183 |
+
if ( get_post_meta( get_the_id(), 'vkExUnit_contact_enable', true ) ) { return true; }
|
184 |
return false;
|
185 |
}
|
186 |
|
187 |
|
188 |
+
public function set_content( $content ) {
|
189 |
+
if ( ! self::is_my_turn() ) { return $content; }
|
190 |
|
191 |
$content .= '[vkExUnit_contact_section]';
|
192 |
return $content;
|
197 |
/* contact bottom html
|
198 |
/*-------------------------------------------*/
|
199 |
|
200 |
+
public static function render_contact_html() {
|
201 |
$options = self::get_option();
|
202 |
$cont = '';
|
203 |
$cont .= '<section class="veu_contact veu_contentAddSection">';
|
204 |
$cont .= '<div class="contact_frame">';
|
205 |
$cont .= '<p class="contact_txt">';
|
206 |
+
$cont .= '<span class="contact_txt_catch">'.nl2br( esc_textarea( $options['contact_txt'] ) ).'</span>';
|
207 |
$cont .= '<span class="contact_txt_tel veu_color_txt_key">'.$options['tel_number'].'</span>';
|
208 |
+
$cont .= '<span class="contact_txt_time">'.nl2br( esc_textarea( $options['contact_time'] ) ).'</span>';
|
209 |
$cont .= '</p>';
|
210 |
|
211 |
if ( $options['contact_link'] && $options['button_text'] ) {
|
212 |
$cont .= '<a href="'.$options['contact_link'].'" class="btn btn-primary btn-lg contact_bt">';
|
213 |
$cont .= '<span class="contact_bt_txt">'.$options['button_text'].'</span>';
|
214 |
|
215 |
+
if ( isset( $options['button_text_small'] ) && $options['button_text_small'] ) {
|
216 |
$cont .= '<span class="contact_bt_subTxt">'.$options['button_text_small'].'</span>';
|
217 |
}
|
218 |
|
220 |
}
|
221 |
$cont .= '</div>';
|
222 |
$cont .= '</section>';
|
223 |
+
if ( current_user_can( 'edit_theme_options' ) ) {
|
224 |
+
$cont .= '<div class="veu_adminEdit"><a href="'.admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_contact" class="btn btn-default" target="_blank">'.__( 'Edit contact information', 'vkExUnit' ).'</a></div>';
|
225 |
}
|
226 |
+
$cont = apply_filters( 'vkExUnit_contact_custom',$cont );
|
227 |
return $cont;
|
228 |
}
|
229 |
|
231 |
/* widget html
|
232 |
/*-------------------------------------------*/
|
233 |
|
234 |
+
public static function render_widget_html() {
|
235 |
$options = self::get_option();
|
236 |
$cont = '';
|
237 |
|
238 |
if (
|
239 |
+
( isset( $options['contact_link'] ) && $options['contact_link'] ) &&
|
240 |
+
( isset( $options['short_text'] ) && $options['short_text'] )
|
241 |
) {
|
242 |
$cont .= '<a href="'.$options['contact_link'].'" class="btn btn-primary btn-lg btn-block contact_bt"><span class="contact_bt_txt">';
|
243 |
$cont .= $options['short_text'];
|
244 |
$cont .= '</span>';
|
245 |
+
if ( isset( $options['button_text_small'] ) && $options['button_text_small'] ) {
|
246 |
$cont .= '<span class="contact_bt_subTxt contact_bt_subTxt_side">'.$options['button_text_small'].'</span>';
|
247 |
}
|
248 |
$cont .= '</a>';
|
249 |
}
|
250 |
+
if ( current_user_can( 'edit_theme_options' ) ) {
|
251 |
+
$cont .= '<div class="veu_adminEdit"><a href="'.admin_url().'admin.php?page=vkExUnit_main_setting#vkExUnit_contact" class="btn btn-default" target="_blank">'.__( 'Edit contact information', 'vkExUnit' ).'</a></div>';
|
252 |
}
|
253 |
return $cont;
|
254 |
}
|
255 |
|
256 |
|
257 |
+
public function shortcode() {
|
258 |
return self::render_contact_html();
|
259 |
}
|
260 |
}
|
267 |
class WP_Widget_vkExUnit_contact_link extends WP_Widget {
|
268 |
|
269 |
function __construct() {
|
270 |
+
$widget_name = vkExUnit_get_short_name().'_'.__( 'Contact Button', 'vkExUnit' );
|
271 |
|
272 |
parent::__construct(
|
273 |
'vkExUnit_contact',
|
274 |
$widget_name,
|
275 |
+
array(
|
276 |
+
'description' => sprintf( __( '*It is necessary to set the "%s" -> "Contact Information" section in "Main setting" page.', 'vkExUnit' ),vkExUnit_get_little_short_name() ),
|
277 |
)
|
278 |
);
|
279 |
}
|
288 |
}
|
289 |
|
290 |
|
291 |
+
function update( $new_instance, $old_instance ) {
|
292 |
return $new_instance;
|
293 |
}
|
294 |
|
295 |
|
296 |
+
function form( $instance ) {
|
297 |
echo '<div style="padding:1em 0;">';
|
298 |
+
_e( sprintf( __( '*It is necessary to set the "%s" -> "Contact Information" section in "Main setting" page.', 'vkExUnit' ),vkExUnit_get_little_short_name() ) );
|
299 |
echo '</div>';
|
300 |
return $instance;
|
301 |
}
|
|
|
302 |
}
|
303 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_vkExUnit_contact_link");' ) );
|
plugins/css_customize/css_customize.php
CHANGED
@@ -6,21 +6,21 @@ $customize = new biz_vektor_css_customize();
|
|
6 |
|
7 |
class biz_vektor_css_customize{
|
8 |
|
9 |
-
public function __construct(){
|
10 |
$this->set_hook();
|
11 |
}
|
12 |
|
13 |
|
14 |
-
public function set_hook(){
|
15 |
-
add_action( 'admin_footer', array($this, 'css_customize_page_js_and_css'));
|
16 |
-
add_action( 'wp_head', array($this, 'biz_vektor_css_customize_push_css'), 200);
|
17 |
-
add_action( 'admin_menu', array($this, 'biz_vektor_css_customize_menu'));
|
18 |
-
add_action( 'vkExUnit_action_adminbar', array($this, 'admin_bar'));
|
19 |
}
|
20 |
|
21 |
|
22 |
|
23 |
-
public function admin_bar( $wp_admin_bar ){
|
24 |
$wp_admin_bar->add_node(
|
25 |
array(
|
26 |
'parent' => 'veu_adminlink',
|
@@ -34,10 +34,10 @@ class biz_vektor_css_customize{
|
|
34 |
|
35 |
|
36 |
/*-------------------------------------------*/
|
37 |
-
/*
|
38 |
/*-------------------------------------------*/
|
39 |
-
public function biz_vektor_css_customize_menu()
|
40 |
-
|
41 |
$capability_required = add_filter( 'vkExUnit_ga_page_capability', vkExUnit_get_capability_required() );
|
42 |
add_submenu_page(
|
43 |
'vkExUnit_setting_page',
|
@@ -46,13 +46,13 @@ class biz_vektor_css_customize{
|
|
46 |
// $capability_required,
|
47 |
'activate_plugins',
|
48 |
'vkExUnit_css_customize',
|
49 |
-
array($this, 'biz_vektor_css_customize_render_page')
|
50 |
);
|
51 |
}
|
52 |
|
53 |
|
54 |
-
public function biz_vektor_css_customize_render_page()
|
55 |
-
|
56 |
$data = $this->biz_vektor_css_customize_valid_form();
|
57 |
|
58 |
include( vkExUnit_get_directory() . '/plugins/css_customize/css_customize-edit.php' );
|
@@ -60,25 +60,25 @@ class biz_vektor_css_customize{
|
|
60 |
|
61 |
|
62 |
/*-------------------------------------------*/
|
63 |
-
/*
|
64 |
/*-------------------------------------------*/
|
65 |
public function css_customize_page_js_and_css( $hook_suffix ) {
|
66 |
global $hook_suffix;
|
67 |
if (
|
68 |
$hook_suffix == 'appearance_page_theme-css-customize' ||
|
69 |
$hook_suffix == 'appearance_page_bv_grid_unit_options'
|
70 |
-
){
|
71 |
?>
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
|
83 |
|
84 |
<?php
|
@@ -86,26 +86,23 @@ class biz_vektor_css_customize{
|
|
86 |
}
|
87 |
|
88 |
|
89 |
-
public function biz_vektor_css_customize_valid_form()
|
90 |
-
|
91 |
$data = array(
|
92 |
'mess' => '',
|
93 |
-
'customCss' => ''
|
94 |
);
|
95 |
|
96 |
-
if( isset($_POST['bv-css-submit']) && !empty($_POST['bv-css-submit'])
|
97 |
-
&& isset($_POST['bv-css-css'])
|
98 |
-
&& isset($_POST['biz-vektor-css-nonce']) && wp_verify_nonce( $_POST['biz-vektor-css-nonce'], 'biz-vektor-css-submit' ) )
|
99 |
-
|
100 |
-
$cleanCSS = strip_tags(stripslashes(trim($_POST['bv-css-css'])));
|
101 |
|
102 |
-
if( update_option('vkExUnit_css_customize', $cleanCSS) )
|
103 |
-
$data['mess'] = '<div id="message" class="updated"><p>' . __( 'Your custom CSS was saved.', 'biz-vektor') . '</p></div>';
|
104 |
-
}
|
105 |
-
|
106 |
-
|
107 |
-
if( isset($_POST['bv-css-submit']) && !empty($_POST['bv-css-submit']) )
|
108 |
-
$data['mess'] = '<div id="message" class="error"><p>' . __( 'Error occured. Please try again.', 'biz-vektor') . '</p></div>';
|
109 |
}
|
110 |
|
111 |
$data['customCss'] = $this->biz_vektor_css_customize_get_css();
|
@@ -114,23 +111,22 @@ class biz_vektor_css_customize{
|
|
114 |
}
|
115 |
|
116 |
|
117 |
-
public function biz_vektor_css_customize_get_css()
|
118 |
-
|
119 |
-
if( get_option('vkExUnit_css_customize') )
|
120 |
-
return get_option('vkExUnit_css_customize');
|
121 |
-
|
122 |
-
return '';
|
123 |
}
|
124 |
|
125 |
|
126 |
-
public function biz_vektor_css_customize_push_css(){
|
127 |
|
128 |
-
if( get_option('vkExUnit_css_customize') ){
|
129 |
?>
|
130 |
-
|
131 |
-
<?php echo get_option('vkExUnit_css_customize') ?>
|
132 |
-
|
133 |
<?php
|
134 |
}
|
135 |
}
|
136 |
-
}
|
6 |
|
7 |
class biz_vektor_css_customize{
|
8 |
|
9 |
+
public function __construct() {
|
10 |
$this->set_hook();
|
11 |
}
|
12 |
|
13 |
|
14 |
+
public function set_hook() {
|
15 |
+
add_action( 'admin_footer', array( $this, 'css_customize_page_js_and_css' ) );
|
16 |
+
add_action( 'wp_head', array( $this, 'biz_vektor_css_customize_push_css' ), 200 );
|
17 |
+
add_action( 'admin_menu', array( $this, 'biz_vektor_css_customize_menu' ) );
|
18 |
+
add_action( 'vkExUnit_action_adminbar', array( $this, 'admin_bar' ) );
|
19 |
}
|
20 |
|
21 |
|
22 |
|
23 |
+
public function admin_bar( $wp_admin_bar ) {
|
24 |
$wp_admin_bar->add_node(
|
25 |
array(
|
26 |
'parent' => 'veu_adminlink',
|
34 |
|
35 |
|
36 |
/*-------------------------------------------*/
|
37 |
+
/* CSSカスタマイズ」のメニュー
|
38 |
/*-------------------------------------------*/
|
39 |
+
public function biz_vektor_css_customize_menu() {
|
40 |
+
|
41 |
$capability_required = add_filter( 'vkExUnit_ga_page_capability', vkExUnit_get_capability_required() );
|
42 |
add_submenu_page(
|
43 |
'vkExUnit_setting_page',
|
46 |
// $capability_required,
|
47 |
'activate_plugins',
|
48 |
'vkExUnit_css_customize',
|
49 |
+
array( $this, 'biz_vektor_css_customize_render_page' )
|
50 |
);
|
51 |
}
|
52 |
|
53 |
|
54 |
+
public function biz_vektor_css_customize_render_page() {
|
55 |
+
|
56 |
$data = $this->biz_vektor_css_customize_valid_form();
|
57 |
|
58 |
include( vkExUnit_get_directory() . '/plugins/css_customize/css_customize-edit.php' );
|
60 |
|
61 |
|
62 |
/*-------------------------------------------*/
|
63 |
+
/* 設定画面のCSSとJS
|
64 |
/*-------------------------------------------*/
|
65 |
public function css_customize_page_js_and_css( $hook_suffix ) {
|
66 |
global $hook_suffix;
|
67 |
if (
|
68 |
$hook_suffix == 'appearance_page_theme-css-customize' ||
|
69 |
$hook_suffix == 'appearance_page_bv_grid_unit_options'
|
70 |
+
) {
|
71 |
?>
|
72 |
+
<script type="text/javascript">
|
73 |
+
jQuery(document).ready(function($){
|
74 |
+
jQuery("#tipsBody dl").each(function(){
|
75 |
+
var targetId = jQuery(this).attr("id");
|
76 |
+
var targetTxt = jQuery(this).find("dt").text();
|
77 |
+
var listItem = '<li><a href="#'+ targetId +'">'+ targetTxt +'</a></li>'
|
78 |
+
jQuery('#tipsList ul').append(listItem);
|
79 |
+
});
|
80 |
+
});
|
81 |
+
</script>
|
82 |
|
83 |
|
84 |
<?php
|
86 |
}
|
87 |
|
88 |
|
89 |
+
public function biz_vektor_css_customize_valid_form() {
|
90 |
+
|
91 |
$data = array(
|
92 |
'mess' => '',
|
93 |
+
'customCss' => '',
|
94 |
);
|
95 |
|
96 |
+
if ( isset( $_POST['bv-css-submit'] ) && ! empty( $_POST['bv-css-submit'] )
|
97 |
+
&& isset( $_POST['bv-css-css'] )
|
98 |
+
&& isset( $_POST['biz-vektor-css-nonce'] ) && wp_verify_nonce( $_POST['biz-vektor-css-nonce'], 'biz-vektor-css-submit' ) ) {
|
99 |
+
$cleanCSS = strip_tags( stripslashes( trim( $_POST['bv-css-css'] ) ) );
|
|
|
100 |
|
101 |
+
if ( update_option( 'vkExUnit_css_customize', $cleanCSS ) ) {
|
102 |
+
$data['mess'] = '<div id="message" class="updated"><p>' . __( 'Your custom CSS was saved.', 'biz-vektor' ) . '</p></div>'; }
|
103 |
+
} else {
|
104 |
+
if ( isset( $_POST['bv-css-submit'] ) && ! empty( $_POST['bv-css-submit'] ) ) {
|
105 |
+
$data['mess'] = '<div id="message" class="error"><p>' . __( 'Error occured. Please try again.', 'biz-vektor' ) . '</p></div>'; }
|
|
|
|
|
106 |
}
|
107 |
|
108 |
$data['customCss'] = $this->biz_vektor_css_customize_get_css();
|
111 |
}
|
112 |
|
113 |
|
114 |
+
public function biz_vektor_css_customize_get_css() {
|
115 |
+
|
116 |
+
if ( get_option( 'vkExUnit_css_customize' ) ) {
|
117 |
+
return get_option( 'vkExUnit_css_customize' ); } else {
|
118 |
+
return ''; }
|
|
|
119 |
}
|
120 |
|
121 |
|
122 |
+
public function biz_vektor_css_customize_push_css() {
|
123 |
|
124 |
+
if ( get_option( 'vkExUnit_css_customize' ) ) {
|
125 |
?>
|
126 |
+
<style type="text/css">
|
127 |
+
<?php echo get_option( 'vkExUnit_css_customize' ) ?>
|
128 |
+
</style>
|
129 |
<?php
|
130 |
}
|
131 |
}
|
132 |
+
}
|
plugins/disable_ping-back.php
CHANGED
@@ -4,4 +4,4 @@ add_filter( 'xmlrpc_methods', 'vkExUnit_disable_ping' );
|
|
4 |
function vkExUnit_disable_ping( $methods ) {
|
5 |
unset( $methods['pingback.ping'] );
|
6 |
return $methods;
|
7 |
-
}
|
4 |
function vkExUnit_disable_ping( $methods ) {
|
5 |
unset( $methods['pingback.ping'] );
|
6 |
return $methods;
|
7 |
+
}
|
plugins/footer_copyright_change.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
-
add_filter('lightning_footerPoweredCustom','vkExUnit_lightning_footerPoweredCustom');
|
3 |
-
function vkExUnit_lightning_footerPoweredCustom($lightning_footerPowered){
|
4 |
// Powered
|
5 |
/*------------------*/
|
6 |
-
$lightning_footerPowered = __( '<p>Powered by <a href="https://wordpress.org/">WordPress</a> with <a href="//lightning.vektor-inc.co.jp" target="_blank" title="Free WordPress Theme Lightning"> Lightning Theme</a> & <a href="http://ex-unit.vektor-inc.co.jp/" target="_blank">VK All in One Expansion Unit</a> by <a href="http://www.vektor-inc.co.jp" target="_blank">Vektor,Inc.</a> technology.</p>','vkExUnit');
|
7 |
return $lightning_footerPowered;
|
8 |
|
9 |
-
}
|
1 |
<?php
|
2 |
+
add_filter( 'lightning_footerPoweredCustom','vkExUnit_lightning_footerPoweredCustom' );
|
3 |
+
function vkExUnit_lightning_footerPoweredCustom( $lightning_footerPowered ) {
|
4 |
// Powered
|
5 |
/*------------------*/
|
6 |
+
$lightning_footerPowered = __( '<p>Powered by <a href="https://wordpress.org/">WordPress</a> with <a href="//lightning.vektor-inc.co.jp" target="_blank" title="Free WordPress Theme Lightning"> Lightning Theme</a> & <a href="http://ex-unit.vektor-inc.co.jp/" target="_blank">VK All in One Expansion Unit</a> by <a href="http://www.vektor-inc.co.jp" target="_blank">Vektor,Inc.</a> technology.</p>','vkExUnit' );
|
7 |
return $lightning_footerPowered;
|
8 |
|
9 |
+
}
|
plugins/google_analytics/ga_admin.php
CHANGED
@@ -2,29 +2,29 @@
|
|
2 |
$options = vkExUnit_get_ga_options();
|
3 |
// $options_default = vkExUnit_get_sns_options_default();
|
4 |
/*-------------------------------------------*/
|
5 |
-
/*
|
6 |
/*-------------------------------------------*/
|
7 |
?>
|
8 |
<div id="seoSetting" class="sectionBox">
|
9 |
-
<h3><?php _e('Google Analytics Settings', 'vkExUnit'); ?></h3>
|
10 |
<table class="form-table">
|
11 |
<!-- Google Analytics -->
|
12 |
<tr>
|
13 |
-
<th><?php _e('Google Analytics Settings', 'vkExUnit'); ?></th>
|
14 |
-
<td><?php _e('Please fill in the Google Analytics ID from the Analytics embed code used in the site.', 'vkExUnit'); ?><br />
|
15 |
<p>UA-<input type="text" name="vkExUnit_ga_options[gaId]" id="gaId" value="<?php echo esc_attr( $options['gaId'] ); ?>" style="width:90%;" /><br />
|
16 |
-
<?php _e('ex) ', 'vkExUnit')
|
17 |
|
18 |
-
|
19 |
-
<dt><?php _e('Please select the type of Analytics code . (If you are unsure you can skip this.)', 'vkExUnit'); ?></dt>
|
20 |
-
|
21 |
<?php
|
22 |
$vkExUnit_gaTypes = array(
|
23 |
-
'gaType_universal' => __('To output the Universal Analytics code (default)', 'vkExUnit'),
|
24 |
-
'gaType_normal' => __('To output only normal code', 'vkExUnit'),
|
25 |
-
'gaType_both' => __('To output both types', 'vkExUnit')
|
26 |
);
|
27 |
-
foreach( $vkExUnit_gaTypes as $vkExUnit_gaTypeValue => $vkExUnit_gaTypeLavel) {
|
28 |
if ( $vkExUnit_gaTypeValue == $options['gaType'] ) { ?>
|
29 |
<label><input type="radio" name="vkExUnit_ga_options[gaType]" value="<?php echo $vkExUnit_gaTypeValue ?>" checked> <?php echo $vkExUnit_gaTypeLavel ?></label><br />
|
30 |
<?php } else { ?>
|
@@ -32,10 +32,10 @@ foreach( $vkExUnit_gaTypes as $vkExUnit_gaTypeValue => $vkExUnit_gaTypeLavel) {
|
|
32 |
<?php }
|
33 |
}
|
34 |
?>
|
35 |
-
|
36 |
-
|
37 |
</td>
|
38 |
</tr>
|
39 |
</table>
|
40 |
<?php submit_button(); ?>
|
41 |
-
</div>
|
2 |
$options = vkExUnit_get_ga_options();
|
3 |
// $options_default = vkExUnit_get_sns_options_default();
|
4 |
/*-------------------------------------------*/
|
5 |
+
/* Google Analytics
|
6 |
/*-------------------------------------------*/
|
7 |
?>
|
8 |
<div id="seoSetting" class="sectionBox">
|
9 |
+
<h3><?php _e( 'Google Analytics Settings', 'vkExUnit' ); ?></h3>
|
10 |
<table class="form-table">
|
11 |
<!-- Google Analytics -->
|
12 |
<tr>
|
13 |
+
<th><?php _e( 'Google Analytics Settings', 'vkExUnit' ); ?></th>
|
14 |
+
<td><?php _e( 'Please fill in the Google Analytics ID from the Analytics embed code used in the site.', 'vkExUnit' ); ?><br />
|
15 |
<p>UA-<input type="text" name="vkExUnit_ga_options[gaId]" id="gaId" value="<?php echo esc_attr( $options['gaId'] ); ?>" style="width:90%;" /><br />
|
16 |
+
<?php _e( 'ex) ', 'vkExUnit' );?>XXXXXXXX-X</p>
|
17 |
|
18 |
+
<dl>
|
19 |
+
<dt><?php _e( 'Please select the type of Analytics code . (If you are unsure you can skip this.)', 'vkExUnit' ); ?></dt>
|
20 |
+
<dd>
|
21 |
<?php
|
22 |
$vkExUnit_gaTypes = array(
|
23 |
+
'gaType_universal' => __( 'To output the Universal Analytics code (default)', 'vkExUnit' ),
|
24 |
+
'gaType_normal' => __( 'To output only normal code', 'vkExUnit' ),
|
25 |
+
'gaType_both' => __( 'To output both types', 'vkExUnit' ),
|
26 |
);
|
27 |
+
foreach ( $vkExUnit_gaTypes as $vkExUnit_gaTypeValue => $vkExUnit_gaTypeLavel ) {
|
28 |
if ( $vkExUnit_gaTypeValue == $options['gaType'] ) { ?>
|
29 |
<label><input type="radio" name="vkExUnit_ga_options[gaType]" value="<?php echo $vkExUnit_gaTypeValue ?>" checked> <?php echo $vkExUnit_gaTypeLavel ?></label><br />
|
30 |
<?php } else { ?>
|
32 |
<?php }
|
33 |
}
|
34 |
?>
|
35 |
+
</dd>
|
36 |
+
</dl>
|
37 |
</td>
|
38 |
</tr>
|
39 |
</table>
|
40 |
<?php submit_button(); ?>
|
41 |
+
</div>
|
plugins/google_analytics/google_analytics.php
CHANGED
@@ -1,21 +1,21 @@
|
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
-
/*
|
4 |
/*-------------------------------------------*/
|
5 |
|
6 |
-
function vkExUnit_add_ga_options_page(){
|
7 |
require dirname( __FILE__ ) . '/ga_admin.php';
|
8 |
}
|
9 |
|
10 |
/*-------------------------------------------*/
|
11 |
-
/*
|
12 |
/*-------------------------------------------*/
|
13 |
function vkExUnit_ga_options_init() {
|
14 |
-
if ( false === vkExUnit_get_ga_options() )
|
15 |
-
add_option( 'vkExUnit_ga_options', vkExUnit_get_ga_options_default() );
|
16 |
|
17 |
vkExUnit_register_setting(
|
18 |
-
__('Google Analytics Settings', 'vkExUnit'), // Immediately following form tag of edit page.
|
19 |
'vkExUnit_ga_options', // name attr
|
20 |
'vkExUnit_ga_options_validate',
|
21 |
'vkExUnit_add_ga_options_page'
|
@@ -26,8 +26,8 @@ add_action( 'admin_init', 'vkExUnit_ga_options_init' );
|
|
26 |
function vkExUnit_get_ga_options() {
|
27 |
$options = get_option( 'vkExUnit_ga_options', vkExUnit_get_ga_options_default() );
|
28 |
$options_dafault = vkExUnit_get_ga_options_default();
|
29 |
-
foreach ($options_dafault as $key => $value) {
|
30 |
-
$options[$key] = (isset($options[$key])) ? $options[$key] : $options_dafault[$key];
|
31 |
}
|
32 |
return apply_filters( 'vkExUnit_ga_options', $options );
|
33 |
}
|
@@ -41,7 +41,7 @@ function vkExUnit_get_ga_options_default() {
|
|
41 |
}
|
42 |
|
43 |
/*-------------------------------------------*/
|
44 |
-
/*
|
45 |
/*-------------------------------------------*/
|
46 |
function vkExUnit_ga_options_validate( $input ) {
|
47 |
$output = $defaults = vkExUnit_get_ga_options_default();
|
@@ -51,24 +51,24 @@ function vkExUnit_ga_options_validate( $input ) {
|
|
51 |
'gaType',
|
52 |
);
|
53 |
|
54 |
-
foreach ($paras as $key => $value) {
|
55 |
-
$output[$value] = (isset($input[$value])) ? $input[$value] : '';
|
56 |
}
|
57 |
|
58 |
return apply_filters( 'vkExUnit_ga_options_validate', $output, $input, $defaults );
|
59 |
}
|
60 |
|
61 |
/*-------------------------------------------*/
|
62 |
-
/*
|
63 |
/*-------------------------------------------*/
|
64 |
-
add_action('wp_head', 'vkExUnit_googleAnalytics', 10000 );
|
65 |
-
function vkExUnit_googleAnalytics(){
|
66 |
$options = vkExUnit_get_ga_options();
|
67 |
-
$gaId = esc_html($options['gaId']);
|
68 |
-
$gaType = esc_html($options['gaType']);
|
69 |
-
if ($gaId) {
|
70 |
|
71 |
-
if ((
|
72 |
<script type="text/javascript">
|
73 |
|
74 |
var _gaq = _gaq || [];
|
@@ -76,17 +76,17 @@ function vkExUnit_googleAnalytics(){
|
|
76 |
_gaq.push(['_trackPageview']);
|
77 |
|
78 |
(function() {
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
})();
|
83 |
|
84 |
</script>
|
85 |
<?php }
|
86 |
-
if (($gaType == 'gaType_both') || ($gaType == 'gaType_universal')){
|
87 |
$domainUrl = site_url();
|
88 |
-
$delete = array(
|
89 |
-
$domain = str_replace($delete,
|
90 |
<script>
|
91 |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
92 |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
+
/* Add setting page
|
4 |
/*-------------------------------------------*/
|
5 |
|
6 |
+
function vkExUnit_add_ga_options_page() {
|
7 |
require dirname( __FILE__ ) . '/ga_admin.php';
|
8 |
}
|
9 |
|
10 |
/*-------------------------------------------*/
|
11 |
+
/* Options Init
|
12 |
/*-------------------------------------------*/
|
13 |
function vkExUnit_ga_options_init() {
|
14 |
+
if ( false === vkExUnit_get_ga_options() ) {
|
15 |
+
add_option( 'vkExUnit_ga_options', vkExUnit_get_ga_options_default() ); }
|
16 |
|
17 |
vkExUnit_register_setting(
|
18 |
+
__( 'Google Analytics Settings', 'vkExUnit' ), // Immediately following form tag of edit page.
|
19 |
'vkExUnit_ga_options', // name attr
|
20 |
'vkExUnit_ga_options_validate',
|
21 |
'vkExUnit_add_ga_options_page'
|
26 |
function vkExUnit_get_ga_options() {
|
27 |
$options = get_option( 'vkExUnit_ga_options', vkExUnit_get_ga_options_default() );
|
28 |
$options_dafault = vkExUnit_get_ga_options_default();
|
29 |
+
foreach ( $options_dafault as $key => $value ) {
|
30 |
+
$options[ $key ] = (isset( $options[ $key ] )) ? $options[ $key ] : $options_dafault[ $key ];
|
31 |
}
|
32 |
return apply_filters( 'vkExUnit_ga_options', $options );
|
33 |
}
|
41 |
}
|
42 |
|
43 |
/*-------------------------------------------*/
|
44 |
+
/* validate
|
45 |
/*-------------------------------------------*/
|
46 |
function vkExUnit_ga_options_validate( $input ) {
|
47 |
$output = $defaults = vkExUnit_get_ga_options_default();
|
51 |
'gaType',
|
52 |
);
|
53 |
|
54 |
+
foreach ( $paras as $key => $value ) {
|
55 |
+
$output[ $value ] = (isset( $input[ $value ] )) ? $input[ $value ] : '';
|
56 |
}
|
57 |
|
58 |
return apply_filters( 'vkExUnit_ga_options_validate', $output, $input, $defaults );
|
59 |
}
|
60 |
|
61 |
/*-------------------------------------------*/
|
62 |
+
/* GoogleAnalytics
|
63 |
/*-------------------------------------------*/
|
64 |
+
add_action( 'wp_head', 'vkExUnit_googleAnalytics', 10000 );
|
65 |
+
function vkExUnit_googleAnalytics() {
|
66 |
$options = vkExUnit_get_ga_options();
|
67 |
+
$gaId = esc_html( $options['gaId'] );
|
68 |
+
$gaType = esc_html( $options['gaType'] );
|
69 |
+
if ( $gaId ) {
|
70 |
|
71 |
+
if ( ( ! $gaType) || ($gaType == 'gaType_normal') || ($gaType == 'gaType_both') ) { ?>
|
72 |
<script type="text/javascript">
|
73 |
|
74 |
var _gaq = _gaq || [];
|
76 |
_gaq.push(['_trackPageview']);
|
77 |
|
78 |
(function() {
|
79 |
+
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
80 |
+
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
|
81 |
+
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
82 |
})();
|
83 |
|
84 |
</script>
|
85 |
<?php }
|
86 |
+
if ( ($gaType == 'gaType_both') || ($gaType == 'gaType_universal') ) {
|
87 |
$domainUrl = site_url();
|
88 |
+
$delete = array( 'http://', 'https://' );
|
89 |
+
$domain = str_replace( $delete, '', $domainUrl ); ?>
|
90 |
<script>
|
91 |
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
92 |
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
plugins/icons.php
CHANGED
@@ -13,8 +13,8 @@ class vExUnit_icons {
|
|
13 |
private static $instance;
|
14 |
|
15 |
public static function instance() {
|
16 |
-
if ( isset( self::$instance ) )
|
17 |
-
return self::$instance;
|
18 |
|
19 |
self::$instance = new vExUnit_icons;
|
20 |
self::$instance->run_init();
|
@@ -28,14 +28,14 @@ class vExUnit_icons {
|
|
28 |
|
29 |
|
30 |
protected function run_init() {
|
31 |
-
add_action('admin_init', array($this, 'option_init' ));
|
32 |
-
add_action('wp_head', array($this, 'output_tag' ));
|
33 |
}
|
34 |
|
35 |
|
36 |
public function option_init() {
|
37 |
vkExUnit_register_setting(
|
38 |
-
__('icon setting', 'vkExUnit'), // tab label.
|
39 |
'vkExUnit_icon_settings', // name attr
|
40 |
array( $this, 'sanitize_config' ), // sanitaise function name
|
41 |
array( $this, 'render_configPage' ) // setting_page function name
|
@@ -43,13 +43,13 @@ class vExUnit_icons {
|
|
43 |
}
|
44 |
|
45 |
|
46 |
-
public static function get_default_option(){
|
47 |
$option = '';
|
48 |
return $option;
|
49 |
}
|
50 |
|
51 |
|
52 |
-
public function sanitize_config( $option ){
|
53 |
|
54 |
$output = self::get_default_option();
|
55 |
$output = $option;
|
@@ -57,25 +57,25 @@ class vExUnit_icons {
|
|
57 |
}
|
58 |
|
59 |
|
60 |
-
public static function get_option(){
|
61 |
return get_option( 'vkExUnit_icon_settings', self::get_default_option() );
|
62 |
}
|
63 |
|
64 |
|
65 |
-
public function render_configPage(){
|
66 |
$options = self::get_option();
|
67 |
?>
|
68 |
-
<h3><?php _e('icon setting', 'vkExUnit'); ?></h3>
|
69 |
<div id="on_setting" class="sectionBox">
|
70 |
<table class="form-table">
|
71 |
-
|
72 |
-
|
73 |
-
<th><?php _e('Favicon Setting', 'vkExUnit'); ?></th>
|
74 |
<td><input type="text" name="vkExUnit_icon_settings" id="favicon" value="<?php echo $options ?>" style="width:60%;" />
|
75 |
-
<button id="media_favicon" class="media_btn button button-default"><?php _e('Choose icon', 'vkExUnit'); ?></button>
|
76 |
-
<p><?php _e('Please upload your ".ico" file','vkExUnit'); ?></p>
|
77 |
-
|
78 |
-
|
79 |
</table>
|
80 |
<?php submit_button(); ?>
|
81 |
</div>
|
@@ -83,13 +83,12 @@ class vExUnit_icons {
|
|
83 |
}
|
84 |
|
85 |
|
86 |
-
public function output_tag(){
|
87 |
$options = self::get_option();
|
88 |
-
if(isset($options) && $options){
|
89 |
echo '<link rel="SHORTCUT ICON" HREF="'.$options.'" />';
|
90 |
}
|
91 |
}
|
92 |
-
|
93 |
}
|
94 |
|
95 |
-
vExUnit_icons::instance();
|
13 |
private static $instance;
|
14 |
|
15 |
public static function instance() {
|
16 |
+
if ( isset( self::$instance ) ) {
|
17 |
+
return self::$instance; }
|
18 |
|
19 |
self::$instance = new vExUnit_icons;
|
20 |
self::$instance->run_init();
|
28 |
|
29 |
|
30 |
protected function run_init() {
|
31 |
+
add_action( 'admin_init', array( $this, 'option_init' ) );
|
32 |
+
add_action( 'wp_head', array( $this, 'output_tag' ) );
|
33 |
}
|
34 |
|
35 |
|
36 |
public function option_init() {
|
37 |
vkExUnit_register_setting(
|
38 |
+
__( 'icon setting', 'vkExUnit' ), // tab label.
|
39 |
'vkExUnit_icon_settings', // name attr
|
40 |
array( $this, 'sanitize_config' ), // sanitaise function name
|
41 |
array( $this, 'render_configPage' ) // setting_page function name
|
43 |
}
|
44 |
|
45 |
|
46 |
+
public static function get_default_option() {
|
47 |
$option = '';
|
48 |
return $option;
|
49 |
}
|
50 |
|
51 |
|
52 |
+
public function sanitize_config( $option ) {
|
53 |
|
54 |
$output = self::get_default_option();
|
55 |
$output = $option;
|
57 |
}
|
58 |
|
59 |
|
60 |
+
public static function get_option() {
|
61 |
return get_option( 'vkExUnit_icon_settings', self::get_default_option() );
|
62 |
}
|
63 |
|
64 |
|
65 |
+
public function render_configPage() {
|
66 |
$options = self::get_option();
|
67 |
?>
|
68 |
+
<h3><?php _e( 'icon setting', 'vkExUnit' ); ?></h3>
|
69 |
<div id="on_setting" class="sectionBox">
|
70 |
<table class="form-table">
|
71 |
+
<!-- Favicon -->
|
72 |
+
<tr>
|
73 |
+
<th><?php _e( 'Favicon Setting', 'vkExUnit' ); ?></th>
|
74 |
<td><input type="text" name="vkExUnit_icon_settings" id="favicon" value="<?php echo $options ?>" style="width:60%;" />
|
75 |
+
<button id="media_favicon" class="media_btn button button-default"><?php _e( 'Choose icon', 'vkExUnit' ); ?></button>
|
76 |
+
<p><?php _e( 'Please upload your ".ico" file','vkExUnit' ); ?></p>
|
77 |
+
</td>
|
78 |
+
</tr>
|
79 |
</table>
|
80 |
<?php submit_button(); ?>
|
81 |
</div>
|
83 |
}
|
84 |
|
85 |
|
86 |
+
public function output_tag() {
|
87 |
$options = self::get_option();
|
88 |
+
if ( isset( $options ) && $options ) {
|
89 |
echo '<link rel="SHORTCUT ICON" HREF="'.$options.'" />';
|
90 |
}
|
91 |
}
|
|
|
92 |
}
|
93 |
|
94 |
+
vExUnit_icons::instance();
|
plugins/insert_ads.php
CHANGED
@@ -13,8 +13,8 @@ class vExUnit_Ads {
|
|
13 |
private static $instance;
|
14 |
|
15 |
public static function instance() {
|
16 |
-
if ( isset( self::$instance ) )
|
17 |
-
return self::$instance;
|
18 |
|
19 |
self::$instance = new vExUnit_Ads;
|
20 |
self::$instance->run_init();
|
@@ -27,14 +27,14 @@ class vExUnit_Ads {
|
|
27 |
|
28 |
|
29 |
protected function run_init() {
|
30 |
-
add_action('admin_init', array($this, 'option_init' ));
|
31 |
-
add_filter('the_content', array($this, 'set_content' ), 10,1);
|
32 |
-
add_shortcode('vkExUnit_ad', array($this, 'shortcode') );
|
33 |
}
|
34 |
|
35 |
public function option_init() {
|
36 |
vkExUnit_register_setting(
|
37 |
-
__('Insert ads', 'vkExUnit'), // tab label.
|
38 |
'vkExUnit_Ads', // name attr
|
39 |
array( $this, 'sanitize_config' ), // sanitaise function name
|
40 |
array( $this, 'render_configPage' ) // setting_page function name
|
@@ -42,13 +42,13 @@ class vExUnit_Ads {
|
|
42 |
}
|
43 |
|
44 |
|
45 |
-
public function set_content($content){
|
46 |
-
if( vkExUnit_is_excerpt() ) return $content;
|
47 |
global $is_pagewidget;
|
48 |
-
if( $is_pagewidget ) return $content;
|
49 |
$option = $this->get_option();
|
50 |
-
if( get_post_type() == 'post' ){
|
51 |
-
$content = preg_replace('/(<span id="more-[0-9]+"><\/span>)/', '$1'.'[vkExUnit_ad area=more]' , $content);
|
52 |
$content .= '[vkExUnit_ad area=after]';
|
53 |
}
|
54 |
|
@@ -56,26 +56,26 @@ class vExUnit_Ads {
|
|
56 |
}
|
57 |
|
58 |
|
59 |
-
public function shortcode( $atts ){
|
60 |
-
extract(shortcode_atts(array('area' => ''), $atts));
|
61 |
|
62 |
-
if($area != 'after' && $area != 'more') return '';
|
63 |
|
64 |
$option = $this->get_option();
|
65 |
|
66 |
-
return $this->render_ad($option[$area], $area);
|
67 |
}
|
68 |
|
69 |
|
70 |
-
private function render_ad( $ads
|
71 |
-
if(
|
72 |
-
$class =
|
73 |
-
if( isset($ads[1]) && $ads[1] ) $class=
|
74 |
|
75 |
$content = '';
|
76 |
$content .= '<aside class="row veu_insertAds '.$area.'">';
|
77 |
-
foreach($ads as $ad){
|
78 |
-
if(
|
79 |
|
80 |
$content .= '<div class="'.$class.'">';
|
81 |
$content .= $ad;
|
@@ -86,64 +86,63 @@ class vExUnit_Ads {
|
|
86 |
}
|
87 |
|
88 |
|
89 |
-
public function sanitize_config( $input ){
|
90 |
$option['more'][0] = stripslashes( $input['more'][0] );
|
91 |
$option['more'][1] = stripslashes( $input['more'][1] );
|
92 |
$option['after'][0] = stripslashes( $input['after'][0] );
|
93 |
$option['after'][1] = stripslashes( $input['after'][1] );
|
94 |
|
95 |
-
if(
|
96 |
$option['more'][0] = $option['more'][1];
|
97 |
$option['more'][1] = '';
|
98 |
}
|
99 |
-
if(
|
100 |
|
101 |
-
if(
|
102 |
$option['after'][0] = $option['after'][1];
|
103 |
$option['after'][1] = '';
|
104 |
}
|
105 |
-
if(
|
106 |
|
107 |
return $option;
|
108 |
}
|
109 |
|
110 |
|
111 |
-
public static function get_option(){
|
112 |
-
return get_option( 'vkExUnit_Ads', array('more'=>array(''),'after'=>array('')) );
|
113 |
}
|
114 |
|
115 |
|
116 |
-
public function render_configPage(){
|
117 |
$option = $this->get_option();
|
118 |
?>
|
119 |
-
<h3><?php _e('Insert ads', 'vkExUnit'); ?></h3>
|
120 |
<div id="vkExUnit_Ads" class="sectionBox">
|
121 |
<table class="form-table">
|
122 |
-
<tr><th><?php _e('Insert ads to post.', 'vkExUnit'); ?>
|
123 |
</th><td style="max-width:80em;">
|
124 |
-
<?php _e('Insert ads to more tag and after content.', 'vkExUnit'); ?><br/><?php _e('If you want to separate ads area, you fill two fields.', 'vkExUnit'); ?>
|
125 |
-
|
126 |
-
<dt><label for="ad_content_moretag"><?php _e('insert the ad [ more tag ]', 'vkExUnit'); ?></label></dt>
|
127 |
-
|
128 |
<textarea rows="5" name="vkExUnit_Ads[more][]" id="ad_content_moretag" value="" style="width:100%;max-width:50em;" /><?php echo (isset( $option['more'][0] ) && $option['more'][0] )? $option['more'][0]: ''; ?></textarea>
|
129 |
-
|
130 |
<textarea rows="5" name="vkExUnit_Ads[more][]" value="" style="width:100%;max-width:50em;" /><?php echo (isset( $option['more'][1] ) && $option['more'][1] )? $option['more'][1]: ''; ?></textarea>
|
131 |
-
|
132 |
-
|
133 |
-
|
134 |
-
<dt><label for="ad_content_after"><?php _e('insert the ad [ after content ]', 'vkExUnit'); ?></label></dt>
|
135 |
-
|
136 |
<textarea rows="5" name="vkExUnit_Ads[after][]" id="ad_content_after" value="" style="width:100%;max-width:50em;" /><?php echo (isset( $option['after'][0] ) && $option['after'][0] )? $option['after'][0]: ''; ?></textarea>
|
137 |
-
|
138 |
<textarea rows="5" name="vkExUnit_Ads[after][]" value="" style="width:100%;max-width:50em;" /><?php echo (isset( $option['after'][1] ) && $option['after'][1] )? $option['after'][1]: ''; ?></textarea>
|
139 |
-
|
140 |
-
|
141 |
</td></tr></table>
|
142 |
<?php submit_button(); ?>
|
143 |
</div>
|
144 |
<?php
|
145 |
}
|
146 |
-
|
147 |
}
|
148 |
|
149 |
-
vExUnit_Ads::instance();
|
13 |
private static $instance;
|
14 |
|
15 |
public static function instance() {
|
16 |
+
if ( isset( self::$instance ) ) {
|
17 |
+
return self::$instance; }
|
18 |
|
19 |
self::$instance = new vExUnit_Ads;
|
20 |
self::$instance->run_init();
|
27 |
|
28 |
|
29 |
protected function run_init() {
|
30 |
+
add_action( 'admin_init', array( $this, 'option_init' ) );
|
31 |
+
add_filter( 'the_content', array( $this, 'set_content' ), 10,1 );
|
32 |
+
add_shortcode( 'vkExUnit_ad', array( $this, 'shortcode' ) );
|
33 |
}
|
34 |
|
35 |
public function option_init() {
|
36 |
vkExUnit_register_setting(
|
37 |
+
__( 'Insert ads', 'vkExUnit' ), // tab label.
|
38 |
'vkExUnit_Ads', // name attr
|
39 |
array( $this, 'sanitize_config' ), // sanitaise function name
|
40 |
array( $this, 'render_configPage' ) // setting_page function name
|
42 |
}
|
43 |
|
44 |
|
45 |
+
public function set_content( $content ) {
|
46 |
+
if ( vkExUnit_is_excerpt() ) { return $content; }
|
47 |
global $is_pagewidget;
|
48 |
+
if ( $is_pagewidget ) { return $content; }
|
49 |
$option = $this->get_option();
|
50 |
+
if ( get_post_type() == 'post' ) {
|
51 |
+
$content = preg_replace( '/(<span id="more-[0-9]+"><\/span>)/', '$1'.'[vkExUnit_ad area=more]' , $content );
|
52 |
$content .= '[vkExUnit_ad area=after]';
|
53 |
}
|
54 |
|
56 |
}
|
57 |
|
58 |
|
59 |
+
public function shortcode( $atts ) {
|
60 |
+
extract( shortcode_atts( array( 'area' => '' ), $atts ) );
|
61 |
|
62 |
+
if ( $area != 'after' && $area != 'more' ) { return ''; }
|
63 |
|
64 |
$option = $this->get_option();
|
65 |
|
66 |
+
return $this->render_ad( $option[ $area ], $area );
|
67 |
}
|
68 |
|
69 |
|
70 |
+
private function render_ad( $ads, $area = 'more' ) {
|
71 |
+
if ( ! $ads[0] ) { return ''; }
|
72 |
+
$class = 'col-md-12';
|
73 |
+
if ( isset( $ads[1] ) && $ads[1] ) { $class = 'col-md-6'; }
|
74 |
|
75 |
$content = '';
|
76 |
$content .= '<aside class="row veu_insertAds '.$area.'">';
|
77 |
+
foreach ( $ads as $ad ) {
|
78 |
+
if ( ! $ad ) { break; }
|
79 |
|
80 |
$content .= '<div class="'.$class.'">';
|
81 |
$content .= $ad;
|
86 |
}
|
87 |
|
88 |
|
89 |
+
public function sanitize_config( $input ) {
|
90 |
$option['more'][0] = stripslashes( $input['more'][0] );
|
91 |
$option['more'][1] = stripslashes( $input['more'][1] );
|
92 |
$option['after'][0] = stripslashes( $input['after'][0] );
|
93 |
$option['after'][1] = stripslashes( $input['after'][1] );
|
94 |
|
95 |
+
if ( ! $option['more'][0] && $option['more'][1] ) {
|
96 |
$option['more'][0] = $option['more'][1];
|
97 |
$option['more'][1] = '';
|
98 |
}
|
99 |
+
if ( ! $option['more'][1] ) { unset( $option['more'][1] ); }
|
100 |
|
101 |
+
if ( ! $option['after'][0] && $option['after'][1] ) {
|
102 |
$option['after'][0] = $option['after'][1];
|
103 |
$option['after'][1] = '';
|
104 |
}
|
105 |
+
if ( ! $option['after'][1] ) { unset( $option['more'][1] ); }
|
106 |
|
107 |
return $option;
|
108 |
}
|
109 |
|
110 |
|
111 |
+
public static function get_option() {
|
112 |
+
return get_option( 'vkExUnit_Ads', array( 'more' => array( '' ), 'after' => array( '' ) ) );
|
113 |
}
|
114 |
|
115 |
|
116 |
+
public function render_configPage() {
|
117 |
$option = $this->get_option();
|
118 |
?>
|
119 |
+
<h3><?php _e( 'Insert ads', 'vkExUnit' ); ?></h3>
|
120 |
<div id="vkExUnit_Ads" class="sectionBox">
|
121 |
<table class="form-table">
|
122 |
+
<tr><th><?php _e( 'Insert ads to post.', 'vkExUnit' ); ?>
|
123 |
</th><td style="max-width:80em;">
|
124 |
+
<?php _e( 'Insert ads to more tag and after content.', 'vkExUnit' ); ?><br/><?php _e( 'If you want to separate ads area, you fill two fields.', 'vkExUnit' ); ?>
|
125 |
+
<dl>
|
126 |
+
<dt><label for="ad_content_moretag"><?php _e( 'insert the ad [ more tag ]', 'vkExUnit' ); ?></label></dt>
|
127 |
+
<dd>
|
128 |
<textarea rows="5" name="vkExUnit_Ads[more][]" id="ad_content_moretag" value="" style="width:100%;max-width:50em;" /><?php echo (isset( $option['more'][0] ) && $option['more'][0] )? $option['more'][0]: ''; ?></textarea>
|
129 |
+
<br/>
|
130 |
<textarea rows="5" name="vkExUnit_Ads[more][]" value="" style="width:100%;max-width:50em;" /><?php echo (isset( $option['more'][1] ) && $option['more'][1] )? $option['more'][1]: ''; ?></textarea>
|
131 |
+
</dd>
|
132 |
+
</dl>
|
133 |
+
<dl>
|
134 |
+
<dt><label for="ad_content_after"><?php _e( 'insert the ad [ after content ]', 'vkExUnit' ); ?></label></dt>
|
135 |
+
<dd>
|
136 |
<textarea rows="5" name="vkExUnit_Ads[after][]" id="ad_content_after" value="" style="width:100%;max-width:50em;" /><?php echo (isset( $option['after'][0] ) && $option['after'][0] )? $option['after'][0]: ''; ?></textarea>
|
137 |
+
<br/>
|
138 |
<textarea rows="5" name="vkExUnit_Ads[after][]" value="" style="width:100%;max-width:50em;" /><?php echo (isset( $option['after'][1] ) && $option['after'][1] )? $option['after'][1]: ''; ?></textarea>
|
139 |
+
</dd>
|
140 |
+
</dl>
|
141 |
</td></tr></table>
|
142 |
<?php submit_button(); ?>
|
143 |
</div>
|
144 |
<?php
|
145 |
}
|
|
|
146 |
}
|
147 |
|
148 |
+
vExUnit_Ads::instance();
|
plugins/meta_description.php
CHANGED
@@ -9,15 +9,15 @@
|
|
9 |
*/
|
10 |
|
11 |
// Public post type auto support
|
12 |
-
$postTypes = get_post_types(
|
13 |
|
14 |
-
foreach ($postTypes as $postType) {
|
15 |
add_post_type_support( $postType, 'excerpt' );
|
16 |
} // foreach ($postTypes as $postType) {
|
17 |
|
18 |
function vkExUnit_description_options_init() {
|
19 |
vkExUnit_register_setting(
|
20 |
-
__('Meta Description', 'vkExUnit'), // tab label.
|
21 |
'vkExUnit_description_options', // name attr
|
22 |
false, // sanitaise function name
|
23 |
'vkExUnit_add_description_options_page' // setting_page function name
|
@@ -26,18 +26,18 @@ function vkExUnit_description_options_init() {
|
|
26 |
add_action( 'admin_init', 'vkExUnit_description_options_init' );
|
27 |
|
28 |
|
29 |
-
function vkExUnit_add_description_options_page(){
|
30 |
?>
|
31 |
-
<h3><?php _e('Meta Description', 'vkExUnit'); ?></h3>
|
32 |
<div id="meta_description" class="sectionBox">
|
33 |
<table class="form-table">
|
34 |
-
<tr><th><?php _e('Meta Description','vkExUnit');?></th>
|
35 |
<td>
|
36 |
|
37 |
-
<?php _e('What you have to complete the "excerpt" column of the edit screen of each page will be reflected in the description of the meta tag.','vkExUnit') ?><br/>
|
38 |
-
<?php _e('Description of meta tags in the search results screen of search sites such as Google, will be Displayed, such as the bottom of the site title. If the excerpt column is blank, is 240 characters than text beginning of a sentence has become a specification that is applied as a description.','vkExUnit') ?><br/>
|
39 |
-
<?php _e('The meta description of the top page is subject to the catchphrase of the site. However, its contents will be reflected if the excerpt is entered in fixed page that was set on the top page.','vkExUnit') ?><br/>
|
40 |
-
* <?php _e('If "excerpt" column is not found, Click "Display Option" of page top at each article edit page, and check the expert column display.','vkExUnit') ?><br/>
|
41 |
</td></tr>
|
42 |
</table>
|
43 |
</div>
|
@@ -46,7 +46,7 @@ function vkExUnit_add_description_options_page(){
|
|
46 |
|
47 |
|
48 |
/*-------------------------------------------*/
|
49 |
-
/*
|
50 |
/*-------------------------------------------*/
|
51 |
add_filter( 'wp_head', 'vkExUnit_render_HeadDescription', 5 );
|
52 |
function vkExUnit_render_HeadDescription() {
|
9 |
*/
|
10 |
|
11 |
// Public post type auto support
|
12 |
+
$postTypes = get_post_types( array( 'public' => true ) );
|
13 |
|
14 |
+
foreach ( $postTypes as $postType ) {
|
15 |
add_post_type_support( $postType, 'excerpt' );
|
16 |
} // foreach ($postTypes as $postType) {
|
17 |
|
18 |
function vkExUnit_description_options_init() {
|
19 |
vkExUnit_register_setting(
|
20 |
+
__( 'Meta Description', 'vkExUnit' ), // tab label.
|
21 |
'vkExUnit_description_options', // name attr
|
22 |
false, // sanitaise function name
|
23 |
'vkExUnit_add_description_options_page' // setting_page function name
|
26 |
add_action( 'admin_init', 'vkExUnit_description_options_init' );
|
27 |
|
28 |
|
29 |
+
function vkExUnit_add_description_options_page() {
|
30 |
?>
|
31 |
+
<h3><?php _e( 'Meta Description', 'vkExUnit' ); ?></h3>
|
32 |
<div id="meta_description" class="sectionBox">
|
33 |
<table class="form-table">
|
34 |
+
<tr><th><?php _e( 'Meta Description','vkExUnit' );?></th>
|
35 |
<td>
|
36 |
|
37 |
+
<?php _e( 'What you have to complete the "excerpt" column of the edit screen of each page will be reflected in the description of the meta tag.','vkExUnit' ) ?><br/>
|
38 |
+
<?php _e( 'Description of meta tags in the search results screen of search sites such as Google, will be Displayed, such as the bottom of the site title. If the excerpt column is blank, is 240 characters than text beginning of a sentence has become a specification that is applied as a description.','vkExUnit' ) ?><br/>
|
39 |
+
<?php _e( 'The meta description of the top page is subject to the catchphrase of the site. However, its contents will be reflected if the excerpt is entered in fixed page that was set on the top page.','vkExUnit' ) ?><br/>
|
40 |
+
* <?php _e( 'If "excerpt" column is not found, Click "Display Option" of page top at each article edit page, and check the expert column display.','vkExUnit' ) ?><br/>
|
41 |
</td></tr>
|
42 |
</table>
|
43 |
</div>
|
46 |
|
47 |
|
48 |
/*-------------------------------------------*/
|
49 |
+
/* head_description
|
50 |
/*-------------------------------------------*/
|
51 |
add_filter( 'wp_head', 'vkExUnit_render_HeadDescription', 5 );
|
52 |
function vkExUnit_render_HeadDescription() {
|
plugins/meta_keyword.php
CHANGED
@@ -13,8 +13,8 @@ class vExUnit_meta_keywords {
|
|
13 |
private static $instance;
|
14 |
|
15 |
public static function instance() {
|
16 |
-
if ( isset( self::$instance ) )
|
17 |
-
return self::$instance;
|
18 |
|
19 |
self::$instance = new vExUnit_meta_keywords;
|
20 |
self::$instance->run_init();
|
@@ -28,16 +28,16 @@ class vExUnit_meta_keywords {
|
|
28 |
|
29 |
|
30 |
protected function run_init() {
|
31 |
-
add_action('admin_init', array($this, 'option_init' ));
|
32 |
-
add_action('admin_menu', array($this, 'add_custom_field'));
|
33 |
-
add_action('save_post' , array($this, 'save_custom_field'));
|
34 |
-
add_action('wp_head', array($this, 'set_HeadKeywords' ), 1);
|
35 |
}
|
36 |
|
37 |
|
38 |
public function option_init() {
|
39 |
vkExUnit_register_setting(
|
40 |
-
__('Meta Keywords', 'vkExUnit'), // tab label.
|
41 |
'vkExUnit_common_keywords', // name attr
|
42 |
array( $this, 'sanitize_config' ), // sanitaise function name
|
43 |
array( $this, 'render_configPage' ) // setting_page function name
|
@@ -45,37 +45,37 @@ class vExUnit_meta_keywords {
|
|
45 |
}
|
46 |
|
47 |
|
48 |
-
public function get_default_option(){
|
49 |
$option = '';
|
50 |
return $option;
|
51 |
}
|
52 |
|
53 |
|
54 |
-
public function sanitize_config( $option ){
|
55 |
-
$option = preg_replace('/^,*(.+)$/', '$1', $option);
|
56 |
-
$option = preg_replace('/,*$/', '', $option);
|
57 |
return $option;
|
58 |
}
|
59 |
|
60 |
|
61 |
-
public static function get_option(){
|
62 |
return get_option( 'vkExUnit_common_keywords', '' );
|
63 |
}
|
64 |
|
65 |
|
66 |
-
public function render_configPage(){
|
67 |
?>
|
68 |
-
<h3><?php _e('Meta Keyword', 'vkExUnit'); ?></h3>
|
69 |
<div id="meta_keyword" class="sectionBox">
|
70 |
<table class="form-table">
|
71 |
-
<tr><th><?php _e('Common Keywords','vkExUnit'); ?></th>
|
72 |
-
<td><?php _e('Keywords for meta tag. This words will set Meta Keyword with post keywords. if you want multiple keywords, enter with separator of ",".','vkExUnit'); ?><br />
|
73 |
<input type="text" name="vkExUnit_common_keywords" id="commonKeyWords" value="<?php echo self::get_option(); ?>" style="width:90%;" /><br />
|
74 |
|
75 |
-
* <?php _e('This is not seriously, Because the SearchEngine does not care this.','vkExUnit') ?><br/>
|
76 |
-
* <?php _e('For each page individual keyword is enter at the edit screen of each article. 10 keywords maximum, together with a each article keywords is desirable.','vkExUnit') ?><br/>
|
77 |
-
* <?php _e('"," separator at end of the last keyword is do not need.','vkExUnit') ?><br/>
|
78 |
-
<?php _e('Example: WordPress,template,theme,free,GPL','vkExUnit'); ?></td></tr>
|
79 |
</table>
|
80 |
<?php submit_button(); ?>
|
81 |
</div>
|
@@ -83,80 +83,80 @@ class vExUnit_meta_keywords {
|
|
83 |
}
|
84 |
|
85 |
|
86 |
-
public function add_custom_field(){
|
87 |
-
$post_types = get_post_types(array(),'objects');
|
88 |
-
foreach($post_types as $post){
|
89 |
-
if($post->_builtin) continue;
|
90 |
-
if(
|
91 |
-
add_meta_box('div1', __('Meta Keywords', 'vkExUnit'), array( $this, 'render_meta_box' ), $post->name, 'normal', 'high');
|
92 |
}
|
93 |
-
add_meta_box('div1', __('Meta Keywords', 'vkExUnit'), array( $this, 'render_meta_box' ), 'page', 'normal', 'high');
|
94 |
-
add_meta_box('div1', __('Meta Keywords', 'vkExUnit'), array( $this, 'render_meta_box' ), 'post', 'normal', 'high');
|
95 |
}
|
96 |
|
97 |
|
98 |
-
public function render_meta_box(){
|
99 |
global $post;
|
100 |
-
echo '<input type="hidden" name="_nonce_vkExUnit__custom_field_metaKeyword" id="_nonce_vkExUnit__custom_field_metaKeyword" value="'.wp_create_nonce(plugin_basename(__FILE__)).'" />';
|
101 |
-
echo '<label class="hidden" for="vkExUnit_metaKeyword">'.__('Meta Keywords', 'biz-vektor').'</label><input type="text" id="vkExUnit_metaKeyword" name="vkExUnit_metaKeyword" size="50" value="'.get_post_meta($post->ID, 'vkExUnit_metaKeyword', true).'" />';
|
102 |
-
echo '<p>'.__('To distinguish between individual keywords, please enter a , delimiter (optional).', 'vkExUnit').'<br />';
|
103 |
-
$theme_option_seo_link = '<a href="'.get_admin_url().'/admin.php?page=vkExUnit_main_setting#vkExUnit_common_keywords" target="_blank">'.vkExUnit_get_name().' '.__('Main setting', 'vkExUnit').'</a>';
|
104 |
-
echo sprintf(__('* keywords common to the entire site can be set from %s.', 'vkExUnit'),$theme_option_seo_link);
|
105 |
echo '</p>';
|
106 |
}
|
107 |
|
108 |
|
109 |
-
public function save_custom_field($post_id){
|
110 |
-
$metaKeyword = isset($_POST['_nonce_vkExUnit__custom_field_metaKeyword']) ? htmlspecialchars($_POST['_nonce_vkExUnit__custom_field_metaKeyword']) : null;
|
111 |
|
112 |
// if autosave is to deny
|
113 |
-
if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
114 |
-
|
115 |
|
116 |
-
if(!wp_verify_nonce($metaKeyword, plugin_basename(__FILE__))){
|
117 |
return $post_id;
|
118 |
}
|
119 |
-
if('page' == $_POST['vkExUnit_metaKeyword']){
|
120 |
-
if(!current_user_can('edit_page', $post_id)) return $post_id;
|
121 |
-
}else{
|
122 |
-
if(!current_user_can('edit_post', $post_id)) return $post_id;
|
123 |
}
|
124 |
|
125 |
$data = $_POST['vkExUnit_metaKeyword'];
|
126 |
|
127 |
-
if(get_post_meta($post_id, 'vkExUnit_metaKeyword') ==
|
128 |
-
add_post_meta($post_id, 'vkExUnit_metaKeyword', $data, true);
|
129 |
-
}elseif($data != get_post_meta($post_id, 'vkExUnit_metaKeyword', true)){
|
130 |
-
update_post_meta($post_id, 'vkExUnit_metaKeyword', $data);
|
131 |
-
}elseif($data ==
|
132 |
-
delete_post_meta($post_id, 'vkExUnit_metaKeyword', get_post_meta($post_id, 'vkExUnit_metaKeyword', true));
|
133 |
}
|
134 |
}
|
135 |
|
136 |
|
137 |
-
public function get_postKeyword(){
|
138 |
$post_id = get_the_id();
|
139 |
|
140 |
-
if(empty($post_id))
|
141 |
-
return null;
|
142 |
|
143 |
-
$keyword = get_post_meta($post_id, 'vkExUnit_metaKeyword', true);
|
144 |
return $keyword;
|
145 |
}
|
146 |
|
147 |
|
148 |
-
public function set_HeadKeywords(){
|
149 |
$commonKeyWords = self::get_option();
|
150 |
// get custom field
|
151 |
$entryKeyWords = self::get_postKeyword();
|
152 |
$keywords = array();
|
153 |
-
if($commonKeyWords){
|
154 |
-
if($entryKeyWords){
|
155 |
-
$key = implode( ',', $keywords);
|
156 |
// print individual keywords
|
157 |
-
if(
|
158 |
echo '<meta name="keywords" content="' . $key. '" />'."\n";
|
159 |
}
|
160 |
}
|
161 |
|
162 |
-
vExUnit_meta_keywords::instance();
|
13 |
private static $instance;
|
14 |
|
15 |
public static function instance() {
|
16 |
+
if ( isset( self::$instance ) ) {
|
17 |
+
return self::$instance; }
|
18 |
|
19 |
self::$instance = new vExUnit_meta_keywords;
|
20 |
self::$instance->run_init();
|
28 |
|
29 |
|
30 |
protected function run_init() {
|
31 |
+
add_action( 'admin_init', array( $this, 'option_init' ) );
|
32 |
+
add_action( 'admin_menu', array( $this, 'add_custom_field' ) );
|
33 |
+
add_action( 'save_post' , array( $this, 'save_custom_field' ) );
|
34 |
+
add_action( 'wp_head', array( $this, 'set_HeadKeywords' ), 1 );
|
35 |
}
|
36 |
|
37 |
|
38 |
public function option_init() {
|
39 |
vkExUnit_register_setting(
|
40 |
+
__( 'Meta Keywords', 'vkExUnit' ), // tab label.
|
41 |
'vkExUnit_common_keywords', // name attr
|
42 |
array( $this, 'sanitize_config' ), // sanitaise function name
|
43 |
array( $this, 'render_configPage' ) // setting_page function name
|
45 |
}
|
46 |
|
47 |
|
48 |
+
public function get_default_option() {
|
49 |
$option = '';
|
50 |
return $option;
|
51 |
}
|
52 |
|
53 |
|
54 |
+
public function sanitize_config( $option ) {
|
55 |
+
$option = preg_replace( '/^,*(.+)$/', '$1', $option );
|
56 |
+
$option = preg_replace( '/,*$/', '', $option );
|
57 |
return $option;
|
58 |
}
|
59 |
|
60 |
|
61 |
+
public static function get_option() {
|
62 |
return get_option( 'vkExUnit_common_keywords', '' );
|
63 |
}
|
64 |
|
65 |
|
66 |
+
public function render_configPage() {
|
67 |
?>
|
68 |
+
<h3><?php _e( 'Meta Keyword', 'vkExUnit' ); ?></h3>
|
69 |
<div id="meta_keyword" class="sectionBox">
|
70 |
<table class="form-table">
|
71 |
+
<tr><th><?php _e( 'Common Keywords','vkExUnit' ); ?></th>
|
72 |
+
<td><?php _e( 'Keywords for meta tag. This words will set Meta Keyword with post keywords. if you want multiple keywords, enter with separator of ",".','vkExUnit' ); ?><br />
|
73 |
<input type="text" name="vkExUnit_common_keywords" id="commonKeyWords" value="<?php echo self::get_option(); ?>" style="width:90%;" /><br />
|
74 |
|
75 |
+
* <?php _e( 'This is not seriously, Because the SearchEngine does not care this.','vkExUnit' ) ?><br/>
|
76 |
+
* <?php _e( 'For each page individual keyword is enter at the edit screen of each article. 10 keywords maximum, together with a each article keywords is desirable.','vkExUnit' ) ?><br/>
|
77 |
+
* <?php _e( '"," separator at end of the last keyword is do not need.','vkExUnit' ) ?><br/>
|
78 |
+
<?php _e( 'Example: WordPress,template,theme,free,GPL','vkExUnit' ); ?></td></tr>
|
79 |
</table>
|
80 |
<?php submit_button(); ?>
|
81 |
</div>
|
83 |
}
|
84 |
|
85 |
|
86 |
+
public function add_custom_field() {
|
87 |
+
$post_types = get_post_types( array(),'objects' );
|
88 |
+
foreach ( $post_types as $post ) {
|
89 |
+
if ( $post->_builtin ) { continue; }
|
90 |
+
if ( ! $post->public ) { continue; }
|
91 |
+
add_meta_box( 'div1', __( 'Meta Keywords', 'vkExUnit' ), array( $this, 'render_meta_box' ), $post->name, 'normal', 'high' );
|
92 |
}
|
93 |
+
add_meta_box( 'div1', __( 'Meta Keywords', 'vkExUnit' ), array( $this, 'render_meta_box' ), 'page', 'normal', 'high' );
|
94 |
+
add_meta_box( 'div1', __( 'Meta Keywords', 'vkExUnit' ), array( $this, 'render_meta_box' ), 'post', 'normal', 'high' );
|
95 |
}
|
96 |
|
97 |
|
98 |
+
public function render_meta_box() {
|
99 |
global $post;
|
100 |
+
echo '<input type="hidden" name="_nonce_vkExUnit__custom_field_metaKeyword" id="_nonce_vkExUnit__custom_field_metaKeyword" value="'.wp_create_nonce( plugin_basename( __FILE__ ) ).'" />';
|
101 |
+
echo '<label class="hidden" for="vkExUnit_metaKeyword">'.__( 'Meta Keywords', 'biz-vektor' ).'</label><input type="text" id="vkExUnit_metaKeyword" name="vkExUnit_metaKeyword" size="50" value="'.get_post_meta( $post->ID, 'vkExUnit_metaKeyword', true ).'" />';
|
102 |
+
echo '<p>'.__( 'To distinguish between individual keywords, please enter a , delimiter (optional).', 'vkExUnit' ).'<br />';
|
103 |
+
$theme_option_seo_link = '<a href="'.get_admin_url().'/admin.php?page=vkExUnit_main_setting#vkExUnit_common_keywords" target="_blank">'.vkExUnit_get_name().' '.__( 'Main setting', 'vkExUnit' ).'</a>';
|
104 |
+
echo sprintf( __( '* keywords common to the entire site can be set from %s.', 'vkExUnit' ),$theme_option_seo_link );
|
105 |
echo '</p>';
|
106 |
}
|
107 |
|
108 |
|
109 |
+
public function save_custom_field( $post_id ) {
|
110 |
+
$metaKeyword = isset( $_POST['_nonce_vkExUnit__custom_field_metaKeyword'] ) ? htmlspecialchars( $_POST['_nonce_vkExUnit__custom_field_metaKeyword'] ) : null;
|
111 |
|
112 |
// if autosave is to deny
|
113 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
114 |
+
return $post_id; }
|
115 |
|
116 |
+
if ( ! wp_verify_nonce( $metaKeyword, plugin_basename( __FILE__ ) ) ) {
|
117 |
return $post_id;
|
118 |
}
|
119 |
+
if ( 'page' == $_POST['vkExUnit_metaKeyword'] ) {
|
120 |
+
if ( ! current_user_can( 'edit_page', $post_id ) ) { return $post_id; }
|
121 |
+
} else {
|
122 |
+
if ( ! current_user_can( 'edit_post', $post_id ) ) { return $post_id; }
|
123 |
}
|
124 |
|
125 |
$data = $_POST['vkExUnit_metaKeyword'];
|
126 |
|
127 |
+
if ( get_post_meta( $post_id, 'vkExUnit_metaKeyword' ) == '' ) {
|
128 |
+
add_post_meta( $post_id, 'vkExUnit_metaKeyword', $data, true );
|
129 |
+
} elseif ( $data != get_post_meta( $post_id, 'vkExUnit_metaKeyword', true ) ) {
|
130 |
+
update_post_meta( $post_id, 'vkExUnit_metaKeyword', $data );
|
131 |
+
} elseif ( $data == '' ) {
|
132 |
+
delete_post_meta( $post_id, 'vkExUnit_metaKeyword', get_post_meta( $post_id, 'vkExUnit_metaKeyword', true ) );
|
133 |
}
|
134 |
}
|
135 |
|
136 |
|
137 |
+
public function get_postKeyword() {
|
138 |
$post_id = get_the_id();
|
139 |
|
140 |
+
if ( empty( $post_id ) ) {
|
141 |
+
return null; }
|
142 |
|
143 |
+
$keyword = get_post_meta( $post_id, 'vkExUnit_metaKeyword', true );
|
144 |
return $keyword;
|
145 |
}
|
146 |
|
147 |
|
148 |
+
public function set_HeadKeywords() {
|
149 |
$commonKeyWords = self::get_option();
|
150 |
// get custom field
|
151 |
$entryKeyWords = self::get_postKeyword();
|
152 |
$keywords = array();
|
153 |
+
if ( $commonKeyWords ) { $keywords[] = $commonKeyWords; }
|
154 |
+
if ( $entryKeyWords ) { $keywords[] = $entryKeyWords; }
|
155 |
+
$key = implode( ',', $keywords );
|
156 |
// print individual keywords
|
157 |
+
if ( ! $key ) { return; }
|
158 |
echo '<meta name="keywords" content="' . $key. '" />'."\n";
|
159 |
}
|
160 |
}
|
161 |
|
162 |
+
vExUnit_meta_keywords::instance();
|
plugins/other_widget/old/widget-rss-widget.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
-
/*
|
4 |
/*-------------------------------------------*/
|
5 |
class wp_widget_bizvektor_rss extends WP_Widget {
|
6 |
function wp_widget_bizvektor_rss() {
|
@@ -9,36 +9,36 @@ class wp_widget_bizvektor_rss extends WP_Widget {
|
|
9 |
'description' => __( 'Displays entries list from a RSS feed link.', 'biz-vektor' ),
|
10 |
);
|
11 |
$widget_name = vkExUnit_get_short_name().'_' . __( 'RSS entries for top', 'biz-vektor' );
|
12 |
-
$this->WP_Widget('rsswidget', $widget_name, $widget_ops);
|
13 |
}
|
14 |
-
function widget($args, $instance){
|
15 |
$options = biz_vektor_get_theme_options();
|
16 |
-
if(preg_match('/^http.*$/',$instance['url'])){
|
17 |
echo '<div id="rss_widget">';
|
18 |
-
biz_vektor_blogList($instance);
|
19 |
echo '</div>';
|
20 |
}
|
21 |
}
|
22 |
-
function form($instance){
|
23 |
$defaults = array(
|
24 |
'url' => '',
|
25 |
'label' => __( 'Blog entries', 'biz-vektor' ),
|
26 |
);
|
27 |
-
$instance = wp_parse_args((array) $instance, $defaults);
|
28 |
|
29 |
?>
|
30 |
-
<Label for="<?php echo $this->get_field_id('label'); ?>"><?php _e( 'Heading title', 'biz-vektor' ) ?></label><br/>
|
31 |
-
<input type="text" id="<?php echo $this->get_field_id('label'); ?>-title" name="<?php echo $this->get_field_name('label'); ?>" value="<?php echo $instance['label']; ?>" />
|
32 |
-
|
33 |
-
<Label for="<?php echo $this->get_field_id('url'); ?>">URL</label><br/>
|
34 |
-
<input type="text" id="<?php echo $this->get_field_id('url'); ?>" name="<?php echo $this->get_field_name('url'); ?>" value="<?php echo $instance['url']; ?>" />
|
35 |
<?php
|
36 |
}
|
37 |
-
function update($new_instance, $old_instance){
|
38 |
$instance = $old_instance;
|
39 |
$instance['url'] = $new_instance['url'];
|
40 |
$instance['label'] = $new_instance['label'];
|
41 |
return $instance;
|
42 |
}
|
43 |
}
|
44 |
-
add_action('widgets_init', create_function('', 'return register_widget("wp_widget_bizvektor_rss");'));
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
+
/* RSS widget
|
4 |
/*-------------------------------------------*/
|
5 |
class wp_widget_bizvektor_rss extends WP_Widget {
|
6 |
function wp_widget_bizvektor_rss() {
|
9 |
'description' => __( 'Displays entries list from a RSS feed link.', 'biz-vektor' ),
|
10 |
);
|
11 |
$widget_name = vkExUnit_get_short_name().'_' . __( 'RSS entries for top', 'biz-vektor' );
|
12 |
+
$this->WP_Widget( 'rsswidget', $widget_name, $widget_ops );
|
13 |
}
|
14 |
+
function widget( $args, $instance ) {
|
15 |
$options = biz_vektor_get_theme_options();
|
16 |
+
if ( preg_match( '/^http.*$/',$instance['url'] ) ) {
|
17 |
echo '<div id="rss_widget">';
|
18 |
+
biz_vektor_blogList( $instance );
|
19 |
echo '</div>';
|
20 |
}
|
21 |
}
|
22 |
+
function form( $instance ) {
|
23 |
$defaults = array(
|
24 |
'url' => '',
|
25 |
'label' => __( 'Blog entries', 'biz-vektor' ),
|
26 |
);
|
27 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
28 |
|
29 |
?>
|
30 |
+
<Label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Heading title', 'biz-vektor' ) ?></label><br/>
|
31 |
+
<input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" />
|
32 |
+
<br/>
|
33 |
+
<Label for="<?php echo $this->get_field_id( 'url' ); ?>">URL</label><br/>
|
34 |
+
<input type="text" id="<?php echo $this->get_field_id( 'url' ); ?>" name="<?php echo $this->get_field_name( 'url' ); ?>" value="<?php echo $instance['url']; ?>" />
|
35 |
<?php
|
36 |
}
|
37 |
+
function update( $new_instance, $old_instance ) {
|
38 |
$instance = $old_instance;
|
39 |
$instance['url'] = $new_instance['url'];
|
40 |
$instance['label'] = $new_instance['label'];
|
41 |
return $instance;
|
42 |
}
|
43 |
}
|
44 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("wp_widget_bizvektor_rss");' ) );
|
plugins/other_widget/other_widget.php
CHANGED
@@ -6,4 +6,26 @@ require vkExUnit_get_directory() . '/plugins/other_widget/widget-page.php';
|
|
6 |
require vkExUnit_get_directory() . '/plugins/other_widget/widget-taxonomies.php';
|
7 |
require vkExUnit_get_directory() . '/plugins/other_widget/widget-archives.php';
|
8 |
require vkExUnit_get_directory() . '/plugins/other_widget/widget-pr-blocks.php';
|
9 |
-
// require vkExUnit_get_directory() . '/plugins/other_widget/widget-child-page-list.php';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
require vkExUnit_get_directory() . '/plugins/other_widget/widget-taxonomies.php';
|
7 |
require vkExUnit_get_directory() . '/plugins/other_widget/widget-archives.php';
|
8 |
require vkExUnit_get_directory() . '/plugins/other_widget/widget-pr-blocks.php';
|
9 |
+
// require vkExUnit_get_directory() . '/plugins/other_widget/widget-child-page-list.php';
|
10 |
+
|
11 |
+
add_filter( 'getarchives_where', 'vkExUnit_info_getarchives_where', 10, 2 );
|
12 |
+
function vkExUnit_info_getarchives_where( $where, $r ) {
|
13 |
+
global $my_archives_post_type;
|
14 |
+
if ( isset( $r['post_type'] ) ) {
|
15 |
+
$my_archives_post_type = $r['post_type'];
|
16 |
+
$where = str_replace( '\'post\'', '\'' . $r['post_type'] . '\'', $where );
|
17 |
+
} else {
|
18 |
+
$my_archives_post_type = '';
|
19 |
+
}
|
20 |
+
return $where;
|
21 |
+
}
|
22 |
+
|
23 |
+
add_filter( 'get_archives_link', 'vkExUnit_info_get_archives_link' );
|
24 |
+
function vkExUnit_info_get_archives_link( $link_html ) {
|
25 |
+
global $my_archives_post_type;
|
26 |
+
if ( $my_archives_post_type != '' ) {
|
27 |
+
$add_link = '?post_type=' . $my_archives_post_type;
|
28 |
+
$link_html = preg_replace( "/href=\'(.+)\'/", "href='$1" . $add_link. "'", $link_html );
|
29 |
+
}
|
30 |
+
return $link_html;
|
31 |
+
}
|
plugins/other_widget/widget-3pr-area.php
CHANGED
@@ -1,394 +1,394 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_3PR_area extends WP_Widget {
|
7 |
|
8 |
-
|
9 |
-
$widget_name = vkExUnit_get_short_name(). '_' . __(
|
10 |
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
}
|
17 |
|
18 |
-
|
19 |
-
|
20 |
'label_1' => __( '3PR area1 title', 'vkExUnit' ),
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
);
|
42 |
-
|
43 |
-
|
44 |
<?php // 3PR area 1 =========================================================== ?>
|
45 |
<?php // 3PR area 1 タイトル ?>
|
46 |
<h5 class="pr_subTitle"><?php _e( '3PR area1 setting', 'vkExUnit' ); ?></h5>
|
47 |
-
|
48 |
-
<label for="<?php echo $this->get_field_id('label_1'); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
|
49 |
-
<input type="text" id="<?php echo $this->get_field_id('label_1'); ?>-title" class="pr-input" name="<?php echo $this->get_field_name('label_1'); ?>" value="<?php echo $instance['label_1']; ?>" />
|
50 |
-
|
51 |
|
52 |
<?php // 3PR area 1 メディアアップローダー PC ?>
|
53 |
-
|
54 |
-
<label for="<?php echo $this->get_field_id('media_3pr_image_1'); ?>"><?php _e( 'Select image for PC:', 'vkExUnit' ); ?></label><br/>
|
55 |
-
<input type="hidden" class="media_image_3pr_pc <?php echo $this->get_field_id('media_3pr_image_1'); ?>" id="<?php echo $this->get_field_id('media_3pr_image_1'); ?>-image" name="<?php echo $this->get_field_name('media_3pr_image_1'); ?>" value="<?php echo esc_attr($instance['media_3pr_image_1']); ?>" />
|
56 |
-
<input type="hidden" class="media_alt_3pr_pc" id="<?php echo $this->get_field_id('media_3pr_alt_1'); ?>-alt" name="<?php echo $this->get_field_name('media_3pr_alt_1'); ?>" value="<?php echo esc_attr($instance['media_3pr_alt_1']); ?>" />
|
57 |
<input type="button" class="media_select select_3pr" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3pr(event.target);" />
|
58 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3pr(event.target);" />
|
59 |
</p>
|
60 |
<div class="media image_3pr">
|
61 |
-
<?php if(!empty($instance['media_3pr_image_1'])):
|
62 |
-
<img class="media_image image_3pr" src="<?php echo esc_url($instance['media_3pr_image_1']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_1']); ?>" />
|
63 |
<?php endif; ?>
|
64 |
</div>
|
65 |
|
66 |
<?php // 3PR area 1 メディアアップローダー sp image ?>
|
67 |
<p>
|
68 |
-
<label for="<?php echo $this->get_field_id('media_3pr_image_sp_1'); ?>"><?php _e( 'Select image for Mobile:', 'vkExUnit' ); ?></label><br/>
|
69 |
|
70 |
-
<input type="hidden" class="media_image_3pr_sp" id="<?php echo $this->get_field_id('media_3pr_image_sp_1'); ?>_image" name="<?php echo $this->get_field_name('media_3pr_image_sp_1'); ?>" value="<?php echo esc_attr($instance['media_3pr_image_sp_1']); ?>" />
|
71 |
|
72 |
-
<input type="hidden" class="media_alt_3pr_sp" id="<?php echo $this->get_field_id('media_3pr_alt_sp_1'); ?>-alt" name="<?php echo $this->get_field_name('media_3pr_alt_sp_1'); ?>" value="<?php echo esc_attr($instance['media_3pr_alt_sp_1']); ?>" />
|
73 |
|
74 |
<input type="button" class="media_select" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3prSP(event.target);" />
|
75 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3prSP(event.target);" />
|
76 |
</p>
|
77 |
<div class="media image_3pr_sp">
|
78 |
-
<?php if(!empty($instance['media_3pr_image_sp_1'])):
|
79 |
-
<img class="media_image image_3pr_sp" src="<?php echo esc_url($instance['media_3pr_image_sp_1']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_sp_1']); ?>" />
|
80 |
<?php endif; ?>
|
81 |
</div>
|
82 |
|
83 |
<?php // 概要テキスト ?>
|
84 |
-
<p><label for="<?php echo $this->get_field_id('summary_1'); ?>"><?php _e( 'Summary Text:', 'vkExUnit' ); ?></label><br/>
|
85 |
-
|
86 |
|
87 |
-
<textarea rows="4" cols="40" id="<?php echo $this->get_field_id('summary_1'); ?>_text" class="pr_input textarea" name="<?php echo $this->get_field_name('summary_1'); ?>"><?php echo $instance['summary_1']; ?></textarea>
|
88 |
|
89 |
<?php // リンク先_URL ?>
|
90 |
-
<p><label for="<?php echo $this->get_field_id('linkurl_1'); ?>"><?php _e( 'Link URL:', 'vkExUnit' ); ?></label><br/>
|
91 |
-
<input type="text" id="<?php echo $this->get_field_id('linkurl_1'); ?>_title" class="pr_input" name="<?php echo $this->get_field_name('linkurl_1'); ?>" value="<?php echo $instance['linkurl_1']; ?>" />
|
92 |
-
|
93 |
|
94 |
<hr /><?php // 3PR area 2 =================================================?>
|
95 |
<?php // 3PR area 2 タイトル ?>
|
96 |
<h5 class="pr_subTitle"><?php _e( '3PR area2 setting', 'vkExUnit' ); ?></h5>
|
97 |
-
|
98 |
-
<label for="<?php echo $this->get_field_id('label_2'); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
|
99 |
-
<input type="text" id="<?php echo $this->get_field_id('label_2'); ?>_title" class="pr_input" name="<?php echo $this->get_field_name('label_2'); ?>" value="<?php echo $instance['label_2']; ?>" />
|
100 |
-
|
101 |
|
102 |
<?php // 3PR area 1 メディアアップローダー PC ?>
|
103 |
-
|
104 |
-
<label for="<?php echo $this->get_field_id('media_3pr_image_2'); ?>"><?php _e( 'Select image for PC:', 'vkExUnit' ); ?></label><br/>
|
105 |
|
106 |
-
<input type="hidden" class="media_image_3pr_pc <?php echo $this->get_field_id('media_3pr_image_2'); ?>" id="<?php echo $this->get_field_id('media_3pr_image_2'); ?>_image" name="<?php echo $this->get_field_name('media_3pr_image_2'); ?>" value="<?php echo esc_attr($instance['media_3pr_image_2']); ?>" />
|
107 |
|
108 |
-
<input type="hidden" class="media_alt_3pr_pc" id="<?php echo $this->get_field_id('media_3pr_alt_2'); ?>_alt" name="<?php echo $this->get_field_name('media_3pr_alt_2'); ?>" value="<?php echo esc_attr($instance['media_3pr_alt_2']); ?>" />
|
109 |
|
110 |
<input type="button" class="media_select select_3pr" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3pr(event.target);" />
|
111 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3pr(event.target);" />
|
112 |
</p>
|
113 |
|
114 |
<div class="media image_3pr">
|
115 |
-
<?php if(!empty($instance['media_3pr_image_2'])):
|
116 |
-
<img class="media_image image_3pr" src="<?php echo esc_url($instance['media_3pr_image_2']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_2']); ?>" />
|
117 |
<?php endif; ?>
|
118 |
</div>
|
119 |
|
120 |
<?php // 3PR area 2 メディアアップローダー sp ?>
|
121 |
<p>
|
122 |
-
<label for="<?php echo $this->get_field_id('media_3pr_image_sp_2'); ?>"><?php _e( 'Select image for Mobile:', 'vkExUnit' ); ?></label><br/>
|
123 |
|
124 |
-
<input type="hidden" class="media_image_3pr_sp" id="<?php echo $this->get_field_id('media_3pr_image_sp_2'); ?>_image" name="<?php echo $this->get_field_name('media_3pr_image_sp_2'); ?>" value="<?php echo esc_attr($instance['media_3pr_image_sp_2']); ?>" />
|
125 |
|
126 |
-
<input type="hidden" class="media_alt_3pr_sp" id="<?php echo $this->get_field_id('media_3pr_alt_sp_2'); ?>_alt" name="<?php echo $this->get_field_name('media_3pr_alt_sp_2'); ?>" value="<?php echo esc_attr($instance['media_3pr_alt_sp_2']); ?>" />
|
127 |
|
128 |
<input type="button" class="media_select" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3prSP(event.target);" />
|
129 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3prSP(event.target);" />
|
130 |
</p>
|
131 |
<div class="media image_3pr_sp">
|
132 |
-
<?php if(!empty($instance['media_3pr_image_sp_2'])):
|
133 |
-
<img class="media_image image_3pr_sp" src="<?php echo esc_url($instance['media_3pr_image_sp_2']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_sp_2']); ?>" />
|
134 |
<?php endif; ?>
|
135 |
</div>
|
136 |
|
137 |
<?php //概要テキスト ?>
|
138 |
-
<p><label for="<?php echo $this->get_field_id('summary_2'); ?>"><?php _e( 'Summary Text:', 'vkExUnit' ); ?></label></p>
|
139 |
-
<textarea rows="4" cols="40" id="<?php echo $this->get_field_id('summary_2'); ?>_text" class="pr_input textarea" name="<?php echo $this->get_field_name('summary_2'); ?>"><?php echo $instance['summary_2']; ?></textarea>
|
140 |
|
141 |
<?php //リンク先_URL ?>
|
142 |
-
<p><label for="<?php echo $this->get_field_id('linkurl_2'); ?>"><?php _e( 'Link URL:', 'vkExUnit' ); ?></label><br/>
|
143 |
-
<input type="text" id="<?php echo $this->get_field_id('linkurl_2'); ?>_title" class="pr_input" name="<?php echo $this->get_field_name('linkurl_2'); ?>" value="<?php echo $instance['linkurl_2']; ?>" />
|
144 |
-
|
145 |
<hr /><?php // 3PR area 3 =================================================?>
|
146 |
<?php // 3PR area 3 タイトル ?>
|
147 |
<h5 class="pr_subTitle"><?php _e( '3PR area3 setting', 'vkExUnit' ); ?></h5>
|
148 |
-
|
149 |
-
<label for="<?php echo $this->get_field_id('label_3'); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
|
150 |
-
<input type="text" id="<?php echo $this->get_field_id('label_3'); ?>_title" class="pr_input" name="<?php echo $this->get_field_name('label_3'); ?>" value="<?php echo $instance['label_3']; ?>" />
|
151 |
-
|
152 |
|
153 |
<?php // 3PR area 1 メディアアップローダー PC ?>
|
154 |
-
|
155 |
-
<label for="<?php echo $this->get_field_id('media_3pr_image_3'); ?>"><?php _e( 'Select image for PC:', 'vkExUnit' ); ?></label><br/>
|
156 |
|
157 |
-
<input type="hidden" class="media_image_3pr_pc <?php echo $this->get_field_id('media_3pr_image_3'); ?>" id="<?php echo $this->get_field_id('media_3pr_image_3'); ?>_image" name="<?php echo $this->get_field_name('media_3pr_image_3'); ?>" value="<?php echo esc_attr($instance['media_3pr_image_3']); ?>" />
|
158 |
|
159 |
-
<input type="hidden" class="media_alt_3pr_pc" id="<?php echo $this->get_field_id('media_3pr_alt_3'); ?>-alt" name="<?php echo $this->get_field_name('media_3pr_alt_3'); ?>" value="<?php echo esc_attr($instance['media_3pr_alt_3']); ?>" />
|
160 |
|
161 |
<input type="button" class="media_select select_3pr" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3pr(event.target);" />
|
162 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3pr(event.target);" />
|
163 |
</p>
|
164 |
<div class="media image_3pr">
|
165 |
-
<?php if(!empty($instance['media_3pr_image_3'])):
|
166 |
-
<img class="media_image image_3pr" src="<?php echo esc_url($instance['media_3pr_image_3']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_3']); ?>" />
|
167 |
<?php endif; ?>
|
168 |
</div>
|
169 |
|
170 |
<?php // 3PR area 2 メディアアップローダー sp ?>
|
171 |
<p>
|
172 |
-
<label for="<?php echo $this->get_field_id('media_3pr_image_sp_3'); ?>"><?php _e( 'Select image for Mobile:', 'vkExUnit' ); ?></label><br/>
|
173 |
|
174 |
-
<input type="hidden" class="media_image_3pr_sp" id="<?php echo $this->get_field_id('media_3pr_image_sp_3'); ?>_image" name="<?php echo $this->get_field_name('media_3pr_image_sp_3'); ?>" value="<?php echo esc_attr($instance['media_3pr_image_sp_3']); ?>" />
|
175 |
|
176 |
-
<input type="hidden" class="media_alt_3pr_sp" id="<?php echo $this->get_field_id('media_3pr_alt_sp_3'); ?>_alt" name="<?php echo $this->get_field_name('media_3pr_alt_sp_3'); ?>" value="<?php echo esc_attr($instance['media_3pr_alt_sp_3']); ?>" />
|
177 |
|
178 |
<input type="button" class="media_select" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3prSP(event.target);" />
|
179 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3prSP(event.target);" />
|
180 |
</p>
|
181 |
|
182 |
<div class="media image_3pr_sp">
|
183 |
-
<?php if(!empty($instance['media_3pr_image_sp_3'])):
|
184 |
-
<img class="media_image image_3pr_sp" src="<?php echo esc_url($instance['media_3pr_image_sp_3']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_sp_3']); ?>" />
|
185 |
<?php endif; ?>
|
186 |
</div>
|
187 |
<?php //概要テキスト ?>
|
188 |
-
<p><label for="<?php echo $this->get_field_id('summary_3'); ?>"><?php _e( 'Summary Text:', 'vkExUnit' ); ?></label>
|
189 |
-
|
190 |
-
<textarea rows="4" cols="40" id="<?php echo $this->get_field_id('summary_3'); ?>_text" class="pr_input textarea" name="<?php echo $this->get_field_name('summary_3'); ?>"><?php echo $instance['summary_3']; ?></textarea>
|
191 |
<?php //リンク先_URL ?>
|
192 |
-
<p><label for="<?php echo $this->get_field_id('linkurl_3'); ?>"><?php _e( 'Link URL:', 'vkExUnit' ); ?></label><br/>
|
193 |
-
<input type="text" id="<?php echo $this->get_field_id('linkurl_3'); ?>_title" class="pr_input" name="<?php echo $this->get_field_name('linkurl_3'); ?>" value="<?php echo $instance['linkurl_3']; ?>" />
|
194 |
-
|
195 |
-
|
196 |
-
}
|
197 |
|
198 |
|
199 |
-
|
200 |
|
201 |
-
|
202 |
|
203 |
-
|
204 |
-
|
205 |
-
|
206 |
-
|
207 |
-
|
208 |
-
|
209 |
-
|
210 |
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
-
|
226 |
|
227 |
-
|
228 |
-
|
229 |
|
230 |
|
231 |
-
function widget($args, $instance) {
|
232 |
-
|
233 |
-
|
234 |
-
|
235 |
-
<div class="prArea col-md-4">
|
236 |
-
<?php
|
237 |
-
echo '<h1 class="subSection-title">';
|
238 |
-
if ( isset($instance['label_1']) && $instance['label_1'] ) {
|
239 |
-
|
240 |
-
} else {
|
241 |
-
|
242 |
-
}
|
243 |
-
echo '</h1>'.PHP_EOL; ?>
|
244 |
-
<?php if( isset($instance['media_3pr_image_1'], $instance['media_3pr_image_sp_1']) ):
|
245 |
-
<div class="media_pr">
|
246 |
-
<?php if( !empty($instance['linkurl_1']) ):
|
247 |
-
|
248 |
-
|
249 |
-
<img <?php if( !empty($instance['media_3pr_image_sp_1']) ){
|
250 |
<?php endif;
|
251 |
-
|
252 |
-
<img class="media_sp" src="<?php echo esc_url($instance['media_3pr_image_sp_1']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_sp_1']); ?>" />
|
253 |
<?php endif; ?>
|
254 |
-
</a>
|
255 |
-
<?php else:
|
256 |
-
if( !empty($instance['media_3pr_image_1']) ):
|
257 |
-
|
258 |
-
|
259 |
-
|
260 |
-
<img class="media_sp" src="<?php echo esc_url($instance['media_3pr_image_sp_1']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_sp_1']); ?>" />
|
261 |
<?php endif;
|
262 |
endif; ?>
|
263 |
-
</div>
|
264 |
-
<!--//.media_pr -->
|
265 |
-
<?php endif;
|
266 |
-
if( !empty($instance['summary_1']) ){
|
267 |
-
echo '<p class="summary">'.nl2br(esc_attr($instance['summary_1'])).'</p>'.PHP_EOL;
|
268 |
}
|
269 |
-
if( !empty($instance['linkurl_1']) ){
|
270 |
-
|
271 |
} ?>
|
272 |
-
</div>
|
273 |
-
<!-- // div.prArea1 -->
|
274 |
-
<?php endif; ?>
|
275 |
|
276 |
-
<?php if( isset($instance['label_2']) && $instance['label_2'] ):
|
277 |
-
<div class="prArea col-md-4">
|
278 |
-
<?php
|
279 |
echo '<h1 class="subSection-title">';
|
280 |
-
if ( isset($instance['label_2']) && $instance['label_2'] ) {
|
281 |
echo $instance['label_2'];
|
282 |
} else {
|
283 |
-
_e(
|
284 |
}
|
285 |
-
|
286 |
-
if( isset($instance['media_3pr_image_2'], $instance['media_3pr_image_sp_2']) ):
|
287 |
-
<div class="media_pr">
|
288 |
-
|
289 |
-
<a href="<?php echo esc_url($instance['linkurl_2']); ?>" >
|
290 |
-
<?php if( !empty($instance['media_3pr_image_2']) ):
|
291 |
-
<img <?php if( !empty($instance['media_3pr_image_sp_2']) ){
|
292 |
<?php endif;
|
293 |
-
|
294 |
-
<img class="media_sp" src="<?php echo esc_url($instance['media_3pr_image_sp_2']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_sp_2']); ?>" />
|
295 |
<?php endif; ?>
|
296 |
</a>
|
297 |
-
<?php else:
|
298 |
-
if( !empty($instance['media_3pr_image_2']) ):
|
299 |
-
<img <?php if( !empty($instance['media_3pr_image_sp_2']) ){
|
300 |
<?php endif;
|
301 |
-
if( !empty($instance['media_3pr_image_sp_2']) ):
|
302 |
-
<img class="media_sp" src="<?php echo esc_url($instance['media_3pr_image_sp_2']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_sp_2']); ?>" />
|
303 |
<?php endif;
|
304 |
-
endif; ?>
|
305 |
-
</div>
|
306 |
-
<!--//.media_pr -->
|
307 |
-
<?php endif;
|
308 |
-
if( !empty($instance['summary_2']) ){
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
?>
|
315 |
-
</div>
|
316 |
-
<!-- // div.prArea2 -->
|
317 |
-
<?php endif; ?>
|
318 |
|
319 |
-
<?php if( isset($instance['label_3']) && $instance['label_3'] ):
|
320 |
<div class="prArea col-md-4">
|
321 |
<?php
|
322 |
echo '<h1 class="subSection-title">';
|
323 |
-
|
324 |
-
|
325 |
-
|
326 |
-
|
327 |
-
|
328 |
echo '</h1>'.PHP_EOL;
|
329 |
-
if( isset($instance['media_3pr_image_3'], $instance['media_3pr_image_sp_3']) ):
|
330 |
<div class="media_pr">
|
331 |
-
<?php if( !empty($instance['linkurl_3']) ):
|
332 |
-
<a href="<?php echo esc_url($instance['linkurl_3']); ?>" >
|
333 |
-
<?php if( !empty($instance['media_3pr_image_3']) ):
|
334 |
-
<img <?php if( !empty($instance['media_3pr_image_sp_3']) ){
|
335 |
<?php endif;
|
336 |
-
|
337 |
-
<img class="media_sp" src="<?php echo esc_url($instance['media_3pr_image_sp_3']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_sp_3']); ?>" />
|
338 |
<?php endif; ?>
|
339 |
-
|
340 |
-
<?php else: // no link
|
341 |
-
if( !empty($instance['media_3pr_image_3']) ):
|
342 |
-
<img <?php if( !empty($instance['media_3pr_image_sp_3']) ){
|
343 |
<?php endif;
|
344 |
-
if( !empty($instance['media_3pr_image_sp_3']) ):
|
345 |
-
<img class="media_sp" src="<?php echo esc_url($instance['media_3pr_image_sp_3']); ?>" alt="<?php echo esc_attr($instance['media_3pr_alt_sp_3']); ?>" />
|
346 |
<?php endif;
|
347 |
endif; ?>
|
348 |
</div>
|
349 |
<!--//.media_pr -->
|
350 |
<?php endif;
|
351 |
-
if( !empty($instance['summary_3']) ){
|
352 |
-
echo '<p class="summary">'.nl2br(esc_attr($instance['summary_3'])).'</p>'.PHP_EOL;
|
353 |
}
|
354 |
-
if( !empty($instance['linkurl_3']) ){
|
355 |
-
|
356 |
} ?>
|
357 |
</div>
|
358 |
<!-- // div.prArea3 -->
|
359 |
<?php endif; ?>
|
360 |
-
</div>
|
361 |
-
<?php
|
362 |
-
|
363 |
-
|
364 |
}
|
365 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_vkExUnit_3PR_area");'));
|
366 |
|
367 |
// メディアアップローダーjs
|
368 |
function my_admin_scripts_3pr() {
|
369 |
-
|
370 |
-
|
371 |
-
|
372 |
}
|
373 |
add_action( 'admin_print_scripts', 'my_admin_scripts_3pr' );
|
374 |
|
375 |
// 3PR widget CSS
|
376 |
function style_3PR() {
|
377 |
-
echo '<style>
|
378 |
-
|
379 |
-
|
380 |
-
|
381 |
-
|
382 |
-
|
383 |
-
|
384 |
-
|
385 |
-
|
386 |
-
|
387 |
-
|
388 |
-
|
389 |
-
|
390 |
-
|
391 |
-
|
392 |
</style>'.PHP_EOL;
|
393 |
}
|
394 |
-
add_action(
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* PR area widget
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_3PR_area extends WP_Widget {
|
7 |
|
8 |
+
function __construct() {
|
9 |
+
$widget_name = vkExUnit_get_short_name(). '_' . __( '3PR area', 'vkExUnit' );
|
10 |
|
11 |
+
parent::__construct(
|
12 |
+
'WP_Widget_vkExUnit_3PR_area',
|
13 |
+
$widget_name,
|
14 |
+
array( 'description' => __( 'Displays a 3PR area', 'vkExUnit' ) )
|
15 |
+
);
|
16 |
}
|
17 |
|
18 |
+
function form( $instance ) {
|
19 |
+
$defaults = array(
|
20 |
'label_1' => __( '3PR area1 title', 'vkExUnit' ),
|
21 |
+
'media_3pr_image_1' => '',
|
22 |
+
'media_3pr_alt_1' => '',
|
23 |
+
'media_3pr_image_sp_1' => '',
|
24 |
+
'media_3pr_alt_sp_1' => '',
|
25 |
+
'summary_1' => '',
|
26 |
+
'linkurl_1' => '',
|
27 |
+
'label_2' => __( '3PR area2 title', 'vkExUnit' ),
|
28 |
+
'media_3pr_image_2' => '',
|
29 |
+
'media_3pr_alt_2' => '',
|
30 |
+
'media_3pr_image_sp_2' => '',
|
31 |
+
'media_3pr_alt_sp_2' => '',
|
32 |
+
'summary_2' => '',
|
33 |
+
'linkurl_2' => '',
|
34 |
+
'label_3' => __( '3PR area3 title', 'vkExUnit' ),
|
35 |
+
'media_3pr_image_3' => '',
|
36 |
+
'media_3pr_alt_3' => '',
|
37 |
+
'media_3pr_image_sp_3' => '',
|
38 |
+
'media_3pr_alt_sp_3' => '',
|
39 |
+
'summary_3' => '',
|
40 |
+
'linkurl_3' => '',
|
41 |
);
|
42 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
43 |
+
?>
|
44 |
<?php // 3PR area 1 =========================================================== ?>
|
45 |
<?php // 3PR area 1 タイトル ?>
|
46 |
<h5 class="pr_subTitle"><?php _e( '3PR area1 setting', 'vkExUnit' ); ?></h5>
|
47 |
+
<p>
|
48 |
+
<label for="<?php echo $this->get_field_id( 'label_1' ); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
|
49 |
+
<input type="text" id="<?php echo $this->get_field_id( 'label_1' ); ?>-title" class="pr-input" name="<?php echo $this->get_field_name( 'label_1' ); ?>" value="<?php echo $instance['label_1']; ?>" />
|
50 |
+
</p>
|
51 |
|
52 |
<?php // 3PR area 1 メディアアップローダー PC ?>
|
53 |
+
<p>
|
54 |
+
<label for="<?php echo $this->get_field_id( 'media_3pr_image_1' ); ?>"><?php _e( 'Select image for PC:', 'vkExUnit' ); ?></label><br/>
|
55 |
+
<input type="hidden" class="media_image_3pr_pc <?php echo $this->get_field_id( 'media_3pr_image_1' ); ?>" id="<?php echo $this->get_field_id( 'media_3pr_image_1' ); ?>-image" name="<?php echo $this->get_field_name( 'media_3pr_image_1' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_image_1'] ); ?>" />
|
56 |
+
<input type="hidden" class="media_alt_3pr_pc" id="<?php echo $this->get_field_id( 'media_3pr_alt_1' ); ?>-alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_1' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_alt_1'] ); ?>" />
|
57 |
<input type="button" class="media_select select_3pr" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3pr(event.target);" />
|
58 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3pr(event.target);" />
|
59 |
</p>
|
60 |
<div class="media image_3pr">
|
61 |
+
<?php if ( ! empty( $instance['media_3pr_image_1'] ) ) : ?>
|
62 |
+
<img class="media_image image_3pr" src="<?php echo esc_url( $instance['media_3pr_image_1'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_1'] ); ?>" />
|
63 |
<?php endif; ?>
|
64 |
</div>
|
65 |
|
66 |
<?php // 3PR area 1 メディアアップローダー sp image ?>
|
67 |
<p>
|
68 |
+
<label for="<?php echo $this->get_field_id( 'media_3pr_image_sp_1' ); ?>"><?php _e( 'Select image for Mobile:', 'vkExUnit' ); ?></label><br/>
|
69 |
|
70 |
+
<input type="hidden" class="media_image_3pr_sp" id="<?php echo $this->get_field_id( 'media_3pr_image_sp_1' ); ?>_image" name="<?php echo $this->get_field_name( 'media_3pr_image_sp_1' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_image_sp_1'] ); ?>" />
|
71 |
|
72 |
+
<input type="hidden" class="media_alt_3pr_sp" id="<?php echo $this->get_field_id( 'media_3pr_alt_sp_1' ); ?>-alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_sp_1' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_alt_sp_1'] ); ?>" />
|
73 |
|
74 |
<input type="button" class="media_select" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3prSP(event.target);" />
|
75 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3prSP(event.target);" />
|
76 |
</p>
|
77 |
<div class="media image_3pr_sp">
|
78 |
+
<?php if ( ! empty( $instance['media_3pr_image_sp_1'] ) ) : ?>
|
79 |
+
<img class="media_image image_3pr_sp" src="<?php echo esc_url( $instance['media_3pr_image_sp_1'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_sp_1'] ); ?>" />
|
80 |
<?php endif; ?>
|
81 |
</div>
|
82 |
|
83 |
<?php // 概要テキスト ?>
|
84 |
+
<p><label for="<?php echo $this->get_field_id( 'summary_1' ); ?>"><?php _e( 'Summary Text:', 'vkExUnit' ); ?></label><br/>
|
85 |
+
</p>
|
86 |
|
87 |
+
<textarea rows="4" cols="40" id="<?php echo $this->get_field_id( 'summary_1' ); ?>_text" class="pr_input textarea" name="<?php echo $this->get_field_name( 'summary_1' ); ?>"><?php echo $instance['summary_1']; ?></textarea>
|
88 |
|
89 |
<?php // リンク先_URL ?>
|
90 |
+
<p><label for="<?php echo $this->get_field_id( 'linkurl_1' ); ?>"><?php _e( 'Link URL:', 'vkExUnit' ); ?></label><br/>
|
91 |
+
<input type="text" id="<?php echo $this->get_field_id( 'linkurl_1' ); ?>_title" class="pr_input" name="<?php echo $this->get_field_name( 'linkurl_1' ); ?>" value="<?php echo $instance['linkurl_1']; ?>" />
|
92 |
+
</p>
|
93 |
|
94 |
<hr /><?php // 3PR area 2 =================================================?>
|
95 |
<?php // 3PR area 2 タイトル ?>
|
96 |
<h5 class="pr_subTitle"><?php _e( '3PR area2 setting', 'vkExUnit' ); ?></h5>
|
97 |
+
<p>
|
98 |
+
<label for="<?php echo $this->get_field_id( 'label_2' ); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
|
99 |
+
<input type="text" id="<?php echo $this->get_field_id( 'label_2' ); ?>_title" class="pr_input" name="<?php echo $this->get_field_name( 'label_2' ); ?>" value="<?php echo $instance['label_2']; ?>" />
|
100 |
+
</p>
|
101 |
|
102 |
<?php // 3PR area 1 メディアアップローダー PC ?>
|
103 |
+
<p>
|
104 |
+
<label for="<?php echo $this->get_field_id( 'media_3pr_image_2' ); ?>"><?php _e( 'Select image for PC:', 'vkExUnit' ); ?></label><br/>
|
105 |
|
106 |
+
<input type="hidden" class="media_image_3pr_pc <?php echo $this->get_field_id( 'media_3pr_image_2' ); ?>" id="<?php echo $this->get_field_id( 'media_3pr_image_2' ); ?>_image" name="<?php echo $this->get_field_name( 'media_3pr_image_2' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_image_2'] ); ?>" />
|
107 |
|
108 |
+
<input type="hidden" class="media_alt_3pr_pc" id="<?php echo $this->get_field_id( 'media_3pr_alt_2' ); ?>_alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_2' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_alt_2'] ); ?>" />
|
109 |
|
110 |
<input type="button" class="media_select select_3pr" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3pr(event.target);" />
|
111 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3pr(event.target);" />
|
112 |
</p>
|
113 |
|
114 |
<div class="media image_3pr">
|
115 |
+
<?php if ( ! empty( $instance['media_3pr_image_2'] ) ) : ?>
|
116 |
+
<img class="media_image image_3pr" src="<?php echo esc_url( $instance['media_3pr_image_2'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_2'] ); ?>" />
|
117 |
<?php endif; ?>
|
118 |
</div>
|
119 |
|
120 |
<?php // 3PR area 2 メディアアップローダー sp ?>
|
121 |
<p>
|
122 |
+
<label for="<?php echo $this->get_field_id( 'media_3pr_image_sp_2' ); ?>"><?php _e( 'Select image for Mobile:', 'vkExUnit' ); ?></label><br/>
|
123 |
|
124 |
+
<input type="hidden" class="media_image_3pr_sp" id="<?php echo $this->get_field_id( 'media_3pr_image_sp_2' ); ?>_image" name="<?php echo $this->get_field_name( 'media_3pr_image_sp_2' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_image_sp_2'] ); ?>" />
|
125 |
|
126 |
+
<input type="hidden" class="media_alt_3pr_sp" id="<?php echo $this->get_field_id( 'media_3pr_alt_sp_2' ); ?>_alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_sp_2' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_alt_sp_2'] ); ?>" />
|
127 |
|
128 |
<input type="button" class="media_select" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3prSP(event.target);" />
|
129 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3prSP(event.target);" />
|
130 |
</p>
|
131 |
<div class="media image_3pr_sp">
|
132 |
+
<?php if ( ! empty( $instance['media_3pr_image_sp_2'] ) ) : ?>
|
133 |
+
<img class="media_image image_3pr_sp" src="<?php echo esc_url( $instance['media_3pr_image_sp_2'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_sp_2'] ); ?>" />
|
134 |
<?php endif; ?>
|
135 |
</div>
|
136 |
|
137 |
<?php //概要テキスト ?>
|
138 |
+
<p><label for="<?php echo $this->get_field_id( 'summary_2' ); ?>"><?php _e( 'Summary Text:', 'vkExUnit' ); ?></label></p>
|
139 |
+
<textarea rows="4" cols="40" id="<?php echo $this->get_field_id( 'summary_2' ); ?>_text" class="pr_input textarea" name="<?php echo $this->get_field_name( 'summary_2' ); ?>"><?php echo $instance['summary_2']; ?></textarea>
|
140 |
|
141 |
<?php //リンク先_URL ?>
|
142 |
+
<p><label for="<?php echo $this->get_field_id( 'linkurl_2' ); ?>"><?php _e( 'Link URL:', 'vkExUnit' ); ?></label><br/>
|
143 |
+
<input type="text" id="<?php echo $this->get_field_id( 'linkurl_2' ); ?>_title" class="pr_input" name="<?php echo $this->get_field_name( 'linkurl_2' ); ?>" value="<?php echo $instance['linkurl_2']; ?>" />
|
144 |
+
</p>
|
145 |
<hr /><?php // 3PR area 3 =================================================?>
|
146 |
<?php // 3PR area 3 タイトル ?>
|
147 |
<h5 class="pr_subTitle"><?php _e( '3PR area3 setting', 'vkExUnit' ); ?></h5>
|
148 |
+
<p>
|
149 |
+
<label for="<?php echo $this->get_field_id( 'label_3' ); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
|
150 |
+
<input type="text" id="<?php echo $this->get_field_id( 'label_3' ); ?>_title" class="pr_input" name="<?php echo $this->get_field_name( 'label_3' ); ?>" value="<?php echo $instance['label_3']; ?>" />
|
151 |
+
</p>
|
152 |
|
153 |
<?php // 3PR area 1 メディアアップローダー PC ?>
|
154 |
+
<p>
|
155 |
+
<label for="<?php echo $this->get_field_id( 'media_3pr_image_3' ); ?>"><?php _e( 'Select image for PC:', 'vkExUnit' ); ?></label><br/>
|
156 |
|
157 |
+
<input type="hidden" class="media_image_3pr_pc <?php echo $this->get_field_id( 'media_3pr_image_3' ); ?>" id="<?php echo $this->get_field_id( 'media_3pr_image_3' ); ?>_image" name="<?php echo $this->get_field_name( 'media_3pr_image_3' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_image_3'] ); ?>" />
|
158 |
|
159 |
+
<input type="hidden" class="media_alt_3pr_pc" id="<?php echo $this->get_field_id( 'media_3pr_alt_3' ); ?>-alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_3' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_alt_3'] ); ?>" />
|
160 |
|
161 |
<input type="button" class="media_select select_3pr" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3pr(event.target);" />
|
162 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3pr(event.target);" />
|
163 |
</p>
|
164 |
<div class="media image_3pr">
|
165 |
+
<?php if ( ! empty( $instance['media_3pr_image_3'] ) ) : ?>
|
166 |
+
<img class="media_image image_3pr" src="<?php echo esc_url( $instance['media_3pr_image_3'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_3'] ); ?>" />
|
167 |
<?php endif; ?>
|
168 |
</div>
|
169 |
|
170 |
<?php // 3PR area 2 メディアアップローダー sp ?>
|
171 |
<p>
|
172 |
+
<label for="<?php echo $this->get_field_id( 'media_3pr_image_sp_3' ); ?>"><?php _e( 'Select image for Mobile:', 'vkExUnit' ); ?></label><br/>
|
173 |
|
174 |
+
<input type="hidden" class="media_image_3pr_sp" id="<?php echo $this->get_field_id( 'media_3pr_image_sp_3' ); ?>_image" name="<?php echo $this->get_field_name( 'media_3pr_image_sp_3' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_image_sp_3'] ); ?>" />
|
175 |
|
176 |
+
<input type="hidden" class="media_alt_3pr_sp" id="<?php echo $this->get_field_id( 'media_3pr_alt_sp_3' ); ?>_alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_sp_3' ); ?>" value="<?php echo esc_attr( $instance['media_3pr_alt_sp_3'] ); ?>" />
|
177 |
|
178 |
<input type="button" class="media_select" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect3prSP(event.target);" />
|
179 |
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear3prSP(event.target);" />
|
180 |
</p>
|
181 |
|
182 |
<div class="media image_3pr_sp">
|
183 |
+
<?php if ( ! empty( $instance['media_3pr_image_sp_3'] ) ) : ?>
|
184 |
+
<img class="media_image image_3pr_sp" src="<?php echo esc_url( $instance['media_3pr_image_sp_3'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_sp_3'] ); ?>" />
|
185 |
<?php endif; ?>
|
186 |
</div>
|
187 |
<?php //概要テキスト ?>
|
188 |
+
<p><label for="<?php echo $this->get_field_id( 'summary_3' ); ?>"><?php _e( 'Summary Text:', 'vkExUnit' ); ?></label>
|
189 |
+
</p>
|
190 |
+
<textarea rows="4" cols="40" id="<?php echo $this->get_field_id( 'summary_3' ); ?>_text" class="pr_input textarea" name="<?php echo $this->get_field_name( 'summary_3' ); ?>"><?php echo $instance['summary_3']; ?></textarea>
|
191 |
<?php //リンク先_URL ?>
|
192 |
+
<p><label for="<?php echo $this->get_field_id( 'linkurl_3' ); ?>"><?php _e( 'Link URL:', 'vkExUnit' ); ?></label><br/>
|
193 |
+
<input type="text" id="<?php echo $this->get_field_id( 'linkurl_3' ); ?>_title" class="pr_input" name="<?php echo $this->get_field_name( 'linkurl_3' ); ?>" value="<?php echo $instance['linkurl_3']; ?>" />
|
194 |
+
</p>
|
195 |
+
<?php
|
196 |
+
}
|
197 |
|
198 |
|
199 |
+
function update( $new_instance, $old_instance ) {
|
200 |
|
201 |
+
$instance = $old_instance;
|
202 |
|
203 |
+
$instance['label_1'] = $new_instance['label_1'];
|
204 |
+
$instance['media_3pr_image_1'] = $new_instance['media_3pr_image_1'];
|
205 |
+
$instance['media_3pr_alt_1'] = $new_instance['media_3pr_alt_1'];
|
206 |
+
$instance['media_3pr_image_sp_1'] = $new_instance['media_3pr_image_sp_1'];
|
207 |
+
$instance['media_3pr_alt_sp_1'] = $new_instance['media_3pr_alt_sp_1'];
|
208 |
+
$instance['summary_1'] = $new_instance['summary_1'];
|
209 |
+
$instance['linkurl_1'] = $new_instance['linkurl_1'];
|
210 |
|
211 |
+
$instance['label_2'] = $new_instance['label_2'];
|
212 |
+
$instance['media_3pr_image_2'] = $new_instance['media_3pr_image_2'];
|
213 |
+
$instance['media_3pr_alt_2'] = $new_instance['media_3pr_alt_2'];
|
214 |
+
$instance['media_3pr_image_sp_2'] = $new_instance['media_3pr_image_sp_2'];
|
215 |
+
$instance['media_3pr_alt_sp_2'] = $new_instance['media_3pr_alt_sp_2'];
|
216 |
+
$instance['summary_2'] = $new_instance['summary_2'];
|
217 |
+
$instance['linkurl_2'] = $new_instance['linkurl_2'];
|
218 |
|
219 |
+
$instance['label_3'] = $new_instance['label_3'];
|
220 |
+
$instance['media_3pr_image_3'] = $new_instance['media_3pr_image_3'];
|
221 |
+
$instance['media_3pr_alt_3'] = $new_instance['media_3pr_alt_3'];
|
222 |
+
$instance['media_3pr_image_sp_3'] = $new_instance['media_3pr_image_sp_3'];
|
223 |
+
$instance['media_3pr_alt_sp_3'] = $new_instance['media_3pr_alt_sp_3'];
|
224 |
+
$instance['summary_3'] = $new_instance['summary_3'];
|
225 |
+
$instance['linkurl_3'] = $new_instance['linkurl_3'];
|
226 |
|
227 |
+
return $instance;
|
228 |
+
}
|
229 |
|
230 |
|
231 |
+
function widget( $args, $instance ) {
|
232 |
+
echo $args['before_widget'];
|
233 |
+
echo PHP_EOL.'<div class="veu_3prArea row">'.PHP_EOL;
|
234 |
+
if ( isset( $instance['label_1'] ) && $instance['label_1'] ) : ?>
|
235 |
+
<div class="prArea col-md-4">
|
236 |
+
<?php
|
237 |
+
echo '<h1 class="subSection-title">';
|
238 |
+
if ( isset( $instance['label_1'] ) && $instance['label_1'] ) {
|
239 |
+
echo $instance['label_1'];
|
240 |
+
} else {
|
241 |
+
_e( '3PR area', 'vkExUnit' );
|
242 |
+
}
|
243 |
+
echo '</h1>'.PHP_EOL; ?>
|
244 |
+
<?php if ( isset( $instance['media_3pr_image_1'], $instance['media_3pr_image_sp_1'] ) ) : ?>
|
245 |
+
<div class="media_pr">
|
246 |
+
<?php if ( ! empty( $instance['linkurl_1'] ) ) : ?>
|
247 |
+
<a href="<?php echo esc_url( $instance['linkurl_1'] ); ?>" >
|
248 |
+
<?php if ( ! empty( $instance['media_3pr_image_1'] ) ) : ?>
|
249 |
+
<img <?php if ( ! empty( $instance['media_3pr_image_sp_1'] ) ) { echo 'class="media_pc"'; } ?> src="<?php echo esc_url( $instance['media_3pr_image_1'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_1'] ); ?>" />
|
250 |
<?php endif;
|
251 |
+
if ( ! empty( $instance['media_3pr_image_sp_1'] ) ) : ?>
|
252 |
+
<img class="media_sp" src="<?php echo esc_url( $instance['media_3pr_image_sp_1'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_sp_1'] ); ?>" />
|
253 |
<?php endif; ?>
|
254 |
+
</a>
|
255 |
+
<?php else :
|
256 |
+
if ( ! empty( $instance['media_3pr_image_1'] ) ) : ?>
|
257 |
+
<img <?php if ( ! empty( $instance['media_3pr_image_sp_1'] ) ) { echo 'class="media_pc"'; } ?> src="<?php echo esc_url( $instance['media_3pr_image_1'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_1'] ); ?>" />
|
258 |
+
<?php endif; ?>
|
259 |
+
<?php if ( ! empty( $instance['media_3pr_image_sp_1'] ) ) : ?>
|
260 |
+
<img class="media_sp" src="<?php echo esc_url( $instance['media_3pr_image_sp_1'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_sp_1'] ); ?>" />
|
261 |
<?php endif;
|
262 |
endif; ?>
|
263 |
+
</div>
|
264 |
+
<!--//.media_pr -->
|
265 |
+
<?php endif;
|
266 |
+
if ( ! empty( $instance['summary_1'] ) ) {
|
267 |
+
echo '<p class="summary">'.nl2br( esc_attr( $instance['summary_1'] ) ).'</p>'.PHP_EOL;
|
268 |
}
|
269 |
+
if ( ! empty( $instance['linkurl_1'] ) ) {
|
270 |
+
echo '<p class="linkurl"><a href="'.esc_attr( $instance['linkurl_1'] ).'" class="btn btn-default btn-sm">'.__( 'Read more', 'vkExUnit' ).'</a></p>';
|
271 |
} ?>
|
272 |
+
</div>
|
273 |
+
<!-- // div.prArea1 -->
|
274 |
+
<?php endif; ?>
|
275 |
|
276 |
+
<?php if ( isset( $instance['label_2'] ) && $instance['label_2'] ) : ?>
|
277 |
+
<div class="prArea col-md-4">
|
278 |
+
<?php
|
279 |
echo '<h1 class="subSection-title">';
|
280 |
+
if ( isset( $instance['label_2'] ) && $instance['label_2'] ) {
|
281 |
echo $instance['label_2'];
|
282 |
} else {
|
283 |
+
_e( '3PR area', 'vkExUnit' );
|
284 |
}
|
285 |
+
echo '</h1>'.PHP_EOL;
|
286 |
+
if ( isset( $instance['media_3pr_image_2'], $instance['media_3pr_image_sp_2'] ) ) : ?>
|
287 |
+
<div class="media_pr">
|
288 |
+
<?php if ( ! empty( $instance['linkurl_2'] ) ) : ?>
|
289 |
+
<a href="<?php echo esc_url( $instance['linkurl_2'] ); ?>" >
|
290 |
+
<?php if ( ! empty( $instance['media_3pr_image_2'] ) ) : ?>
|
291 |
+
<img <?php if ( ! empty( $instance['media_3pr_image_sp_2'] ) ) { echo 'class="media_pc"'; } ?> src="<?php echo esc_url( $instance['media_3pr_image_2'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_2'] ); ?>" />
|
292 |
<?php endif;
|
293 |
+
if ( ! empty( $instance['media_3pr_image_sp_2'] ) ) : ?>
|
294 |
+
<img class="media_sp" src="<?php echo esc_url( $instance['media_3pr_image_sp_2'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_sp_2'] ); ?>" />
|
295 |
<?php endif; ?>
|
296 |
</a>
|
297 |
+
<?php else :
|
298 |
+
if ( ! empty( $instance['media_3pr_image_2'] ) ) : ?>
|
299 |
+
<img <?php if ( ! empty( $instance['media_3pr_image_sp_2'] ) ) { echo 'class="media_pc"'; } ?> src="<?php echo esc_url( $instance['media_3pr_image_2'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_2'] ); ?>" />
|
300 |
<?php endif;
|
301 |
+
if ( ! empty( $instance['media_3pr_image_sp_2'] ) ) : ?>
|
302 |
+
<img class="media_sp" src="<?php echo esc_url( $instance['media_3pr_image_sp_2'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_sp_2'] ); ?>" />
|
303 |
<?php endif;
|
304 |
+
endif; ?>
|
305 |
+
</div>
|
306 |
+
<!--//.media_pr -->
|
307 |
+
<?php endif;
|
308 |
+
if ( ! empty( $instance['summary_2'] ) ) {
|
309 |
+
echo '<p class="summary">'.nl2br( esc_attr( $instance['summary_2'] ) ).'</p>'.PHP_EOL;
|
310 |
+
}
|
311 |
+
if ( ! empty( $instance['linkurl_2'] ) ) {
|
312 |
+
echo '<p class="linkurl"><a href="'.esc_attr( $instance['linkurl_2'] ).'" class="btn btn-default btn-sm">'.__( 'Read more', 'vkExUnit' ).'</a></p>';
|
313 |
+
}
|
314 |
+
?>
|
315 |
+
</div>
|
316 |
+
<!-- // div.prArea2 -->
|
317 |
+
<?php endif; ?>
|
318 |
|
319 |
+
<?php if ( isset( $instance['label_3'] ) && $instance['label_3'] ) : ?>
|
320 |
<div class="prArea col-md-4">
|
321 |
<?php
|
322 |
echo '<h1 class="subSection-title">';
|
323 |
+
if ( isset( $instance['label_3'] ) && $instance['label_3'] ) {
|
324 |
+
echo $instance['label_3'];
|
325 |
+
} else {
|
326 |
+
_e( '3PR area', 'vkExUnit' );
|
327 |
+
}
|
328 |
echo '</h1>'.PHP_EOL;
|
329 |
+
if ( isset( $instance['media_3pr_image_3'], $instance['media_3pr_image_sp_3'] ) ) : ?>
|
330 |
<div class="media_pr">
|
331 |
+
<?php if ( ! empty( $instance['linkurl_3'] ) ) : // has link ?>
|
332 |
+
<a href="<?php echo esc_url( $instance['linkurl_3'] ); ?>" >
|
333 |
+
<?php if ( ! empty( $instance['media_3pr_image_3'] ) ) : ?>
|
334 |
+
<img <?php if ( ! empty( $instance['media_3pr_image_sp_3'] ) ) { echo 'class="media_pc"'; } ?> src="<?php echo esc_url( $instance['media_3pr_image_3'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_3'] ); ?>" />
|
335 |
<?php endif;
|
336 |
+
if ( ! empty( $instance['media_3pr_image_sp_3'] ) ) : ?>
|
337 |
+
<img class="media_sp" src="<?php echo esc_url( $instance['media_3pr_image_sp_3'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_sp_3'] ); ?>" />
|
338 |
<?php endif; ?>
|
339 |
+
</a>
|
340 |
+
<?php else : // no link
|
341 |
+
if ( ! empty( $instance['media_3pr_image_3'] ) ) : ?>
|
342 |
+
<img <?php if ( ! empty( $instance['media_3pr_image_sp_3'] ) ) { echo 'class="media_pc"'; } ?> src="<?php echo esc_url( $instance['media_3pr_image_3'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_3'] ); ?>" />
|
343 |
<?php endif;
|
344 |
+
if ( ! empty( $instance['media_3pr_image_sp_3'] ) ) : ?>
|
345 |
+
<img class="media_sp" src="<?php echo esc_url( $instance['media_3pr_image_sp_3'] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_sp_3'] ); ?>" />
|
346 |
<?php endif;
|
347 |
endif; ?>
|
348 |
</div>
|
349 |
<!--//.media_pr -->
|
350 |
<?php endif;
|
351 |
+
if ( ! empty( $instance['summary_3'] ) ) {
|
352 |
+
echo '<p class="summary">'.nl2br( esc_attr( $instance['summary_3'] ) ).'</p>'.PHP_EOL;
|
353 |
}
|
354 |
+
if ( ! empty( $instance['linkurl_3'] ) ) {
|
355 |
+
echo '<p class="linkurl"><a href="'.esc_attr( $instance['linkurl_3'] ).'" class="btn btn-default btn-sm">'.__( 'Read more', 'vkExUnit' ).'</a></p>';
|
356 |
} ?>
|
357 |
</div>
|
358 |
<!-- // div.prArea3 -->
|
359 |
<?php endif; ?>
|
360 |
+
</div>
|
361 |
+
<?php
|
362 |
+
echo $args['after_widget'];
|
363 |
+
}
|
364 |
}
|
365 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_vkExUnit_3PR_area");' ) );
|
366 |
|
367 |
// メディアアップローダーjs
|
368 |
function my_admin_scripts_3pr() {
|
369 |
+
wp_enqueue_media();
|
370 |
+
wp_register_script( 'mediauploader-3pr', plugin_dir_url( __FILE__ ) . 'js/widget-3pr-uploader.js', array( 'jquery' ), false, true );
|
371 |
+
wp_enqueue_script( 'mediauploader-3pr' );
|
372 |
}
|
373 |
add_action( 'admin_print_scripts', 'my_admin_scripts_3pr' );
|
374 |
|
375 |
// 3PR widget CSS
|
376 |
function style_3PR() {
|
377 |
+
echo '<style>
|
378 |
+
.pr_subTitle{
|
379 |
+
box-sizing: border-box;
|
380 |
+
padding: 0.8em;
|
381 |
+
width: 100%;
|
382 |
+
border: solid 1px #ddd;
|
383 |
+
background: #EDEDED;
|
384 |
+
font-size: 1em;
|
385 |
+
}
|
386 |
+
.pr_input{
|
387 |
+
width: 100%;
|
388 |
+
}
|
389 |
+
.pr_input.textarea{
|
390 |
+
margin-top: -1em;
|
391 |
+
}
|
392 |
</style>'.PHP_EOL;
|
393 |
}
|
394 |
+
add_action( 'admin_print_styles-widgets.php', 'style_3PR' );
|
plugins/other_widget/widget-archives.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_VK_archive_list extends WP_Widget {
|
7 |
|
@@ -16,30 +16,29 @@ class WP_Widget_VK_archive_list extends WP_Widget {
|
|
16 |
}
|
17 |
|
18 |
|
19 |
-
function widget($args, $instance) {
|
20 |
$arg = array(
|
21 |
'echo' => 1,
|
22 |
);
|
23 |
|
24 |
-
if(isset($instance['display_type']) && $instance['display_type'] == 'y'){
|
25 |
-
$arg['type'] =
|
26 |
-
$arg['post_type'] = ( isset($instance['post_type']) ) ? $instance['post_type'] : 'post';
|
27 |
-
if (strtoupper(get_locale()) == 'JA'){
|
28 |
$arg['after'] = '年';
|
29 |
}
|
30 |
-
}
|
31 |
-
|
32 |
-
$arg['
|
33 |
-
$arg['post_type'] = ( isset($instance['post_type']) ) ? $instance['post_type'] : 'post';
|
34 |
}
|
35 |
?>
|
36 |
<?php echo $args['before_widget']; ?>
|
37 |
-
|
38 |
-
<?php if( (isset($instance['label'])) && $instance['label'] ){
|
39 |
<?php echo $args['before_title'] . $instance['label'] . $args['after_title']; ?>
|
40 |
<?php } ?>
|
41 |
<ul class="localNavi">
|
42 |
-
<?php wp_get_archives($arg); ?>
|
43 |
</ul>
|
44 |
</div>
|
45 |
<?php echo $args['after_widget']; ?>
|
@@ -47,7 +46,7 @@ class WP_Widget_VK_archive_list extends WP_Widget {
|
|
47 |
}
|
48 |
|
49 |
|
50 |
-
function form($instance){
|
51 |
$defaults = array(
|
52 |
'post_type' => 'post',
|
53 |
'display_type' => 'm',
|
@@ -55,63 +54,63 @@ class WP_Widget_VK_archive_list extends WP_Widget {
|
|
55 |
'hide' => __( 'Monthly archives', 'vkExUnit' ),
|
56 |
);
|
57 |
|
58 |
-
$instance = wp_parse_args((array) $instance, $defaults);
|
59 |
-
$pages = get_post_types( array('public'=> true, '_builtin' => false),'names');
|
60 |
$pages[] = 'post';
|
61 |
?>
|
62 |
-
|
63 |
|
64 |
-
<label for="<?php echo $this->get_field_id('label'); ?>"><?php _e('Title','vkExUnit');?>:</label>
|
65 |
-
<input type="text" id="<?php echo $this->get_field_id('label'); ?>-title" name="<?php echo $this->get_field_name('label'); ?>" value="<?php echo $instance['label']; ?>" ><br/>
|
66 |
-
<input type="hidden" name="<?php echo $this->get_field_name('hide'); ?>" ><br/>
|
67 |
|
68 |
-
<label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e( 'Post type', 'vkExUnit' ) ?>:</label>
|
69 |
-
<select name="<?php echo $this->get_field_name('post_type'); ?>" >
|
70 |
-
<?php foreach($pages as $page){
|
71 |
-
<option value="<?php echo $page; ?>" <?php if($instance['post_type'] == $page) echo 'selected="selected"'; ?> ><?php echo $page; ?></option>
|
72 |
<?php } ?>
|
73 |
-
|
74 |
-
|
75 |
-
<label for="<?php echo $this->get_field_id('display_type'); ?>">表示タイプ</label>
|
76 |
-
<select name="<?php echo $this->get_field_name('display_type'); ?>" >
|
77 |
-
<option value="m" <?php if($instance['display_type'] !=
|
78 |
-
<?php _e('Monthly','vkExUnit');?></option>
|
79 |
-
<option value="y" <?php if($instance['display_type'] ==
|
80 |
-
<?php _e('Yearly','vkExUnit');?></option>
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
<?php
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
}
|
92 |
}
|
|
|
93 |
echo 'post_labels["blog"] = "Blog";'."\n";
|
94 |
?>
|
95 |
-
var posttype = jQuery("[name=\"<?php echo $this->get_field_name('post_type'); ?>\"]");
|
96 |
-
var lablfeld = jQuery("[name=\"<?php echo $this->get_field_name('label'); ?>\"]");
|
97 |
-
|
98 |
-
lablfeld.val(post_labels[posttype.val()]+'<?php _e('archive','vkExUnit');?>');
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
<?php
|
103 |
}
|
104 |
|
105 |
|
106 |
-
function update($new_instance, $old_instance){
|
107 |
$instance = $old_instance;
|
108 |
$instance['post_type'] = $new_instance['post_type'];
|
109 |
$instance['display_type'] = $new_instance['display_type'];
|
110 |
-
if(
|
111 |
$new_instance['label'] = $new_instance['hide'];
|
112 |
}
|
113 |
$instance['label'] = $new_instance['label'];
|
114 |
return $instance;
|
115 |
}
|
116 |
}
|
117 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_VK_archive_list");'));
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* Archive list widget
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_VK_archive_list extends WP_Widget {
|
7 |
|
16 |
}
|
17 |
|
18 |
|
19 |
+
function widget( $args, $instance ) {
|
20 |
$arg = array(
|
21 |
'echo' => 1,
|
22 |
);
|
23 |
|
24 |
+
if ( isset( $instance['display_type'] ) && $instance['display_type'] == 'y' ) {
|
25 |
+
$arg['type'] = 'yearly';
|
26 |
+
$arg['post_type'] = ( isset( $instance['post_type'] ) ) ? $instance['post_type'] : 'post';
|
27 |
+
if ( strtoupper( get_locale() ) == 'JA' ) {
|
28 |
$arg['after'] = '年';
|
29 |
}
|
30 |
+
} else {
|
31 |
+
$arg['type'] = 'monthly';
|
32 |
+
$arg['post_type'] = ( isset( $instance['post_type'] ) ) ? $instance['post_type'] : 'post';
|
|
|
33 |
}
|
34 |
?>
|
35 |
<?php echo $args['before_widget']; ?>
|
36 |
+
<div class="sideWidget widget_archive">
|
37 |
+
<?php if ( (isset( $instance['label'] )) && $instance['label'] ) { ?>
|
38 |
<?php echo $args['before_title'] . $instance['label'] . $args['after_title']; ?>
|
39 |
<?php } ?>
|
40 |
<ul class="localNavi">
|
41 |
+
<?php wp_get_archives( $arg ); ?>
|
42 |
</ul>
|
43 |
</div>
|
44 |
<?php echo $args['after_widget']; ?>
|
46 |
}
|
47 |
|
48 |
|
49 |
+
function form( $instance ) {
|
50 |
$defaults = array(
|
51 |
'post_type' => 'post',
|
52 |
'display_type' => 'm',
|
54 |
'hide' => __( 'Monthly archives', 'vkExUnit' ),
|
55 |
);
|
56 |
|
57 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
58 |
+
$pages = get_post_types( array( 'public' => true, '_builtin' => false ),'names' );
|
59 |
$pages[] = 'post';
|
60 |
?>
|
61 |
+
<p>
|
62 |
|
63 |
+
<label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Title','vkExUnit' );?>:</label>
|
64 |
+
<input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" ><br/>
|
65 |
+
<input type="hidden" name="<?php echo $this->get_field_name( 'hide' ); ?>" ><br/>
|
66 |
|
67 |
+
<label for="<?php echo $this->get_field_id( 'post_type' ); ?>"><?php _e( 'Post type', 'vkExUnit' ) ?>:</label>
|
68 |
+
<select name="<?php echo $this->get_field_name( 'post_type' ); ?>" >
|
69 |
+
<?php foreach ( $pages as $page ) { ?>
|
70 |
+
<option value="<?php echo $page; ?>" <?php if ( $instance['post_type'] == $page ) { echo 'selected="selected"'; } ?> ><?php echo $page; ?></option>
|
71 |
<?php } ?>
|
72 |
+
</select>
|
73 |
+
<br/>
|
74 |
+
<label for="<?php echo $this->get_field_id( 'display_type' ); ?>">表示タイプ</label>
|
75 |
+
<select name="<?php echo $this->get_field_name( 'display_type' ); ?>" >
|
76 |
+
<option value="m" <?php if ( $instance['display_type'] != 'y' ) { echo 'selected="selected"'; } ?> >
|
77 |
+
<?php _e( 'Monthly','vkExUnit' );?></option>
|
78 |
+
<option value="y" <?php if ( $instance['display_type'] == 'y' ) { echo 'selected="selected"'; } ?> >
|
79 |
+
<?php _e( 'Yearly','vkExUnit' );?></option>
|
80 |
+
</select>
|
81 |
+
</p>
|
82 |
+
<script type="text/javascript">
|
83 |
+
jQuery(document).ready(function($){
|
84 |
+
var post_labels = new Array();
|
85 |
<?php
|
86 |
+
foreach ( $pages as $page ) {
|
87 |
+
$page_labl = get_post_type_object( $page );
|
88 |
+
if ( isset( $page_labl->labels->name ) ) {
|
89 |
+
echo 'post_labels["'.$page.'"] = "'.$page_labl->labels->name.'";';
|
|
|
90 |
}
|
91 |
+
}
|
92 |
echo 'post_labels["blog"] = "Blog";'."\n";
|
93 |
?>
|
94 |
+
var posttype = jQuery("[name=\"<?php echo $this->get_field_name( 'post_type' ); ?>\"]");
|
95 |
+
var lablfeld = jQuery("[name=\"<?php echo $this->get_field_name( 'label' ); ?>\"]");
|
96 |
+
posttype.change(function(){
|
97 |
+
lablfeld.val(post_labels[posttype.val()]+'<?php _e( 'archive','vkExUnit' );?>');
|
98 |
+
});
|
99 |
+
});
|
100 |
+
</script>
|
101 |
<?php
|
102 |
}
|
103 |
|
104 |
|
105 |
+
function update( $new_instance, $old_instance ) {
|
106 |
$instance = $old_instance;
|
107 |
$instance['post_type'] = $new_instance['post_type'];
|
108 |
$instance['display_type'] = $new_instance['display_type'];
|
109 |
+
if ( ! $new_instance['label'] ) {
|
110 |
$new_instance['label'] = $new_instance['hide'];
|
111 |
}
|
112 |
$instance['label'] = $new_instance['label'];
|
113 |
return $instance;
|
114 |
}
|
115 |
}
|
116 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_VK_archive_list");' ) );
|
plugins/other_widget/widget-child-page-list.php
CHANGED
@@ -7,44 +7,44 @@
|
|
7 |
class WP_Widget_vkExUnit_child_page extends WP_Widget {
|
8 |
|
9 |
function __construct() {
|
10 |
-
$widget_name = vkExUnit_get_short_name(). '_' . __(
|
11 |
|
12 |
parent::__construct(
|
13 |
'vkExUnit_child_pages',
|
14 |
$widget_name,
|
15 |
-
array( 'description' => __('Display the child pages list from ancestor page.', 'vkExUnit') )
|
16 |
);
|
17 |
}
|
18 |
|
19 |
|
20 |
-
function widget($args, $instance) {
|
21 |
-
if( !is_page() ) return;
|
22 |
$post_id = get_the_id();
|
23 |
-
if(
|
24 |
$parent_id = 0;
|
25 |
|
26 |
$post_three = array();
|
27 |
$post_three[] = $post_id;
|
28 |
|
29 |
-
while(end($post_three)){
|
30 |
-
$the_query = new WP_Query(array('p' => end($post_three),'post_type' => 'page','posts_per_page' => 1));
|
31 |
$post_three[] = $the_query->posts[0]->post_parent;
|
32 |
-
unset($the_query);
|
33 |
}
|
34 |
-
$parent_id = $post_three[count($post_three)-2];
|
35 |
-
$children = wp_list_pages(
|
36 |
-
if(
|
37 |
// var_dump($args);
|
38 |
echo $args['before_widget'];
|
39 |
echo '<div class="sideWidget widget_childPageList widget_nav_menu">';
|
40 |
-
echo $args['before_title'] . '<a href="' . get_permalink($post_id) . '">' . get_the_title($parent_id) . '</a></h1>' . $args['after_title'];
|
41 |
echo '<ul>' . $children . '</ul>';
|
42 |
echo '</div>';
|
43 |
echo $args['after_widget'];
|
44 |
}
|
45 |
|
46 |
|
47 |
-
function form($instance) {
|
48 |
?>
|
49 |
<div style="padding:0.6em 0;">
|
50 |
<?php _e( 'Display the child pages list from ancestor page.', 'vkExUnit' ); ?>
|
@@ -53,8 +53,8 @@ class WP_Widget_vkExUnit_child_page extends WP_Widget {
|
|
53 |
}
|
54 |
|
55 |
|
56 |
-
function update($instance, $old_instance) {
|
57 |
return $instance;
|
58 |
}
|
59 |
}
|
60 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_vkExUnit_child_page");'));
|
7 |
class WP_Widget_vkExUnit_child_page extends WP_Widget {
|
8 |
|
9 |
function __construct() {
|
10 |
+
$widget_name = vkExUnit_get_short_name(). '_' . __( 'Child Page List', 'vkExUnit' );
|
11 |
|
12 |
parent::__construct(
|
13 |
'vkExUnit_child_pages',
|
14 |
$widget_name,
|
15 |
+
array( 'description' => __( 'Display the child pages list from ancestor page.', 'vkExUnit' ) )
|
16 |
);
|
17 |
}
|
18 |
|
19 |
|
20 |
+
function widget( $args, $instance ) {
|
21 |
+
if ( ! is_page() ) { return; }
|
22 |
$post_id = get_the_id();
|
23 |
+
if ( ! $post_id ) { return; }
|
24 |
$parent_id = 0;
|
25 |
|
26 |
$post_three = array();
|
27 |
$post_three[] = $post_id;
|
28 |
|
29 |
+
while ( end( $post_three ) ) {
|
30 |
+
$the_query = new WP_Query( array( 'p' => end( $post_three ), 'post_type' => 'page', 'posts_per_page' => 1 ) );
|
31 |
$post_three[] = $the_query->posts[0]->post_parent;
|
32 |
+
unset( $the_query );
|
33 |
}
|
34 |
+
$parent_id = $post_three[ count( $post_three ) -2 ];
|
35 |
+
$children = wp_list_pages( 'title_li=&child_of='.$parent_id.'&echo=0' );
|
36 |
+
if ( ! $children ) { return; }
|
37 |
// var_dump($args);
|
38 |
echo $args['before_widget'];
|
39 |
echo '<div class="sideWidget widget_childPageList widget_nav_menu">';
|
40 |
+
echo $args['before_title'] . '<a href="' . get_permalink( $post_id ) . '">' . get_the_title( $parent_id ) . '</a></h1>' . $args['after_title'];
|
41 |
echo '<ul>' . $children . '</ul>';
|
42 |
echo '</div>';
|
43 |
echo $args['after_widget'];
|
44 |
}
|
45 |
|
46 |
|
47 |
+
function form( $instance ) {
|
48 |
?>
|
49 |
<div style="padding:0.6em 0;">
|
50 |
<?php _e( 'Display the child pages list from ancestor page.', 'vkExUnit' ); ?>
|
53 |
}
|
54 |
|
55 |
|
56 |
+
function update( $instance, $old_instance ) {
|
57 |
return $instance;
|
58 |
}
|
59 |
}
|
60 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_vkExUnit_child_page");' ) );
|
plugins/other_widget/widget-new-posts.php
CHANGED
@@ -1,11 +1,11 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_post_list extends WP_Widget {
|
7 |
|
8 |
-
public $taxonomies = array('category');
|
9 |
|
10 |
function __construct() {
|
11 |
$widget_name = vkExUnit_get_short_name(). '_' . __( 'Recent Posts', 'vkExUnit' );
|
@@ -17,23 +17,23 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
|
|
17 |
);
|
18 |
}
|
19 |
|
20 |
-
function widget($args, $instance) {
|
21 |
-
if(!isset($instance['format'])) $instance['format'] = 0;
|
22 |
|
23 |
echo $args['before_widget'];
|
24 |
echo '<div class="veu_newPosts pt_'.$instance['format'].'">';
|
25 |
echo $args['before_title'];
|
26 |
-
if ( isset($instance['label']) && $instance['label'] ) {
|
27 |
echo $instance['label'];
|
28 |
} else {
|
29 |
-
_e('Recent Posts', 'vkExUnit' );
|
30 |
}
|
31 |
echo $args['after_title'];
|
32 |
|
33 |
-
$count = ( isset($instance['count']) && $instance['count'] ) ? $instance['count'] : 10;
|
34 |
-
$post_type = ( isset($instance['post_type']) && $instance['post_type'] ) ? $instance['post_type'] : 'post';
|
35 |
|
36 |
-
if($instance['format']) $this->_taxonomy_init($post_type);
|
37 |
|
38 |
$p_args = array(
|
39 |
'post_type' => $post_type,
|
@@ -41,24 +41,23 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
|
|
41 |
'paged' => 1,
|
42 |
);
|
43 |
|
44 |
-
if(isset($instance['terms']) && $instance['terms']){
|
45 |
-
$taxonomies = get_taxonomies(array());
|
46 |
$p_args['tax_query'] = array(
|
47 |
'relation' => 'OR',
|
48 |
);
|
49 |
-
foreach($taxonomies as $taxonomy){
|
50 |
-
|
51 |
'taxonomy' => $taxonomy,
|
52 |
'field' => 'id',
|
53 |
-
'terms' => $instance['terms']
|
54 |
);
|
55 |
}
|
56 |
}
|
57 |
$post_loop = new WP_Query( $p_args );
|
58 |
|
59 |
-
|
60 |
-
|
61 |
-
if(!$instance['format']){
|
62 |
while ( $post_loop->have_posts() ) : $post_loop->the_post();
|
63 |
$this->display_pattern_0();
|
64 |
endwhile;
|
@@ -81,23 +80,25 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
|
|
81 |
|
82 |
|
83 |
|
84 |
-
function display_pattern_0(){
|
|
|
85 |
<div class="media" id="post-<?php the_ID(); ?>">
|
86 |
-
<?php if ( has_post_thumbnail()) : ?>
|
87 |
-
|
88 |
-
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail('thumbnail'); ?></a>
|
89 |
-
|
90 |
<?php endif; ?>
|
91 |
-
|
92 |
<h4 class="media-heading"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
|
93 |
<div class="published entry-meta_items"><?php echo get_the_date(); ?></div>
|
94 |
-
|
95 |
</div><?php
|
96 |
}
|
97 |
|
98 |
|
99 |
|
100 |
-
function display_pattern_1(){
|
|
|
101 |
<li id="post-<?php the_ID(); ?>">
|
102 |
<span class="published entry-meta_items"><?php echo get_the_date(); ?></span>
|
103 |
<span class="taxonomies"><?php echo $this->taxonomy_list( get_the_id(), ' ', '', '' ); ?></span>
|
@@ -107,77 +108,76 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
|
|
107 |
|
108 |
|
109 |
|
110 |
-
function _taxonomy_init( $post_type ){
|
111 |
-
if($post_type == 'post') return;
|
112 |
$this->taxonomies = get_object_taxonomies( $post_type );
|
113 |
}
|
114 |
|
115 |
|
116 |
|
117 |
-
function taxonomy_list( $post_id=0, $before=' ', $sep=',', $after='' ){
|
118 |
-
if(
|
119 |
|
120 |
$taxo_catelist = array();
|
121 |
|
122 |
-
foreach( $this->taxonomies as $taxonomy ){
|
123 |
-
$terms = get_the_term_list( $post_id, $taxonomy, $before, $sep , $after);
|
124 |
-
if( $terms ) $taxo_catelist[] = $terms;
|
125 |
}
|
126 |
|
127 |
-
if( count( $taxo_catelist ) ) return join( $taxo_catelist, $sep );
|
128 |
return '';
|
129 |
}
|
130 |
|
131 |
|
132 |
|
133 |
-
function form
|
134 |
$defaults = array(
|
135 |
'count' => 10,
|
136 |
-
'label' => __('Recent Posts', 'vkExUnit' ),
|
137 |
'post_type' => 'post',
|
138 |
'terms' => '',
|
139 |
-
'format' => '0'
|
140 |
);
|
141 |
|
142 |
-
$instance = wp_parse_args((array) $instance, $defaults);
|
143 |
//タイトル ?>
|
144 |
-
|
145 |
-
<?php echo _e('Display Format', 'vkExUnit'); ?>:<br/>
|
146 |
-
<label><input type="radio" name="<?php echo $this->get_field_name('format'); ?>" value="0" <?php if(
|
147 |
-
<label><input type="radio" name="<?php echo $this->get_field_name('format'); ?>" value="1" <?php if($instance['format'] == 1) echo 'checked'; ?>/><?php echo __('Date', 'vkExUnit') .'/'. __('Category', 'vkExUnit') .'/'. __('Title', 'vkExUnit'); ?></label>
|
148 |
-
|
149 |
-
<label for="<?php echo $this->get_field_id('label'); ?>"><?php _e('Title:'); ?></label><br/>
|
150 |
-
<input type="text" id="<?php echo $this->get_field_id('label'); ?>-title" name="<?php echo $this->get_field_name('label'); ?>" value="<?php echo $instance['label']; ?>" />
|
151 |
-
|
152 |
|
153 |
<?php //表示件数 ?>
|
154 |
-
<label for="<?php echo $this->get_field_id('count'); ?>"><?php _e('Display count','vkExUnit'); ?>:</label><br/>
|
155 |
-
<input type="text" id="<?php echo $this->get_field_id('count'); ?>" name="<?php echo $this->get_field_name('count'); ?>" value="<?php echo $instance['count']; ?>" />
|
156 |
-
|
157 |
|
158 |
<?php //投稿タイプ ?>
|
159 |
-
<label for="<?php echo $this->get_field_id('post_type'); ?>"><?php _e('Slug for the custom type you want to display', 'vkExUnit') ?>:</label><br />
|
160 |
-
<input type="text" id="<?php echo $this->get_field_id('post_type'); ?>" name="<?php echo $this->get_field_name('post_type'); ?>" value="<?php echo esc_attr($instance['post_type']) ?>" />
|
161 |
-
|
162 |
|
163 |
<?php // Terms ?>
|
164 |
-
<label for="<?php echo $this->get_field_id('terms'); ?>"><?php _e('taxonomy ID', 'vkExUnit') ?>:</label><br />
|
165 |
-
<input type="text" id="<?php echo $this->get_field_id('terms'); ?>" name="<?php echo $this->get_field_name('terms'); ?>" value="<?php echo esc_attr($instance['terms']) ?>" /><br />
|
166 |
-
<?php _e('if you need filtering by term, add the term ID separate by ",".', 'vkExUnit');
|
167 |
-
echo
|
168 |
-
_e('if empty this area, I will do not filtering.', 'vkExUnit');
|
169 |
-
echo
|
170 |
}
|
171 |
|
172 |
-
function update
|
173 |
$instance = $old_instance;
|
174 |
$instance['format'] = $new_instance['format'];
|
175 |
$instance['count'] = $new_instance['count'];
|
176 |
$instance['label'] = $new_instance['label'];
|
177 |
-
$instance['post_type'] = !empty($new_instance['post_type']) ? strip_tags($new_instance['post_type']) : 'post';
|
178 |
-
$instance['terms'] = preg_replace('/([^0-9,]+)/', '', $new_instance['terms']);
|
179 |
return $instance;
|
180 |
}
|
181 |
-
|
182 |
}
|
183 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_vkExUnit_post_list");'));
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* Side Post list widget
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_post_list extends WP_Widget {
|
7 |
|
8 |
+
public $taxonomies = array( 'category' );
|
9 |
|
10 |
function __construct() {
|
11 |
$widget_name = vkExUnit_get_short_name(). '_' . __( 'Recent Posts', 'vkExUnit' );
|
17 |
);
|
18 |
}
|
19 |
|
20 |
+
function widget( $args, $instance ) {
|
21 |
+
if ( ! isset( $instance['format'] ) ) { $instance['format'] = 0; }
|
22 |
|
23 |
echo $args['before_widget'];
|
24 |
echo '<div class="veu_newPosts pt_'.$instance['format'].'">';
|
25 |
echo $args['before_title'];
|
26 |
+
if ( isset( $instance['label'] ) && $instance['label'] ) {
|
27 |
echo $instance['label'];
|
28 |
} else {
|
29 |
+
_e( 'Recent Posts', 'vkExUnit' );
|
30 |
}
|
31 |
echo $args['after_title'];
|
32 |
|
33 |
+
$count = ( isset( $instance['count'] ) && $instance['count'] ) ? $instance['count'] : 10;
|
34 |
+
$post_type = ( isset( $instance['post_type'] ) && $instance['post_type'] ) ? $instance['post_type'] : 'post';
|
35 |
|
36 |
+
if ( $instance['format'] ) { $this->_taxonomy_init( $post_type ); }
|
37 |
|
38 |
$p_args = array(
|
39 |
'post_type' => $post_type,
|
41 |
'paged' => 1,
|
42 |
);
|
43 |
|
44 |
+
if ( isset( $instance['terms'] ) && $instance['terms'] ) {
|
45 |
+
$taxonomies = get_taxonomies( array() );
|
46 |
$p_args['tax_query'] = array(
|
47 |
'relation' => 'OR',
|
48 |
);
|
49 |
+
foreach ( $taxonomies as $taxonomy ) {
|
50 |
+
$p_args['tax_query'][] = array(
|
51 |
'taxonomy' => $taxonomy,
|
52 |
'field' => 'id',
|
53 |
+
'terms' => $instance['terms'],
|
54 |
);
|
55 |
}
|
56 |
}
|
57 |
$post_loop = new WP_Query( $p_args );
|
58 |
|
59 |
+
if ( $post_loop->have_posts() ) :
|
60 |
+
if ( ! $instance['format'] ) {
|
|
|
61 |
while ( $post_loop->have_posts() ) : $post_loop->the_post();
|
62 |
$this->display_pattern_0();
|
63 |
endwhile;
|
80 |
|
81 |
|
82 |
|
83 |
+
function display_pattern_0() {
|
84 |
+
?>
|
85 |
<div class="media" id="post-<?php the_ID(); ?>">
|
86 |
+
<?php if ( has_post_thumbnail() ) : ?>
|
87 |
+
<div class="media-left postList_thumbnail">
|
88 |
+
<a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'thumbnail' ); ?></a>
|
89 |
+
</div>
|
90 |
<?php endif; ?>
|
91 |
+
<div class="media-body">
|
92 |
<h4 class="media-heading"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h4>
|
93 |
<div class="published entry-meta_items"><?php echo get_the_date(); ?></div>
|
94 |
+
</div>
|
95 |
</div><?php
|
96 |
}
|
97 |
|
98 |
|
99 |
|
100 |
+
function display_pattern_1() {
|
101 |
+
?>
|
102 |
<li id="post-<?php the_ID(); ?>">
|
103 |
<span class="published entry-meta_items"><?php echo get_the_date(); ?></span>
|
104 |
<span class="taxonomies"><?php echo $this->taxonomy_list( get_the_id(), ' ', '', '' ); ?></span>
|
108 |
|
109 |
|
110 |
|
111 |
+
function _taxonomy_init( $post_type ) {
|
112 |
+
if ( $post_type == 'post' ) { return; }
|
113 |
$this->taxonomies = get_object_taxonomies( $post_type );
|
114 |
}
|
115 |
|
116 |
|
117 |
|
118 |
+
function taxonomy_list( $post_id = 0, $before = ' ', $sep = ',', $after = '' ) {
|
119 |
+
if ( ! $post_id ) { $post_id = get_the_ID(); }
|
120 |
|
121 |
$taxo_catelist = array();
|
122 |
|
123 |
+
foreach ( $this->taxonomies as $taxonomy ) {
|
124 |
+
$terms = get_the_term_list( $post_id, $taxonomy, $before, $sep , $after );
|
125 |
+
if ( $terms ) { $taxo_catelist[] = $terms; }
|
126 |
}
|
127 |
|
128 |
+
if ( count( $taxo_catelist ) ) { return join( $taxo_catelist, $sep ); }
|
129 |
return '';
|
130 |
}
|
131 |
|
132 |
|
133 |
|
134 |
+
function form( $instance ) {
|
135 |
$defaults = array(
|
136 |
'count' => 10,
|
137 |
+
'label' => __( 'Recent Posts', 'vkExUnit' ),
|
138 |
'post_type' => 'post',
|
139 |
'terms' => '',
|
140 |
+
'format' => '0',
|
141 |
);
|
142 |
|
143 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
144 |
//タイトル ?>
|
145 |
+
<br/>
|
146 |
+
<?php echo _e( 'Display Format', 'vkExUnit' ); ?>:<br/>
|
147 |
+
<label><input type="radio" name="<?php echo $this->get_field_name( 'format' ); ?>" value="0" <?php if ( ! $instance['format'] ) { echo 'checked'; } ?> /><?php echo __( 'Thumbnail', 'vkExUnit' ) .'/'. __( 'Title', 'vkExUnit' ) .'/'. __( 'Date', 'vkExUnit' ); ?></label><br/>
|
148 |
+
<label><input type="radio" name="<?php echo $this->get_field_name( 'format' ); ?>" value="1" <?php if ( $instance['format'] == 1 ) { echo 'checked'; } ?>/><?php echo __( 'Date', 'vkExUnit' ) .'/'. __( 'Category', 'vkExUnit' ) .'/'. __( 'Title', 'vkExUnit' ); ?></label>
|
149 |
+
<br/><br/>
|
150 |
+
<label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Title:' ); ?></label><br/>
|
151 |
+
<input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" />
|
152 |
+
<br/><br />
|
153 |
|
154 |
<?php //表示件数 ?>
|
155 |
+
<label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Display count','vkExUnit' ); ?>:</label><br/>
|
156 |
+
<input type="text" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" value="<?php echo $instance['count']; ?>" />
|
157 |
+
<br /><br />
|
158 |
|
159 |
<?php //投稿タイプ ?>
|
160 |
+
<label for="<?php echo $this->get_field_id( 'post_type' ); ?>"><?php _e( 'Slug for the custom type you want to display', 'vkExUnit' ) ?>:</label><br />
|
161 |
+
<input type="text" id="<?php echo $this->get_field_id( 'post_type' ); ?>" name="<?php echo $this->get_field_name( 'post_type' ); ?>" value="<?php echo esc_attr( $instance['post_type'] ) ?>" />
|
162 |
+
<br/><br/>
|
163 |
|
164 |
<?php // Terms ?>
|
165 |
+
<label for="<?php echo $this->get_field_id( 'terms' ); ?>"><?php _e( 'taxonomy ID', 'vkExUnit' ) ?>:</label><br />
|
166 |
+
<input type="text" id="<?php echo $this->get_field_id( 'terms' ); ?>" name="<?php echo $this->get_field_name( 'terms' ); ?>" value="<?php echo esc_attr( $instance['terms'] ) ?>" /><br />
|
167 |
+
<?php _e( 'if you need filtering by term, add the term ID separate by ",".', 'vkExUnit' );
|
168 |
+
echo '<br/>';
|
169 |
+
_e( 'if empty this area, I will do not filtering.', 'vkExUnit' );
|
170 |
+
echo '<br/><br/>';
|
171 |
}
|
172 |
|
173 |
+
function update( $new_instance, $old_instance ) {
|
174 |
$instance = $old_instance;
|
175 |
$instance['format'] = $new_instance['format'];
|
176 |
$instance['count'] = $new_instance['count'];
|
177 |
$instance['label'] = $new_instance['label'];
|
178 |
+
$instance['post_type'] = ! empty( $new_instance['post_type'] ) ? strip_tags( $new_instance['post_type'] ) : 'post';
|
179 |
+
$instance['terms'] = preg_replace( '/([^0-9,]+)/', '', $new_instance['terms'] );
|
180 |
return $instance;
|
181 |
}
|
|
|
182 |
}
|
183 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_vkExUnit_post_list");' ) );
|
plugins/other_widget/widget-page.php
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_widget_page extends WP_Widget {
|
7 |
|
@@ -15,59 +15,60 @@ class WP_Widget_vkExUnit_widget_page extends WP_Widget {
|
|
15 |
);
|
16 |
}
|
17 |
|
18 |
-
function widget($args, $instance){
|
19 |
global $is_pagewidget;
|
20 |
$is_pagewidget = true;
|
21 |
-
$this->display_page($instance['page_id'],$instance['set_title'],$args);
|
22 |
$is_pagewidget = false;
|
23 |
}
|
24 |
|
25 |
-
function form($instance){
|
26 |
$defaults = array(
|
27 |
'page_id' => 2,
|
28 |
-
'set_title' => true
|
29 |
);
|
30 |
|
31 |
-
$instance = wp_parse_args((array) $instance, $defaults); ?>
|
32 |
-
|
33 |
<?php $pages = get_pages(); ?>
|
34 |
-
<label for="<?php echo $this->get_field_id('page_id'); ?>"><?php _e('Display page', 'vkExUnit') ?></label>
|
35 |
-
<select name="<?php echo $this->get_field_name('page_id'); ?>" >
|
36 |
-
<?php foreach($pages as $page){
|
37 |
-
<option value="<?php echo $page->ID; ?>" <?php if($instance['page_id'] == $page->ID) echo 'selected="selected"'; ?> ><?php echo $page->post_title; ?></option>
|
38 |
<?php } ?>
|
39 |
-
|
40 |
-
|
41 |
-
<input type="checkbox" name="<?php echo $this->get_field_name('set_title'); ?>" value="true" <?php echo ($instance['set_title'])? 'checked': '' ; ?> >
|
42 |
-
<label for="<?php echo $this->get_field_id('set_title'); ?>"> <?php _e( 'display title', 'vkExUnit' ); ?></label>
|
43 |
-
|
44 |
<?php
|
45 |
}
|
46 |
|
47 |
-
function update($new_instance, $old_instance){
|
48 |
$instance = $old_instance;
|
49 |
$instance['page_id'] = $new_instance['page_id'];
|
50 |
$instance['set_title'] = ($new_instance['set_title'] == 'true')? true : false;
|
51 |
return $instance;
|
52 |
}
|
53 |
|
54 |
-
function display_page( $pageid
|
55 |
echo $args['before_widget'];
|
56 |
-
$page = get_page($pageid);
|
57 |
echo PHP_EOL.'<div id="widget-page-'.$pageid.'" class="widget_pageContent">' . PHP_EOL;
|
58 |
-
if($titleflag){
|
59 |
-
echo apply_filters('the_content', $page->post_content );
|
60 |
|
61 |
-
if ( is_user_logged_in() ==
|
62 |
global $user_level;
|
63 |
get_currentuserinfo();
|
64 |
-
if (10 <= $user_level) { ?>
|
65 |
-
|
66 |
-
<a href="<?php echo site_url(); ?>/wp-admin/post.php?post=<?php echo $pageid ;?>&action=edit" class="btn btn-default btn-sm"><?php _e('Edit', 'vkExUnit');?></a>
|
67 |
-
|
68 |
-
<?php }
|
|
|
69 |
echo '</div>'.PHP_EOL;
|
70 |
echo $args['after_widget'];
|
71 |
}
|
72 |
}
|
73 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_vkExUnit_widget_page");'));
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* page widget
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_widget_page extends WP_Widget {
|
7 |
|
15 |
);
|
16 |
}
|
17 |
|
18 |
+
function widget( $args, $instance ) {
|
19 |
global $is_pagewidget;
|
20 |
$is_pagewidget = true;
|
21 |
+
$this->display_page( $instance['page_id'],$instance['set_title'],$args );
|
22 |
$is_pagewidget = false;
|
23 |
}
|
24 |
|
25 |
+
function form( $instance ) {
|
26 |
$defaults = array(
|
27 |
'page_id' => 2,
|
28 |
+
'set_title' => true,
|
29 |
);
|
30 |
|
31 |
+
$instance = wp_parse_args( (array) $instance, $defaults ); ?>
|
32 |
+
<p>
|
33 |
<?php $pages = get_pages(); ?>
|
34 |
+
<label for="<?php echo $this->get_field_id( 'page_id' ); ?>"><?php _e( 'Display page', 'vkExUnit' ) ?></label>
|
35 |
+
<select name="<?php echo $this->get_field_name( 'page_id' ); ?>" >
|
36 |
+
<?php foreach ( $pages as $page ) { ?>
|
37 |
+
<option value="<?php echo $page->ID; ?>" <?php if ( $instance['page_id'] == $page->ID ) { echo 'selected="selected"'; } ?> ><?php echo $page->post_title; ?></option>
|
38 |
<?php } ?>
|
39 |
+
</select>
|
40 |
+
<br/>
|
41 |
+
<input type="checkbox" name="<?php echo $this->get_field_name( 'set_title' ); ?>" value="true" <?php echo ($instance['set_title'])? 'checked': '' ; ?> >
|
42 |
+
<label for="<?php echo $this->get_field_id( 'set_title' ); ?>"> <?php _e( 'display title', 'vkExUnit' ); ?></label>
|
43 |
+
</p>
|
44 |
<?php
|
45 |
}
|
46 |
|
47 |
+
function update( $new_instance, $old_instance ) {
|
48 |
$instance = $old_instance;
|
49 |
$instance['page_id'] = $new_instance['page_id'];
|
50 |
$instance['set_title'] = ($new_instance['set_title'] == 'true')? true : false;
|
51 |
return $instance;
|
52 |
}
|
53 |
|
54 |
+
function display_page( $pageid, $titleflag = false, $args ) {
|
55 |
echo $args['before_widget'];
|
56 |
+
$page = get_page( $pageid );
|
57 |
echo PHP_EOL.'<div id="widget-page-'.$pageid.'" class="widget_pageContent">' . PHP_EOL;
|
58 |
+
if ( $titleflag ) { echo $args['before_title'] . $page->post_title . $args['after_title'] . PHP_EOL; }
|
59 |
+
echo apply_filters( 'the_content', $page->post_content );
|
60 |
|
61 |
+
if ( is_user_logged_in() == true ) {
|
62 |
global $user_level;
|
63 |
get_currentuserinfo();
|
64 |
+
if ( 10 <= $user_level ) { ?>
|
65 |
+
<div class="veu_adminEdit">
|
66 |
+
<a href="<?php echo site_url(); ?>/wp-admin/post.php?post=<?php echo $pageid ;?>&action=edit" class="btn btn-default btn-sm"><?php _e( 'Edit', 'vkExUnit' );?></a>
|
67 |
+
</div>
|
68 |
+
<?php }
|
69 |
+
}
|
70 |
echo '</div>'.PHP_EOL;
|
71 |
echo $args['after_widget'];
|
72 |
}
|
73 |
}
|
74 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_vkExUnit_widget_page");' ) );
|
plugins/other_widget/widget-pr-blocks.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_PR_Blocks extends WP_Widget {
|
7 |
|
8 |
function __construct() {
|
9 |
-
$widget_name = vkExUnit_get_short_name(). '_' . __(
|
10 |
|
11 |
parent::__construct(
|
12 |
'WP_Widget_vkExUnit_PR_Blocks',
|
@@ -15,7 +15,7 @@ class WP_Widget_vkExUnit_PR_Blocks extends WP_Widget {
|
|
15 |
);
|
16 |
}
|
17 |
|
18 |
-
function form($instance){
|
19 |
$defaults = array(
|
20 |
'block_count' => 3,
|
21 |
|
@@ -49,130 +49,130 @@ class WP_Widget_vkExUnit_PR_Blocks extends WP_Widget {
|
|
49 |
'iconFont_class_4' => 'fa-envelope',
|
50 |
'iconFont_bgColor_4' => '#337ab7',
|
51 |
'summary_4' => '',
|
52 |
-
'linkurl_4' => ''
|
53 |
);
|
54 |
-
$instance = wp_parse_args((array) $instance, $defaults);
|
55 |
?>
|
56 |
|
57 |
<?php // select Block count ?>
|
58 |
<p>
|
59 |
-
<label for="<?php echo $this->get_field_id('block_count'); ?>"><?php _e( 'The choice of the number of columns:', 'vkExUnit' ); ?></label><br/>
|
60 |
-
<select name="<?php echo $this->get_field_name('block_count'); ?>" id="<?php echo $this->get_field_id('block_count'); ?>-count">
|
61 |
-
<option value="3" <?php if(intval($instance['block_count']) === 3 ){
|
62 |
-
<option value="4" <?php if(intval($instance['block_count']) === 4 ){
|
63 |
</select><br>
|
64 |
<?php _e( 'If you change the number of columns, click to "Save" botton and exit the edit page. When restart the edit page, the column input form is increased or decreased.', 'vkExUnit' ); ?>
|
65 |
</p>
|
66 |
|
67 |
<?php // PR Blocks
|
68 |
-
|
69 |
|
70 |
-
|
71 |
-
|
72 |
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
<input type="text" id="'.$this->get_field_id('iconFont_class_'.$i).'-font" class="font_class" name="'.$this->get_field_name('iconFont_class_'.$i).'" value="'.$instance['iconFont_class_'.$i].'" /><br>'
|
81 |
-
|
82 |
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
|
92 |
-
|
93 |
-
|
94 |
|
95 |
-
|
96 |
-
|
97 |
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
|
117 |
-
|
118 |
-
|
119 |
}
|
120 |
|
121 |
|
122 |
-
function update
|
123 |
$instance = $old_instance;
|
124 |
|
125 |
$instance['block_count'] = $new_instance['block_count'];
|
126 |
|
127 |
for ( $i = 1; $i <= 4; ) {
|
128 |
-
$instance['label_'.$i] = $new_instance['label_'.$i];
|
129 |
-
$instance['media_image_'.$i] = $new_instance['media_image_'.$i];
|
130 |
-
$instance['media_alt_'.$i] = $new_instance['media_alt_'.$i];
|
131 |
-
$instance['iconFont_class_'.$i] = $new_instance['iconFont_class_'.$i];
|
132 |
-
$instance['iconFont_bgColor_'.$i] = $new_instance['iconFont_bgColor_'.$i];
|
133 |
-
$instance['summary_'.$i] = $new_instance['summary_'.$i];
|
134 |
-
$instance['linkurl_'.$i] = $new_instance['linkurl_'.$i];
|
135 |
$i++;
|
136 |
}
|
137 |
return $instance;
|
138 |
}
|
139 |
|
140 |
|
141 |
-
function widget($args, $instance) {
|
142 |
echo $args['before_widget'];
|
143 |
echo PHP_EOL.'<div class="veu_prBlocks">'.PHP_EOL;
|
144 |
|
145 |
-
$widget_block_count = ( isset($instance['block_count'])) ? intval($instance['block_count']) : 3;
|
146 |
|
147 |
// Print widget area
|
148 |
for ( $i = 1; $i <= $widget_block_count; ) {
|
149 |
-
if( isset($instance['label_'.$i]) && $instance['label_'.$i] ){
|
150 |
echo '<article class="prArea">'.PHP_EOL;
|
151 |
-
if( !empty($instance['linkurl_'.$i]) ){
|
152 |
-
echo '<a href="'.esc_url($instance['linkurl_'.$i]).'">'.PHP_EOL ;
|
153 |
}
|
154 |
// icon font display
|
155 |
-
if( empty($instance['media_image_'.$i]) && !empty($instance['iconFont_class_'.$i])){
|
156 |
-
echo '<div class="circle_icon" style="background-color:'.esc_attr($instance['iconFont_bgColor_'.$i]).'">';
|
157 |
-
echo '<i class="fa '.esc_attr($instance['iconFont_class_'.$i]).' font_icon"></i></div>'.PHP_EOL;
|
158 |
-
|
159 |
-
} else if( !empty($instance['media_image_'.$i]) ) {
|
160 |
echo '<div class="media_pr">'.PHP_EOL;
|
161 |
-
echo '<img class="pr_image" src="'.esc_url($instance['media_image_'.$i]).'" alt="'.esc_attr($instance['media_alt_'.$i]).'" />'.PHP_EOL.'</div><!--//.media_pr -->'.PHP_EOL;
|
162 |
}
|
163 |
// title text
|
164 |
echo '<h1 class="prBox_title">';
|
165 |
-
if ( isset($instance['label_'.$i]) && $instance['label_'.$i] ) {
|
166 |
-
echo $instance['label_'.$i];
|
167 |
} else {
|
168 |
-
_e(
|
169 |
}
|
170 |
echo '</h1>'.PHP_EOL;
|
171 |
// summary text
|
172 |
-
if( !empty($instance['summary_'.$i]) ){
|
173 |
-
echo '<p class="summary">'.nl2br(esc_attr($instance['summary_'.$i])).'</p>'.PHP_EOL;
|
174 |
}
|
175 |
-
if( !empty($instance['linkurl_'.$i]) ){
|
176 |
echo '</a>'.PHP_EOL;
|
177 |
}
|
178 |
|
@@ -184,7 +184,7 @@ class WP_Widget_vkExUnit_PR_Blocks extends WP_Widget {
|
|
184 |
echo '</div>' . $args['after_widget'] . PHP_EOL . '<!-- //.pr_blocks -->';
|
185 |
}
|
186 |
}
|
187 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_vkExUnit_PR_Blocks");'));
|
188 |
|
189 |
// uploader js
|
190 |
add_action( 'admin_print_scripts', 'admin_scripts_pr_media' );
|
@@ -197,38 +197,39 @@ function admin_scripts_pr_media() {
|
|
197 |
// color picker js
|
198 |
add_action( 'admin_enqueue_scripts', 'admin_scripts_pr_color' );
|
199 |
function admin_scripts_pr_color() {
|
200 |
-
wp_enqueue_style( 'wp-color-picker');
|
201 |
-
wp_enqueue_script( 'wp-color-picker');
|
202 |
}
|
203 |
|
204 |
add_action( 'admin_footer-widgets.php', 'print_scripts_pr_color' );
|
205 |
-
function print_scripts_pr_color() {
|
|
|
206 |
<script type="text/javascript">
|
207 |
(function($){
|
208 |
-
|
209 |
-
|
210 |
-
|
211 |
-
|
212 |
-
|
213 |
-
|
214 |
-
|
215 |
-
|
216 |
-
|
217 |
-
|
218 |
-
|
219 |
-
|
220 |
-
|
221 |
-
|
222 |
-
|
223 |
-
|
224 |
-
|
225 |
}(jQuery));
|
226 |
</script>
|
227 |
<?php }
|
228 |
|
229 |
// PR blocks admin CSS
|
230 |
-
add_action(
|
231 |
function style_prBlocks() {
|
232 |
-
echo '<style>.media.image_pr{ max-height: 170px; }
|
233 |
.media_img{ max-width: 100%; height: auto; position: relative; z-index: 999;}</style>'.PHP_EOL;
|
234 |
-
}
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* VK PR Blocks
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_PR_Blocks extends WP_Widget {
|
7 |
|
8 |
function __construct() {
|
9 |
+
$widget_name = vkExUnit_get_short_name(). '_' . __( 'PR Blocks', 'vkExUnit' );
|
10 |
|
11 |
parent::__construct(
|
12 |
'WP_Widget_vkExUnit_PR_Blocks',
|
15 |
);
|
16 |
}
|
17 |
|
18 |
+
function form( $instance ) {
|
19 |
$defaults = array(
|
20 |
'block_count' => 3,
|
21 |
|
49 |
'iconFont_class_4' => 'fa-envelope',
|
50 |
'iconFont_bgColor_4' => '#337ab7',
|
51 |
'summary_4' => '',
|
52 |
+
'linkurl_4' => '',
|
53 |
);
|
54 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
55 |
?>
|
56 |
|
57 |
<?php // select Block count ?>
|
58 |
<p>
|
59 |
+
<label for="<?php echo $this->get_field_id( 'block_count' ); ?>"><?php _e( 'The choice of the number of columns:', 'vkExUnit' ); ?></label><br/>
|
60 |
+
<select name="<?php echo $this->get_field_name( 'block_count' ); ?>" id="<?php echo $this->get_field_id( 'block_count' ); ?>-count">
|
61 |
+
<option value="3" <?php if ( intval( $instance['block_count'] ) === 3 ) { echo 'selected'; } ?>><?php _e( '3column', 'vkExUnit' ); ?></option>
|
62 |
+
<option value="4" <?php if ( intval( $instance['block_count'] ) === 4 ) { echo 'selected'; } ?>><?php _e( '4column', 'vkExUnit' ); ?></option>
|
63 |
</select><br>
|
64 |
<?php _e( 'If you change the number of columns, click to "Save" botton and exit the edit page. When restart the edit page, the column input form is increased or decreased.', 'vkExUnit' ); ?>
|
65 |
</p>
|
66 |
|
67 |
<?php // PR Blocks
|
68 |
+
for ( $i = 1; $i <= intval( $instance['block_count'] ); ) {
|
69 |
|
70 |
+
// PR Block admin title
|
71 |
+
echo '<h5 class="pr_subTitle">'.__( 'PR Block'.$i.' setting', 'vkExUnit' ).'</h5>';
|
72 |
|
73 |
+
// PR Block display title
|
74 |
+
echo '<p><label for="'.$this->get_field_id( 'label_'.$i ).'">'.__( 'Title:', 'vkExUnit' ).'</label><br/>'.
|
75 |
+
'<input type="text" id="'.$this->get_field_id( 'label_'.$i ).'-title" class="pr-input" name="'.$this->get_field_name( 'label_'.$i ).'" value="'.$instance[ 'label_'.$i ].'" /></p>';
|
76 |
|
77 |
+
// icon font class input
|
78 |
+
echo '<p><label for="'.$this->get_field_id( 'iconFont_'.$i ).'">'.__( 'Class name of the icon font you want to use:', 'vkExUnit' ).'</label><br/>'.
|
79 |
+
'[ <a href="http://fortawesome.github.io/Font-Awesome/icons/" target="_blank">Font Awesome Icons</a> ]<br/>
|
80 |
+
<input type="text" id="'.$this->get_field_id( 'iconFont_class_'.$i ).'-font" class="font_class" name="'.$this->get_field_name( 'iconFont_class_'.$i ).'" value="'.$instance[ 'iconFont_class_'.$i ].'" /><br>'
|
81 |
+
.__( 'To choose your favorite icon, and enter the class.', 'vkExUnit' ).'<br>'.__( ' ex:fa-file-text-o', 'vkExUnit' ).'</p>';
|
82 |
|
83 |
+
// icon font background color
|
84 |
+
echo '<p class="color_picker_wrap">'.
|
85 |
+
'<label for="'.$this->get_field_id( 'iconFont_bgColor_'.$i ).'">'.__( 'Icon bg-color:', 'vkExUnit' ).'</label><br/>'.
|
86 |
+
'<input type="text" id="'.$this->get_field_id( 'iconFont_bgColor_'.$i ).'-color" class="color_picker" name="'.$this->get_field_name( 'iconFont_bgColor_'.$i ).'" value="'.$instance[ 'iconFont_bgColor_'.$i ].'" /></p>';
|
87 |
|
88 |
+
// media uploader imageurl input area
|
89 |
+
echo '<p><label for="'.$this->get_field_id( 'media_image_'.$i ).'">'.__( 'Select image:', 'vkExUnit' ).'</label><br/>'.
|
90 |
+
'<input type="hidden" class="pr_media_image '.$this->get_field_id( 'media_image_'.$i ).'" id="'.$this->get_field_id( 'media_image_'.$i ).'-image" name="'.$this->get_field_name( 'media_image_'.$i ).'" value="'.esc_attr( $instance[ 'media_image_'.$i ] ).'" />';
|
91 |
|
92 |
+
// media uploader imagealt input area
|
93 |
+
echo '<input type="hidden" class="pr_media_alt" id="'.$this->get_field_id( 'media_alt_'.$i ).'-alt" name="'.$this->get_field_name( 'media_alt_'.$i ).'" value="'.esc_attr( $instance[ 'media_alt_'.$i ] ).'" />';
|
94 |
|
95 |
+
// media uploader select btn
|
96 |
+
echo '<input type="button" class="media_select" value="'.__( 'Select image', 'vkExUnit' ).'" onclick="clickSelectPrBroks(event.target);" />';
|
97 |
|
98 |
+
// media uploader clear btn
|
99 |
+
echo '<input type="button" class="media_clear" value="'.__( 'Clear image', 'vkExUnit' ).'" onclick="clickClearPrBroks(event.target);" />'.
|
100 |
+
'<br />'.__( 'When you have an image. Image is displayed with priority', 'vkExUnit' ).'</p>';
|
101 |
|
102 |
+
// media image display
|
103 |
+
echo '<div class="media image_pr">';
|
104 |
+
if ( ! empty( $instance[ 'media_image_'.$i ] ) ) {
|
105 |
+
echo '<img class="media_img" src="'.esc_url( $instance[ 'media_image_'.$i ] ).'" alt="'. esc_attr( $instance[ 'media_alt_'.$i ] ).'" />';
|
106 |
+
}
|
107 |
+
echo '</div>';
|
108 |
|
109 |
+
// summary text
|
110 |
+
echo '<p><label for="'.$this->get_field_id( 'summary_'.$i ).'">'.__( 'Summary Text:', 'vkExUnit' ).'</label><br/></p>'.
|
111 |
+
'<textarea rows="4" cols="40" id="'.$this->get_field_id( 'summary_'.$i ).'_text" class="pr_input textarea" name="'.$this->get_field_name( 'summary_'.$i ).'">'.$instance[ 'summary_'.$i ].'</textarea>';
|
112 |
|
113 |
+
// link_URL
|
114 |
+
echo '<p><label for="'.$this->get_field_id( 'linkurl_'.$i ).'">'.__( 'Link URL:', 'vkExUnit' ).'</label><br/>'.
|
115 |
+
'<input type="text" id="'.$this->get_field_id( 'linkurl_'.$i ).'_title" class="pr_input" name="'.$this->get_field_name( 'linkurl_'.$i ).'" value="'.$instance[ 'linkurl_'.$i ].'" /></p>';
|
116 |
|
117 |
+
$i++;
|
118 |
+
}
|
119 |
}
|
120 |
|
121 |
|
122 |
+
function update( $new_instance, $old_instance ) {
|
123 |
$instance = $old_instance;
|
124 |
|
125 |
$instance['block_count'] = $new_instance['block_count'];
|
126 |
|
127 |
for ( $i = 1; $i <= 4; ) {
|
128 |
+
$instance[ 'label_'.$i ] = $new_instance[ 'label_'.$i ];
|
129 |
+
$instance[ 'media_image_'.$i ] = $new_instance[ 'media_image_'.$i ];
|
130 |
+
$instance[ 'media_alt_'.$i ] = $new_instance[ 'media_alt_'.$i ];
|
131 |
+
$instance[ 'iconFont_class_'.$i ] = $new_instance[ 'iconFont_class_'.$i ];
|
132 |
+
$instance[ 'iconFont_bgColor_'.$i ] = $new_instance[ 'iconFont_bgColor_'.$i ];
|
133 |
+
$instance[ 'summary_'.$i ] = $new_instance[ 'summary_'.$i ];
|
134 |
+
$instance[ 'linkurl_'.$i ] = $new_instance[ 'linkurl_'.$i ];
|
135 |
$i++;
|
136 |
}
|
137 |
return $instance;
|
138 |
}
|
139 |
|
140 |
|
141 |
+
function widget( $args, $instance ) {
|
142 |
echo $args['before_widget'];
|
143 |
echo PHP_EOL.'<div class="veu_prBlocks">'.PHP_EOL;
|
144 |
|
145 |
+
$widget_block_count = ( isset( $instance['block_count'] )) ? intval( $instance['block_count'] ) : 3;
|
146 |
|
147 |
// Print widget area
|
148 |
for ( $i = 1; $i <= $widget_block_count; ) {
|
149 |
+
if ( isset( $instance[ 'label_'.$i ] ) && $instance[ 'label_'.$i ] ) {
|
150 |
echo '<article class="prArea">'.PHP_EOL;
|
151 |
+
if ( ! empty( $instance[ 'linkurl_'.$i ] ) ) {
|
152 |
+
echo '<a href="'.esc_url( $instance[ 'linkurl_'.$i ] ).'">'.PHP_EOL ;
|
153 |
}
|
154 |
// icon font display
|
155 |
+
if ( empty( $instance[ 'media_image_'.$i ] ) && ! empty( $instance[ 'iconFont_class_'.$i ] ) ) {
|
156 |
+
echo '<div class="circle_icon" style="background-color:'.esc_attr( $instance[ 'iconFont_bgColor_'.$i ] ).'">';
|
157 |
+
echo '<i class="fa '.esc_attr( $instance[ 'iconFont_class_'.$i ] ).' font_icon"></i></div>'.PHP_EOL;
|
158 |
+
// image display
|
159 |
+
} else if ( ! empty( $instance[ 'media_image_'.$i ] ) ) {
|
160 |
echo '<div class="media_pr">'.PHP_EOL;
|
161 |
+
echo '<img class="pr_image" src="'.esc_url( $instance[ 'media_image_'.$i ] ).'" alt="'.esc_attr( $instance[ 'media_alt_'.$i ] ).'" />'.PHP_EOL.'</div><!--//.media_pr -->'.PHP_EOL;
|
162 |
}
|
163 |
// title text
|
164 |
echo '<h1 class="prBox_title">';
|
165 |
+
if ( isset( $instance[ 'label_'.$i ] ) && $instance[ 'label_'.$i ] ) {
|
166 |
+
echo $instance[ 'label_'.$i ];
|
167 |
} else {
|
168 |
+
_e( 'PR Block', 'vkExUnit' );
|
169 |
}
|
170 |
echo '</h1>'.PHP_EOL;
|
171 |
// summary text
|
172 |
+
if ( ! empty( $instance[ 'summary_'.$i ] ) ) {
|
173 |
+
echo '<p class="summary">'.nl2br( esc_attr( $instance[ 'summary_'.$i ] ) ).'</p>'.PHP_EOL;
|
174 |
}
|
175 |
+
if ( ! empty( $instance[ 'linkurl_'.$i ] ) ) {
|
176 |
echo '</a>'.PHP_EOL;
|
177 |
}
|
178 |
|
184 |
echo '</div>' . $args['after_widget'] . PHP_EOL . '<!-- //.pr_blocks -->';
|
185 |
}
|
186 |
}
|
187 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_vkExUnit_PR_Blocks");' ) );
|
188 |
|
189 |
// uploader js
|
190 |
add_action( 'admin_print_scripts', 'admin_scripts_pr_media' );
|
197 |
// color picker js
|
198 |
add_action( 'admin_enqueue_scripts', 'admin_scripts_pr_color' );
|
199 |
function admin_scripts_pr_color() {
|
200 |
+
wp_enqueue_style( 'wp-color-picker' );
|
201 |
+
wp_enqueue_script( 'wp-color-picker' );
|
202 |
}
|
203 |
|
204 |
add_action( 'admin_footer-widgets.php', 'print_scripts_pr_color' );
|
205 |
+
function print_scripts_pr_color() {
|
206 |
+
?>
|
207 |
<script type="text/javascript">
|
208 |
(function($){
|
209 |
+
function initColorPicker(widget) {
|
210 |
+
widget.find( '.color_picker' ).wpColorPicker( {
|
211 |
+
change: _.throttle( function() {
|
212 |
+
$(this).trigger('change');
|
213 |
+
}, 3000 )
|
214 |
+
});
|
215 |
+
}
|
216 |
+
|
217 |
+
function onFormUpdate(event, widget) {
|
218 |
+
initColorPicker(widget);
|
219 |
+
}
|
220 |
+
$(document).on('widget-added widget-updated', onFormUpdate );
|
221 |
+
$(document).ready( function() {
|
222 |
+
$('#widgets-right .widget:has(.color_picker)').each( function () {
|
223 |
+
initColorPicker( $(this) );
|
224 |
+
});
|
225 |
+
});
|
226 |
}(jQuery));
|
227 |
</script>
|
228 |
<?php }
|
229 |
|
230 |
// PR blocks admin CSS
|
231 |
+
add_action( 'admin_print_styles-widgets.php', 'style_prBlocks' );
|
232 |
function style_prBlocks() {
|
233 |
+
echo '<style>.media.image_pr{ max-height: 170px; }
|
234 |
.media_img{ max-width: 100%; height: auto; position: relative; z-index: 999;}</style>'.PHP_EOL;
|
235 |
+
}
|
plugins/other_widget/widget-profile.php
CHANGED
@@ -1,12 +1,12 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_profile extends WP_Widget {
|
7 |
|
8 |
function __construct() {
|
9 |
-
$widget_name = vkExUnit_get_short_name(). '_' . __(
|
10 |
|
11 |
parent::__construct(
|
12 |
'WP_Widget_vkExUnit_profile',
|
@@ -15,103 +15,103 @@ class WP_Widget_vkExUnit_profile extends WP_Widget {
|
|
15 |
);
|
16 |
}
|
17 |
|
18 |
-
function form($instance){
|
19 |
$defaults = array(
|
20 |
-
'label' => __('Profile', 'vkExUnit' ),
|
21 |
'mediaFile' => '',
|
22 |
'mediaAlt' => '',
|
23 |
'mediaAlign_left' => '',
|
24 |
'mediaRound' => '',
|
25 |
'mediaSize' => '',
|
26 |
'mediaFloat' => '',
|
27 |
-
'profile' => __('Profile Text', 'vkExUnit' ),
|
28 |
'facebook' => '',
|
29 |
'twitter' => '',
|
30 |
'mail' => '',
|
31 |
'youtube' => '',
|
32 |
'rss' => '',
|
33 |
'instagram' => '',
|
34 |
-
'linkedin' => ''
|
35 |
);
|
36 |
-
$instance = wp_parse_args((array) $instance, $defaults);
|
37 |
-
|
38 |
|
39 |
<?php //title ?>
|
40 |
-
<p><label for="<?php echo $this->get_field_id('label'); ?>"><?php _e('Title:', 'vkExUnit'); ?></label><br/>
|
41 |
-
<input type="text" id="<?php echo $this->get_field_id('label'); ?>_title" class="prof_input" name="<?php echo $this->get_field_name('label'); ?>" value="<?php echo $instance['label']; ?>" />
|
42 |
</p>
|
43 |
|
44 |
<?php //media uploader ?>
|
45 |
-
<p><label for="<?php echo $this->get_field_id('profile'); ?>"><?php _e('Select Profile image:', 'vkExUnit'); ?></label><br/>
|
46 |
-
<input type="hidden" class="media_url" id="<?php echo $this->get_field_id('mediaFile'); ?>_media" name="<?php echo $this->get_field_name('mediaFile'); ?>" value="<?php echo esc_attr($instance['mediaFile']); ?>" />
|
47 |
-
<input type="hidden" class="media_alt" id="<?php echo $this->get_field_id('mediaAlt'); ?>_media" name="<?php echo $this->get_field_name('mediaAlt'); ?>" value="<?php echo esc_attr($instance['mediaAlt']); ?>" />
|
48 |
-
<input type="button" class="media_select" value="<?php _e('Select image', 'vkExUnit'); ?>" onclick="clickSelect(event.target);" />
|
49 |
-
<input type="button" class="media_clear" value="<?php _e('Clear image', 'vkExUnit'); ?>" onclick="clickClear(event.target);" />
|
50 |
</p>
|
51 |
<div class="media">
|
52 |
-
<?php if(!empty($instance['mediaFile'])):
|
53 |
-
<img class="media_image" src="<?php echo esc_url($instance['mediaFile']); ?>" alt="<?php echo esc_attr($instance['mediaAlt']); ?>" />
|
54 |
<?php endif; ?>
|
55 |
</div>
|
56 |
|
57 |
<?php //image round setting ?>
|
58 |
-
<p><input type="checkbox" id="<?php echo $this->get_field_id('mediaRound'); ?>_round" name="<?php echo $this->get_field_name('mediaRound'); ?>" value="true" <?php echo ($instance['mediaRound'])? 'checked': '' ; ?> ><label for="<?php echo $this->get_field_id('mediaRound'); ?>"><?php _e('Cut out round the image.', 'vkExUnit'); ?></label>
|
59 |
</p>
|
60 |
|
61 |
<?php //image size setting ?>
|
62 |
-
<p><label for="<?php echo $this->get_field_id('mediaSize'); ?>"><?php _e('Media size (Optional)', 'vkExUnit'); ?></label><br/>
|
63 |
-
<input type="text" id="<?php echo $this->get_field_id('mediaSize'); ?>_size" class="prof_input" name="<?php echo $this->get_field_name('mediaSize'); ?>" style="width:50px;" value="<?php echo $instance['mediaSize']; ?>" /> px
|
64 |
</p>
|
65 |
|
66 |
<?php //image mediaAlign_left setting ?>
|
67 |
-
<p><input type="checkbox" id="<?php echo $this->get_field_id('mediaAlign_left'); ?>_round" name="<?php echo $this->get_field_name('mediaAlign_left'); ?>" value="true" <?php echo ($instance['mediaAlign_left'])? 'checked': '' ; ?> ><label for="<?php echo $this->get_field_id('mediaAlign_left'); ?>"><?php _e('Image align left', 'vkExUnit'); ?></label>
|
68 |
</p>
|
69 |
|
70 |
<?php //image float setting ?>
|
71 |
-
<p><input type="checkbox" id="<?php echo $this->get_field_id('mediaFloat'); ?>_float" name="<?php echo $this->get_field_name('mediaFloat'); ?>" value="true" <?php echo ($instance['mediaFloat'])? 'checked': '' ; ?> ><label for="<?php echo $this->get_field_id('mediaFloat'); ?>"><?php _e('Text float to image.', 'vkExUnit'); ?></label><br/>
|
72 |
</p>
|
73 |
|
74 |
<?php //profile text ?>
|
75 |
-
<p><label for="<?php echo $this->get_field_id('profile'); ?>"><?php _e('Profile Text:', 'vkExUnit'); ?></label></p>
|
76 |
-
<textarea rows="4" cols="40" id="<?php echo $this->get_field_id('profile'); ?>_text" class="prof_input textarea" name="<?php echo $this->get_field_name('profile'); ?>"><?php echo $instance['profile']; ?></textarea>
|
77 |
|
78 |
<?php //facebook_URL ?>
|
79 |
-
<p><label for="<?php echo $this->get_field_id('facebook'); ?>"><?php _e('Facebook URL:', 'vkExUnit'); ?></label><br/>
|
80 |
-
<input type="text" id="<?php echo $this->get_field_id('facebook'); ?>_url" class="prof_input" name="<?php echo $this->get_field_name('facebook'); ?>" value="<?php echo $instance['facebook']; ?>" />
|
81 |
</p>
|
82 |
|
83 |
<?php //twitter_URL ?>
|
84 |
-
<p><label for="<?php echo $this->get_field_id('twitter'); ?>"><?php _e('Twitter URL:', 'vkExUnit'); ?></label><br/>
|
85 |
-
<input type="text" id="<?php echo $this->get_field_id('twitter'); ?>_url" class="prof_input" name="<?php echo $this->get_field_name('twitter'); ?>" value="<?php echo $instance['twitter']; ?>" />
|
86 |
</p>
|
87 |
|
88 |
<?php //mail_URL ?>
|
89 |
-
<p><label for="<?php echo $this->get_field_id('mail'); ?>"><?php _e('Email Address:', 'vkExUnit'); ?></label><br/>
|
90 |
-
<input type="text" id="<?php echo $this->get_field_id('mail'); ?>_url" class="prof_input" name="<?php echo $this->get_field_name('mail'); ?>" value="<?php echo $instance['mail']; ?>" />
|
91 |
</p>
|
92 |
|
93 |
<?php //youtube_URL ?>
|
94 |
-
<p><label for="<?php echo $this->get_field_id('youtube'); ?>"><?php _e('Youtube URL:', 'vkExUnit'); ?></label><br/>
|
95 |
-
<input type="text" id="<?php echo $this->get_field_id('youtube'); ?>_url" class="prof_input" name="<?php echo $this->get_field_name('youtube'); ?>" value="<?php echo $instance['youtube']; ?>" />
|
96 |
</p>
|
97 |
|
98 |
<?php //rss_URL ?>
|
99 |
-
<p><label for="<?php echo $this->get_field_id('rss'); ?>"><?php _e('RSS URL:', 'vkExUnit'); ?></label><br/>
|
100 |
-
<input type="text" id="<?php echo $this->get_field_id('rss'); ?>_url" class="prof_input" name="<?php echo $this->get_field_name('rss'); ?>" value="<?php echo $instance['rss']; ?>" />
|
101 |
</p>
|
102 |
|
103 |
<?php //instagram_URL ?>
|
104 |
-
<p><label for="<?php echo $this->get_field_id('instagram'); ?>"><?php _e('instagram URL:', 'vkExUnit'); ?></label><br/>
|
105 |
-
<input type="text" id="<?php echo $this->get_field_id('instagram'); ?>_url" class="prof_input" name="<?php echo $this->get_field_name('instagram'); ?>" value="<?php echo $instance['instagram']; ?>" /></p>
|
106 |
|
107 |
<?php //linkedin_URL ?>
|
108 |
-
<p><label for="<?php echo $this->get_field_id('linkedin'); ?>"><?php _e('linkedin URL:', 'vkExUnit'); ?></label><br/>
|
109 |
-
<input type="text" id="<?php echo $this->get_field_id('linkedin'); ?>_url" class="prof_input" name="<?php echo $this->get_field_name('linkedin'); ?>" value="<?php echo $instance['linkedin']; ?>" /></p>
|
110 |
|
111 |
<?php }
|
112 |
|
113 |
|
114 |
-
function update
|
115 |
$instance = $old_instance;
|
116 |
$instance['label'] = $new_instance['label'];
|
117 |
$instance['mediaFile'] = $new_instance['mediaFile'];
|
@@ -132,12 +132,12 @@ class WP_Widget_vkExUnit_profile extends WP_Widget {
|
|
132 |
}
|
133 |
|
134 |
|
135 |
-
function widget($args, $instance) {
|
136 |
// From here Display a widget
|
137 |
echo $args['before_widget'];
|
138 |
echo PHP_EOL.'<div class="veu_profile">'.PHP_EOL;
|
139 |
|
140 |
-
if ( isset($instance['label']) && $instance['label'] ) {
|
141 |
echo $args['before_title'];
|
142 |
echo $instance['label'];
|
143 |
echo $args['after_title'];
|
@@ -145,71 +145,71 @@ class WP_Widget_vkExUnit_profile extends WP_Widget {
|
|
145 |
<div class="profile" >
|
146 |
<?php // Display a profile image
|
147 |
|
148 |
-
$mediaRound = isset($instance['mediaRound']) ? ' media_round' : '' ;
|
149 |
-
$mediaSize = isset($instance['mediaSize']) ? mb_convert_kana($instance['mediaSize']) : '' ;
|
150 |
$mediaClass = '';
|
151 |
|
152 |
-
|
153 |
-
|
154 |
-
|
155 |
-
|
156 |
-
|
157 |
-
|
158 |
|
159 |
echo '<div';
|
160 |
-
|
161 |
-
|
162 |
-
|
163 |
echo '><img class="profile_media';
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
|
173 |
-
|
174 |
-
|
175 |
-
|
176 |
|
177 |
// Display a profile text
|
178 |
-
|
179 |
-
|
180 |
-
|
181 |
|
182 |
// Display a sns botton
|
183 |
-
|
184 |
|
185 |
<ul class="sns_btns">
|
186 |
<?php // Display a facebook botton
|
187 |
-
|
188 |
-
<li class="facebook_btn"><a href="<?php echo esc_url($instance['facebook']); ?>" target="_blank"><i class="fa fa-facebook"></i></a></li>
|
189 |
<?php endif; ?>
|
190 |
<?php // Display a twitter botton
|
191 |
-
|
192 |
-
<li class="twitter_btn"><a href="<?php echo esc_url($instance['twitter']); ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
|
193 |
<?php endif; ?>
|
194 |
<?php // Display a mail botton
|
195 |
-
|
196 |
-
<li class="mail_btn"><a href="<?php echo esc_url($instance['mail']); ?>" target="_blank"><i class="fa fa-envelope"></i></a></li>
|
197 |
<?php endif; ?>
|
198 |
<?php // Display a youtube botton
|
199 |
-
|
200 |
-
<li class="youtube_btn"><a href="<?php echo esc_url($instance['youtube']); ?>" target="_blank"><i class="fa fa-youtube"></i></a></li>
|
201 |
<?php endif; ?>
|
202 |
<?php // Display a RSS botton
|
203 |
-
|
204 |
-
<li class="rss_btn"><a href="<?php echo esc_url($instance['rss']); ?>" target="_blank"><i class="fa fa-rss"></i></a></li>
|
205 |
<?php endif; ?>
|
206 |
<?php // Display a instagram botton
|
207 |
-
|
208 |
-
<li class="instagram_btn"><a href="<?php echo esc_url($instance['instagram']); ?>" target="_blank"><i class="fa fa-instagram"></i></a></li>
|
209 |
<?php endif; ?>
|
210 |
<?php // Display a linkedin botton
|
211 |
-
|
212 |
-
<li class="linkedin_btn"><a href="<?php echo esc_url($instance['linkedin']); ?>" target="_blank"><i class="fa fa-linkedin"></i></a></li>
|
213 |
<?php endif; ?>
|
214 |
</ul>
|
215 |
<?php endif; ?>
|
@@ -219,19 +219,19 @@ class WP_Widget_vkExUnit_profile extends WP_Widget {
|
|
219 |
</div>
|
220 |
<?php }
|
221 |
}
|
222 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_vkExUnit_profile");'));
|
223 |
|
224 |
// Profile widget uploader js
|
225 |
function my_admin_scripts() {
|
226 |
wp_enqueue_media();
|
227 |
-
wp_register_script( 'mediauploader', plugin_dir_url( __FILE__ ) . 'js/widget-prof-uploader.js', array( 'jquery' ), false, true);
|
228 |
wp_enqueue_script( 'mediauploader' );
|
229 |
}
|
230 |
add_action( 'admin_print_scripts', 'my_admin_scripts' );
|
231 |
|
232 |
// Profile widget CSS
|
233 |
function my_admin_style() {
|
234 |
-
echo '<style>.prof_input{ width: 100%;}
|
235 |
.media_select,.media_clear{ padding: 3px; border: none; border-radius: 3px; background: #00a0d2; color: #fff; font-size: 12px; cursor: pointer; outline: none;}
|
236 |
.media_select:hover,.media_clear:hover{ background: #0073aa; }
|
237 |
.media{ position: relative; z-index: 2; overflow: hidden; margin: 3px 0; min-height: 70px; max-height: 200px; width: 100%;
|
@@ -240,4 +240,4 @@ border: 1px dashed #ccc; border-radius: 5px; background-color: rgba(212, 212, 21
|
|
240 |
.media_image{ position: relative; z-index: 3; display: block; width: 100%; height: auto;}
|
241 |
.prof_input.textarea{ margin-top: -1em; }</style>'.PHP_EOL;
|
242 |
}
|
243 |
-
add_action(
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* Side Profile widget
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_vkExUnit_profile extends WP_Widget {
|
7 |
|
8 |
function __construct() {
|
9 |
+
$widget_name = vkExUnit_get_short_name(). '_' . __( 'Profile', 'vkExUnit' );
|
10 |
|
11 |
parent::__construct(
|
12 |
'WP_Widget_vkExUnit_profile',
|
15 |
);
|
16 |
}
|
17 |
|
18 |
+
function form( $instance ) {
|
19 |
$defaults = array(
|
20 |
+
'label' => __( 'Profile', 'vkExUnit' ),
|
21 |
'mediaFile' => '',
|
22 |
'mediaAlt' => '',
|
23 |
'mediaAlign_left' => '',
|
24 |
'mediaRound' => '',
|
25 |
'mediaSize' => '',
|
26 |
'mediaFloat' => '',
|
27 |
+
'profile' => __( 'Profile Text', 'vkExUnit' ),
|
28 |
'facebook' => '',
|
29 |
'twitter' => '',
|
30 |
'mail' => '',
|
31 |
'youtube' => '',
|
32 |
'rss' => '',
|
33 |
'instagram' => '',
|
34 |
+
'linkedin' => '',
|
35 |
);
|
36 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
37 |
+
?>
|
38 |
|
39 |
<?php //title ?>
|
40 |
+
<p><label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
|
41 |
+
<input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>_title" class="prof_input" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" />
|
42 |
</p>
|
43 |
|
44 |
<?php //media uploader ?>
|
45 |
+
<p><label for="<?php echo $this->get_field_id( 'profile' ); ?>"><?php _e( 'Select Profile image:', 'vkExUnit' ); ?></label><br/>
|
46 |
+
<input type="hidden" class="media_url" id="<?php echo $this->get_field_id( 'mediaFile' ); ?>_media" name="<?php echo $this->get_field_name( 'mediaFile' ); ?>" value="<?php echo esc_attr( $instance['mediaFile'] ); ?>" />
|
47 |
+
<input type="hidden" class="media_alt" id="<?php echo $this->get_field_id( 'mediaAlt' ); ?>_media" name="<?php echo $this->get_field_name( 'mediaAlt' ); ?>" value="<?php echo esc_attr( $instance['mediaAlt'] ); ?>" />
|
48 |
+
<input type="button" class="media_select" value="<?php _e( 'Select image', 'vkExUnit' ); ?>" onclick="clickSelect(event.target);" />
|
49 |
+
<input type="button" class="media_clear" value="<?php _e( 'Clear image', 'vkExUnit' ); ?>" onclick="clickClear(event.target);" />
|
50 |
</p>
|
51 |
<div class="media">
|
52 |
+
<?php if ( ! empty( $instance['mediaFile'] ) ) : ?>
|
53 |
+
<img class="media_image" src="<?php echo esc_url( $instance['mediaFile'] ); ?>" alt="<?php echo esc_attr( $instance['mediaAlt'] ); ?>" />
|
54 |
<?php endif; ?>
|
55 |
</div>
|
56 |
|
57 |
<?php //image round setting ?>
|
58 |
+
<p><input type="checkbox" id="<?php echo $this->get_field_id( 'mediaRound' ); ?>_round" name="<?php echo $this->get_field_name( 'mediaRound' ); ?>" value="true" <?php echo ($instance['mediaRound'])? 'checked': '' ; ?> ><label for="<?php echo $this->get_field_id( 'mediaRound' ); ?>"><?php _e( 'Cut out round the image.', 'vkExUnit' ); ?></label>
|
59 |
</p>
|
60 |
|
61 |
<?php //image size setting ?>
|
62 |
+
<p><label for="<?php echo $this->get_field_id( 'mediaSize' ); ?>"><?php _e( 'Media size (Optional)', 'vkExUnit' ); ?></label><br/>
|
63 |
+
<input type="text" id="<?php echo $this->get_field_id( 'mediaSize' ); ?>_size" class="prof_input" name="<?php echo $this->get_field_name( 'mediaSize' ); ?>" style="width:50px;" value="<?php echo $instance['mediaSize']; ?>" /> px
|
64 |
</p>
|
65 |
|
66 |
<?php //image mediaAlign_left setting ?>
|
67 |
+
<p><input type="checkbox" id="<?php echo $this->get_field_id( 'mediaAlign_left' ); ?>_round" name="<?php echo $this->get_field_name( 'mediaAlign_left' ); ?>" value="true" <?php echo ($instance['mediaAlign_left'])? 'checked': '' ; ?> ><label for="<?php echo $this->get_field_id( 'mediaAlign_left' ); ?>"><?php _e( 'Image align left', 'vkExUnit' ); ?></label>
|
68 |
</p>
|
69 |
|
70 |
<?php //image float setting ?>
|
71 |
+
<p><input type="checkbox" id="<?php echo $this->get_field_id( 'mediaFloat' ); ?>_float" name="<?php echo $this->get_field_name( 'mediaFloat' ); ?>" value="true" <?php echo ($instance['mediaFloat'])? 'checked': '' ; ?> ><label for="<?php echo $this->get_field_id( 'mediaFloat' ); ?>"><?php _e( 'Text float to image.', 'vkExUnit' ); ?></label><br/>
|
72 |
</p>
|
73 |
|
74 |
<?php //profile text ?>
|
75 |
+
<p><label for="<?php echo $this->get_field_id( 'profile' ); ?>"><?php _e( 'Profile Text:', 'vkExUnit' ); ?></label></p>
|
76 |
+
<textarea rows="4" cols="40" id="<?php echo $this->get_field_id( 'profile' ); ?>_text" class="prof_input textarea" name="<?php echo $this->get_field_name( 'profile' ); ?>"><?php echo $instance['profile']; ?></textarea>
|
77 |
|
78 |
<?php //facebook_URL ?>
|
79 |
+
<p><label for="<?php echo $this->get_field_id( 'facebook' ); ?>"><?php _e( 'Facebook URL:', 'vkExUnit' ); ?></label><br/>
|
80 |
+
<input type="text" id="<?php echo $this->get_field_id( 'facebook' ); ?>_url" class="prof_input" name="<?php echo $this->get_field_name( 'facebook' ); ?>" value="<?php echo $instance['facebook']; ?>" />
|
81 |
</p>
|
82 |
|
83 |
<?php //twitter_URL ?>
|
84 |
+
<p><label for="<?php echo $this->get_field_id( 'twitter' ); ?>"><?php _e( 'Twitter URL:', 'vkExUnit' ); ?></label><br/>
|
85 |
+
<input type="text" id="<?php echo $this->get_field_id( 'twitter' ); ?>_url" class="prof_input" name="<?php echo $this->get_field_name( 'twitter' ); ?>" value="<?php echo $instance['twitter']; ?>" />
|
86 |
</p>
|
87 |
|
88 |
<?php //mail_URL ?>
|
89 |
+
<p><label for="<?php echo $this->get_field_id( 'mail' ); ?>"><?php _e( 'Email Address:', 'vkExUnit' ); ?></label><br/>
|
90 |
+
<input type="text" id="<?php echo $this->get_field_id( 'mail' ); ?>_url" class="prof_input" name="<?php echo $this->get_field_name( 'mail' ); ?>" value="<?php echo $instance['mail']; ?>" />
|
91 |
</p>
|
92 |
|
93 |
<?php //youtube_URL ?>
|
94 |
+
<p><label for="<?php echo $this->get_field_id( 'youtube' ); ?>"><?php _e( 'Youtube URL:', 'vkExUnit' ); ?></label><br/>
|
95 |
+
<input type="text" id="<?php echo $this->get_field_id( 'youtube' ); ?>_url" class="prof_input" name="<?php echo $this->get_field_name( 'youtube' ); ?>" value="<?php echo $instance['youtube']; ?>" />
|
96 |
</p>
|
97 |
|
98 |
<?php //rss_URL ?>
|
99 |
+
<p><label for="<?php echo $this->get_field_id( 'rss' ); ?>"><?php _e( 'RSS URL:', 'vkExUnit' ); ?></label><br/>
|
100 |
+
<input type="text" id="<?php echo $this->get_field_id( 'rss' ); ?>_url" class="prof_input" name="<?php echo $this->get_field_name( 'rss' ); ?>" value="<?php echo $instance['rss']; ?>" />
|
101 |
</p>
|
102 |
|
103 |
<?php //instagram_URL ?>
|
104 |
+
<p><label for="<?php echo $this->get_field_id( 'instagram' ); ?>"><?php _e( 'instagram URL:', 'vkExUnit' ); ?></label><br/>
|
105 |
+
<input type="text" id="<?php echo $this->get_field_id( 'instagram' ); ?>_url" class="prof_input" name="<?php echo $this->get_field_name( 'instagram' ); ?>" value="<?php echo $instance['instagram']; ?>" /></p>
|
106 |
|
107 |
<?php //linkedin_URL ?>
|
108 |
+
<p><label for="<?php echo $this->get_field_id( 'linkedin' ); ?>"><?php _e( 'linkedin URL:', 'vkExUnit' ); ?></label><br/>
|
109 |
+
<input type="text" id="<?php echo $this->get_field_id( 'linkedin' ); ?>_url" class="prof_input" name="<?php echo $this->get_field_name( 'linkedin' ); ?>" value="<?php echo $instance['linkedin']; ?>" /></p>
|
110 |
|
111 |
<?php }
|
112 |
|
113 |
|
114 |
+
function update( $new_instance, $old_instance ) {
|
115 |
$instance = $old_instance;
|
116 |
$instance['label'] = $new_instance['label'];
|
117 |
$instance['mediaFile'] = $new_instance['mediaFile'];
|
132 |
}
|
133 |
|
134 |
|
135 |
+
function widget( $args, $instance ) {
|
136 |
// From here Display a widget
|
137 |
echo $args['before_widget'];
|
138 |
echo PHP_EOL.'<div class="veu_profile">'.PHP_EOL;
|
139 |
|
140 |
+
if ( isset( $instance['label'] ) && $instance['label'] ) {
|
141 |
echo $args['before_title'];
|
142 |
echo $instance['label'];
|
143 |
echo $args['after_title'];
|
145 |
<div class="profile" >
|
146 |
<?php // Display a profile image
|
147 |
|
148 |
+
$mediaRound = isset( $instance['mediaRound'] ) ? ' media_round' : '' ;
|
149 |
+
$mediaSize = isset( $instance['mediaSize'] ) ? mb_convert_kana( $instance['mediaSize'] ) : '' ;
|
150 |
$mediaClass = '';
|
151 |
|
152 |
+
if ( ! empty( $instance['mediaFloat'] ) ) {
|
153 |
+
$mediaClass .= 'media_float ';
|
154 |
+
}
|
155 |
+
if ( ! empty( $instance['mediaAlign_left'] ) ) {
|
156 |
+
$mediaClass .= 'media_left';
|
157 |
+
}
|
158 |
|
159 |
echo '<div';
|
160 |
+
if ( $mediaClass ) {
|
161 |
+
echo ' class="'.$mediaClass.'"';
|
162 |
+
}
|
163 |
echo '><img class="profile_media';
|
164 |
+
if ( ! empty( $mediaRound ) || ! empty( $mediaSize ) || ! empty( $mediaFloat ) ) {
|
165 |
+
if ( ! empty( $mediaRound ) ) {
|
166 |
+
echo $mediaRound;
|
167 |
+
}
|
168 |
+
echo '" src="'.esc_url( $instance['mediaFile'] ).'"';
|
169 |
+
if ( ! empty( $mediaSize ) ) {
|
170 |
+
echo ' width="'.$mediaSize.'"';
|
171 |
+
}
|
172 |
+
echo ' alt="'.esc_attr( $instance['mediaAlt'] ).'" /></div>'.PHP_EOL;
|
173 |
+
} else {
|
174 |
+
echo '" src="'.esc_url( $instance['mediaFile'] ).'" alt="'.esc_attr( $instance['mediaAlt'] ).'" /></div>'.PHP_EOL;
|
175 |
+
}
|
176 |
|
177 |
// Display a profile text
|
178 |
+
if ( ! empty( $instance['profile'] ) ) {
|
179 |
+
echo '<p class="profile_text">'.nl2br( esc_attr( $instance['profile'] ) ).'</p>'.PHP_EOL;
|
180 |
+
}
|
181 |
|
182 |
// Display a sns botton
|
183 |
+
if ( isset( $instance['facebook'] ) && $instance['facebook'] || isset( $instance['twitter'] ) && $instance['twitter'] || isset( $instance['mail'] ) && $instance['mail'] || isset( $instance['youtube'] ) && $instance['youtube'] || isset( $instance['rss'] ) && $instance['rss'] || isset( $instance['instagram'] ) && $instance['instagram'] || isset( $instance['linkedin'] ) && $instance['linkedin'] ) : ?>
|
184 |
|
185 |
<ul class="sns_btns">
|
186 |
<?php // Display a facebook botton
|
187 |
+
if ( ! empty( $instance['facebook'] ) ) : ?>
|
188 |
+
<li class="facebook_btn"><a href="<?php echo esc_url( $instance['facebook'] ); ?>" target="_blank"><i class="fa fa-facebook"></i></a></li>
|
189 |
<?php endif; ?>
|
190 |
<?php // Display a twitter botton
|
191 |
+
if ( ! empty( $instance['twitter'] ) ) : ?>
|
192 |
+
<li class="twitter_btn"><a href="<?php echo esc_url( $instance['twitter'] ); ?>" target="_blank"><i class="fa fa-twitter"></i></a></li>
|
193 |
<?php endif; ?>
|
194 |
<?php // Display a mail botton
|
195 |
+
if ( ! empty( $instance['mail'] ) ) : ?>
|
196 |
+
<li class="mail_btn"><a href="<?php echo esc_url( $instance['mail'] ); ?>" target="_blank"><i class="fa fa-envelope"></i></a></li>
|
197 |
<?php endif; ?>
|
198 |
<?php // Display a youtube botton
|
199 |
+
if ( ! empty( $instance['youtube'] ) ) : ?>
|
200 |
+
<li class="youtube_btn"><a href="<?php echo esc_url( $instance['youtube'] ); ?>" target="_blank"><i class="fa fa-youtube"></i></a></li>
|
201 |
<?php endif; ?>
|
202 |
<?php // Display a RSS botton
|
203 |
+
if ( ! empty( $instance['rss'] ) ) : ?>
|
204 |
+
<li class="rss_btn"><a href="<?php echo esc_url( $instance['rss'] ); ?>" target="_blank"><i class="fa fa-rss"></i></a></li>
|
205 |
<?php endif; ?>
|
206 |
<?php // Display a instagram botton
|
207 |
+
if ( ! empty( $instance['instagram'] ) ) : ?>
|
208 |
+
<li class="instagram_btn"><a href="<?php echo esc_url( $instance['instagram'] ); ?>" target="_blank"><i class="fa fa-instagram"></i></a></li>
|
209 |
<?php endif; ?>
|
210 |
<?php // Display a linkedin botton
|
211 |
+
if ( ! empty( $instance['linkedin'] ) ) : ?>
|
212 |
+
<li class="linkedin_btn"><a href="<?php echo esc_url( $instance['linkedin'] ); ?>" target="_blank"><i class="fa fa-linkedin"></i></a></li>
|
213 |
<?php endif; ?>
|
214 |
</ul>
|
215 |
<?php endif; ?>
|
219 |
</div>
|
220 |
<?php }
|
221 |
}
|
222 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_vkExUnit_profile");' ) );
|
223 |
|
224 |
// Profile widget uploader js
|
225 |
function my_admin_scripts() {
|
226 |
wp_enqueue_media();
|
227 |
+
wp_register_script( 'mediauploader', plugin_dir_url( __FILE__ ) . 'js/widget-prof-uploader.js', array( 'jquery' ), false, true );
|
228 |
wp_enqueue_script( 'mediauploader' );
|
229 |
}
|
230 |
add_action( 'admin_print_scripts', 'my_admin_scripts' );
|
231 |
|
232 |
// Profile widget CSS
|
233 |
function my_admin_style() {
|
234 |
+
echo '<style>.prof_input{ width: 100%;}
|
235 |
.media_select,.media_clear{ padding: 3px; border: none; border-radius: 3px; background: #00a0d2; color: #fff; font-size: 12px; cursor: pointer; outline: none;}
|
236 |
.media_select:hover,.media_clear:hover{ background: #0073aa; }
|
237 |
.media{ position: relative; z-index: 2; overflow: hidden; margin: 3px 0; min-height: 70px; max-height: 200px; width: 100%;
|
240 |
.media_image{ position: relative; z-index: 3; display: block; width: 100%; height: auto;}
|
241 |
.prof_input.textarea{ margin-top: -1em; }</style>'.PHP_EOL;
|
242 |
}
|
243 |
+
add_action( 'admin_print_styles-widgets.php', 'my_admin_style' );
|
plugins/other_widget/widget-taxonomies.php
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_VK_taxonomy_list extends WP_Widget {
|
7 |
-
|
8 |
function __construct() {
|
9 |
$widget_name = vkExUnit_get_short_name().'_'. __( 'Categories/Custom taxonomies list', 'vkExUnit' );
|
10 |
|
@@ -16,7 +16,7 @@ class WP_Widget_VK_taxonomy_list extends WP_Widget {
|
|
16 |
}
|
17 |
|
18 |
|
19 |
-
function widget($args, $instance) {
|
20 |
$arg = array(
|
21 |
'echo' => 1,
|
22 |
'style' => 'list',
|
@@ -30,18 +30,18 @@ class WP_Widget_VK_taxonomy_list extends WP_Widget {
|
|
30 |
|
31 |
?>
|
32 |
<?php echo $args['before_widget']; ?>
|
33 |
-
|
34 |
<?php echo $args['before_title'] . $instance['label'] . $args['after_title']; ?>
|
35 |
-
|
36 |
-
<?php wp_list_categories($arg); ?>
|
37 |
-
|
38 |
-
|
39 |
<?php echo $args['after_widget']; ?>
|
40 |
<?php
|
41 |
}
|
42 |
|
43 |
|
44 |
-
function form($instance){
|
45 |
$defaults = array(
|
46 |
'tax_name' => 'category',
|
47 |
'label' => __( 'Category', 'vkExUnit' ),
|
@@ -49,55 +49,55 @@ class WP_Widget_VK_taxonomy_list extends WP_Widget {
|
|
49 |
'title' => 'Category',
|
50 |
'_builtin' => false,
|
51 |
);
|
52 |
-
$instance = wp_parse_args((array) $instance, $defaults);
|
53 |
-
$taxs = get_taxonomies( array('public'=> true),'objects');
|
54 |
?>
|
55 |
-
|
56 |
-
<label for="<?php echo $this->get_field_id('label'); ?>"><?php _e( 'Label to display', 'vkExUnit' ); ?></label>
|
57 |
-
<input type="text" id="<?php echo $this->get_field_id('label'); ?>-title" name="<?php echo $this->get_field_name('label'); ?>" value="<?php echo $instance['label']; ?>" ><br/>
|
58 |
-
<input type="hidden" name="<?php echo $this->get_field_name('hide'); ?>" ><br/>
|
59 |
|
60 |
-
<label for="<?php echo $this->get_field_id('tax_name'); ?>"><?php _e('Display page', 'vkExUnit') ?></label>
|
61 |
-
<select name="<?php echo $this->get_field_name('tax_name'); ?>" >
|
62 |
|
63 |
-
<?php foreach($taxs as $tax){
|
64 |
-
<option value="<?php echo $tax->name; ?>" <?php if($instance['tax_name'] == $tax->name) echo 'selected="selected"'; ?> ><?php echo $tax->labels->name; ?></option>
|
65 |
<?php } ?>
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
<?php
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
}
|
75 |
}
|
|
|
76 |
echo 'post_labels["blog"] = "'. __( 'Blog', 'vkExUnit' ) . '";'."\n";
|
77 |
?>
|
78 |
-
var posttype = jQuery("[name=\"<?php echo $this->get_field_name('tax_name'); ?>\"]");
|
79 |
-
var lablfeld = jQuery("[name=\"<?php echo $this->get_field_name('label'); ?>\"]");
|
80 |
-
|
81 |
lablfeld.val(post_labels[posttype.val()]+" <?php _e( 'Archives', 'vkExUnit' ) ?>");
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
<?php
|
86 |
}
|
87 |
|
88 |
|
89 |
-
function update($new_instance, $old_instance){
|
90 |
$instance = $old_instance;
|
91 |
|
92 |
$instance['tax_name'] = $new_instance['tax_name'];
|
93 |
|
94 |
-
if(
|
95 |
$new_instance['label'] = $new_instance['hide'];
|
96 |
}
|
97 |
-
$instance['label'] = esc_html($new_instance['label']);
|
98 |
|
99 |
return $instance;
|
100 |
}
|
101 |
} // class WP_Widget_top_list_info
|
102 |
|
103 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_VK_taxonomy_list");'));
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* Taxonomy list widget
|
5 |
/*-------------------------------------------*/
|
6 |
class WP_Widget_VK_taxonomy_list extends WP_Widget {
|
7 |
+
// ウィジェット定義
|
8 |
function __construct() {
|
9 |
$widget_name = vkExUnit_get_short_name().'_'. __( 'Categories/Custom taxonomies list', 'vkExUnit' );
|
10 |
|
16 |
}
|
17 |
|
18 |
|
19 |
+
function widget( $args, $instance ) {
|
20 |
$arg = array(
|
21 |
'echo' => 1,
|
22 |
'style' => 'list',
|
30 |
|
31 |
?>
|
32 |
<?php echo $args['before_widget']; ?>
|
33 |
+
<div class="sideWidget widget_taxonomies widget_nav_menu">
|
34 |
<?php echo $args['before_title'] . $instance['label'] . $args['after_title']; ?>
|
35 |
+
<ul class="localNavi">
|
36 |
+
<?php wp_list_categories( $arg ); ?>
|
37 |
+
</ul>
|
38 |
+
</div>
|
39 |
<?php echo $args['after_widget']; ?>
|
40 |
<?php
|
41 |
}
|
42 |
|
43 |
|
44 |
+
function form( $instance ) {
|
45 |
$defaults = array(
|
46 |
'tax_name' => 'category',
|
47 |
'label' => __( 'Category', 'vkExUnit' ),
|
49 |
'title' => 'Category',
|
50 |
'_builtin' => false,
|
51 |
);
|
52 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
53 |
+
$taxs = get_taxonomies( array( 'public' => true ),'objects' );
|
54 |
?>
|
55 |
+
<p>
|
56 |
+
<label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Label to display', 'vkExUnit' ); ?></label>
|
57 |
+
<input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" ><br/>
|
58 |
+
<input type="hidden" name="<?php echo $this->get_field_name( 'hide' ); ?>" ><br/>
|
59 |
|
60 |
+
<label for="<?php echo $this->get_field_id( 'tax_name' ); ?>"><?php _e( 'Display page', 'vkExUnit' ) ?></label>
|
61 |
+
<select name="<?php echo $this->get_field_name( 'tax_name' ); ?>" >
|
62 |
|
63 |
+
<?php foreach ( $taxs as $tax ) { ?>
|
64 |
+
<option value="<?php echo $tax->name; ?>" <?php if ( $instance['tax_name'] == $tax->name ) { echo 'selected="selected"'; } ?> ><?php echo $tax->labels->name; ?></option>
|
65 |
<?php } ?>
|
66 |
+
</select></p>
|
67 |
+
<script type="text/javascript">
|
68 |
+
jQuery(document).ready(function($){
|
69 |
+
var post_labels = new Array();
|
70 |
<?php
|
71 |
+
foreach ( $taxs as $tax ) {
|
72 |
+
if ( isset( $tax->labels->name ) ) {
|
73 |
+
echo 'post_labels["'.$tax->name.'"] = "'.$tax->labels->name.'";';
|
|
|
74 |
}
|
75 |
+
}
|
76 |
echo 'post_labels["blog"] = "'. __( 'Blog', 'vkExUnit' ) . '";'."\n";
|
77 |
?>
|
78 |
+
var posttype = jQuery("[name=\"<?php echo $this->get_field_name( 'tax_name' ); ?>\"]");
|
79 |
+
var lablfeld = jQuery("[name=\"<?php echo $this->get_field_name( 'label' ); ?>\"]");
|
80 |
+
posttype.change(function(){
|
81 |
lablfeld.val(post_labels[posttype.val()]+" <?php _e( 'Archives', 'vkExUnit' ) ?>");
|
82 |
+
});
|
83 |
+
});
|
84 |
+
</script>
|
85 |
<?php
|
86 |
}
|
87 |
|
88 |
|
89 |
+
function update( $new_instance, $old_instance ) {
|
90 |
$instance = $old_instance;
|
91 |
|
92 |
$instance['tax_name'] = $new_instance['tax_name'];
|
93 |
|
94 |
+
if ( ! $new_instance['label'] ) {
|
95 |
$new_instance['label'] = $new_instance['hide'];
|
96 |
}
|
97 |
+
$instance['label'] = esc_html( $new_instance['label'] );
|
98 |
|
99 |
return $instance;
|
100 |
}
|
101 |
} // class WP_Widget_top_list_info
|
102 |
|
103 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_VK_taxonomy_list");' ) );
|
plugins/pageList_ancestor.php
CHANGED
@@ -1,98 +1,98 @@
|
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
-
/*
|
4 |
/*-------------------------------------------*/
|
5 |
|
6 |
-
add_shortcode('pageList_ancestor', 'vkExUnit_pageList_ancestor_shortcode');
|
7 |
-
function vkExUnit_pageList_ancestor_shortcode(){
|
8 |
global $post;
|
9 |
-
if( !is_page() || !get_post_meta( $post->ID, 'vkExUnit_pageList_ancestor', true ) ) return;
|
10 |
-
|
11 |
$pageList_ancestor_html = PHP_EOL.'<section class="veu_pageList_ancestor">'.PHP_EOL;
|
12 |
-
|
13 |
-
if( $post->ancestors ){
|
14 |
-
foreach( $post->ancestors as $post_anc_id ){
|
15 |
$post_id = $post_anc_id;
|
16 |
}
|
17 |
} else {
|
18 |
$post_id = $post->ID;
|
19 |
}
|
20 |
-
|
21 |
if ( $post_id ) {
|
22 |
$children = wp_list_pages( 'title_li=&child_of='.$post_id.'&echo=0' );
|
23 |
-
if ( $children ) {
|
24 |
$pageList_ancestor_html .= '<h1 class="section_title subSection-title"><a href="'.get_permalink( $post_id ).'">'.get_the_title( $post_id ).'</a></h1>';
|
25 |
$pageList_ancestor_html .= '<ul class="pageList">';
|
26 |
$pageList_ancestor_html .= $children;
|
27 |
$pageList_ancestor_html .= '</ul>';
|
28 |
$pageList_ancestor_html .= '</section>';
|
29 |
-
}
|
30 |
}
|
31 |
return $pageList_ancestor_html;
|
32 |
}
|
33 |
|
34 |
-
add_filter('the_content', 'vkExUnit_pageList_ancestor_contentHook');
|
35 |
-
function vkExUnit_pageList_ancestor_contentHook( $content ){
|
36 |
|
37 |
global $post;
|
38 |
-
|
39 |
-
if( !is_page() || !get_post_meta( $post->ID, 'vkExUnit_pageList_ancestor',true ) ) return $content;
|
40 |
-
|
41 |
-
if( get_post_meta( $post->ID, 'vkExUnit_pageList_ancestor',true ) ){
|
42 |
$content .= "\n[pageList_ancestor]";
|
43 |
}
|
44 |
return $content;
|
45 |
}
|
46 |
-
add_filter('vkExUnit_customField_Page_activation', 'vkExUnit_pageList_ancestor_activate_meta_box', 10, 1);
|
47 |
-
function vkExUnit_pageList_ancestor_activate_meta_box( $flag ){
|
48 |
return true;
|
49 |
}
|
50 |
|
51 |
// admin screen -------------------------------
|
52 |
|
53 |
-
add_action('vkExUnit_customField_Page_box', 'vkExUnit_pageList_ancestor_meta_box' );
|
54 |
-
add_action('save_post', 'vkExUnit_pageList_ancestor');
|
55 |
|
56 |
function vkExUnit_pageList_ancestor_meta_box() {
|
57 |
global $post;
|
58 |
-
$enable = get_post_meta( $post->ID, 'vkExUnit_pageList_ancestor', true); ?>
|
59 |
|
60 |
-
<div>
|
61 |
-
<input type="hidden" name="_nonce_vkExUnit__custom_field_pageList_ancestor" id="_nonce_vkExUnit__custom_field_pageList_ancestor" value="<?php echo wp_create_nonce(plugin_basename(__FILE__));?>" />
|
62 |
<label for="vkExUnit_pageList_ancestor">
|
63 |
<input type="checkbox" id="vkExUnit_pageList_ancestor" name="vkExUnit_pageList_ancestor"<?php echo ($enable)? ' checked' : ''; ?> />
|
64 |
-
<?php _e('Display a page list from ancestor', 'vkExUnit');?>
|
65 |
</label>
|
66 |
</div>
|
67 |
-
<?php
|
68 |
}
|
69 |
|
70 |
// seve function -------------------------------
|
71 |
|
72 |
function vkExUnit_pageList_ancestor( $post_id ) {
|
73 |
|
74 |
-
$pageList_ancestor = isset($_POST['_nonce_vkExUnit__custom_field_pageList_ancestor']) ? htmlspecialchars($_POST['_nonce_vkExUnit__custom_field_pageList_ancestor']) : null;
|
75 |
|
76 |
-
if( !wp_verify_nonce( $pageList_ancestor, plugin_basename(__FILE__) )){
|
77 |
return $post_id;
|
78 |
}
|
79 |
|
80 |
-
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
if(!current_user_can('edit_page', $post_id)) return $post_id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
}
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
} else if ( $mydata != get_post_meta( $post_id, 'vkExUnit_pageList_ancestor' )) {
|
92 |
-
update_post_meta( $post_id, 'vkExUnit_pageList_ancestor', $mydata ) ;
|
93 |
-
} else if ( "" == $mydata ) {
|
94 |
-
delete_post_meta( $post_id, 'vkExUnit_pageList_ancestor' ) ;
|
95 |
-
}
|
96 |
-
|
97 |
-
do_action('vkExUnit_customField_Page_save_customField');
|
98 |
-
}
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
+
/* pageList_ancestor
|
4 |
/*-------------------------------------------*/
|
5 |
|
6 |
+
add_shortcode( 'pageList_ancestor', 'vkExUnit_pageList_ancestor_shortcode' );
|
7 |
+
function vkExUnit_pageList_ancestor_shortcode() {
|
8 |
global $post;
|
9 |
+
if ( ! is_page() || ! get_post_meta( $post->ID, 'vkExUnit_pageList_ancestor', true ) ) { return; }
|
10 |
+
|
11 |
$pageList_ancestor_html = PHP_EOL.'<section class="veu_pageList_ancestor">'.PHP_EOL;
|
12 |
+
|
13 |
+
if ( $post->ancestors ) {
|
14 |
+
foreach ( $post->ancestors as $post_anc_id ) {
|
15 |
$post_id = $post_anc_id;
|
16 |
}
|
17 |
} else {
|
18 |
$post_id = $post->ID;
|
19 |
}
|
20 |
+
|
21 |
if ( $post_id ) {
|
22 |
$children = wp_list_pages( 'title_li=&child_of='.$post_id.'&echo=0' );
|
23 |
+
if ( $children ) {
|
24 |
$pageList_ancestor_html .= '<h1 class="section_title subSection-title"><a href="'.get_permalink( $post_id ).'">'.get_the_title( $post_id ).'</a></h1>';
|
25 |
$pageList_ancestor_html .= '<ul class="pageList">';
|
26 |
$pageList_ancestor_html .= $children;
|
27 |
$pageList_ancestor_html .= '</ul>';
|
28 |
$pageList_ancestor_html .= '</section>';
|
29 |
+
}
|
30 |
}
|
31 |
return $pageList_ancestor_html;
|
32 |
}
|
33 |
|
34 |
+
add_filter( 'the_content', 'vkExUnit_pageList_ancestor_contentHook' );
|
35 |
+
function vkExUnit_pageList_ancestor_contentHook( $content ) {
|
36 |
|
37 |
global $post;
|
38 |
+
|
39 |
+
if ( ! is_page() || ! get_post_meta( $post->ID, 'vkExUnit_pageList_ancestor',true ) ) { return $content; }
|
40 |
+
|
41 |
+
if ( get_post_meta( $post->ID, 'vkExUnit_pageList_ancestor',true ) ) {
|
42 |
$content .= "\n[pageList_ancestor]";
|
43 |
}
|
44 |
return $content;
|
45 |
}
|
46 |
+
add_filter( 'vkExUnit_customField_Page_activation', 'vkExUnit_pageList_ancestor_activate_meta_box', 10, 1 );
|
47 |
+
function vkExUnit_pageList_ancestor_activate_meta_box( $flag ) {
|
48 |
return true;
|
49 |
}
|
50 |
|
51 |
// admin screen -------------------------------
|
52 |
|
53 |
+
add_action( 'vkExUnit_customField_Page_box', 'vkExUnit_pageList_ancestor_meta_box' );
|
54 |
+
add_action( 'save_post', 'vkExUnit_pageList_ancestor' );
|
55 |
|
56 |
function vkExUnit_pageList_ancestor_meta_box() {
|
57 |
global $post;
|
58 |
+
$enable = get_post_meta( $post->ID, 'vkExUnit_pageList_ancestor', true ); ?>
|
59 |
|
60 |
+
<div>
|
61 |
+
<input type="hidden" name="_nonce_vkExUnit__custom_field_pageList_ancestor" id="_nonce_vkExUnit__custom_field_pageList_ancestor" value="<?php echo wp_create_nonce( plugin_basename( __FILE__ ) );?>" />
|
62 |
<label for="vkExUnit_pageList_ancestor">
|
63 |
<input type="checkbox" id="vkExUnit_pageList_ancestor" name="vkExUnit_pageList_ancestor"<?php echo ($enable)? ' checked' : ''; ?> />
|
64 |
+
<?php _e( 'Display a page list from ancestor', 'vkExUnit' );?>
|
65 |
</label>
|
66 |
</div>
|
67 |
+
<?php
|
68 |
}
|
69 |
|
70 |
// seve function -------------------------------
|
71 |
|
72 |
function vkExUnit_pageList_ancestor( $post_id ) {
|
73 |
|
74 |
+
$pageList_ancestor = isset( $_POST['_nonce_vkExUnit__custom_field_pageList_ancestor'] ) ? htmlspecialchars( $_POST['_nonce_vkExUnit__custom_field_pageList_ancestor'] ) : null;
|
75 |
|
76 |
+
if ( ! wp_verify_nonce( $pageList_ancestor, plugin_basename( __FILE__ ) ) ) {
|
77 |
return $post_id;
|
78 |
}
|
79 |
|
80 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
81 |
+
return $post_id; }
|
82 |
+
|
83 |
+
$mydata = isset( $_POST['vkExUnit_pageList_ancestor'] ) ? htmlspecialchars( $_POST['vkExUnit_pageList_ancestor'] ) : null;
|
84 |
+
|
85 |
+
if ( 'page' == $mydata ) {
|
86 |
+
if ( ! current_user_can( 'edit_page', $post_id ) ) { return $post_id; }
|
87 |
+
}
|
88 |
+
|
89 |
+
if ( '' == get_post_meta( $post_id, 'vkExUnit_pageList_ancestor' ) ) {
|
90 |
+
add_post_meta( $post_id, 'vkExUnit_pageList_ancestor', $mydata, true );
|
91 |
+
} else if ( $mydata != get_post_meta( $post_id, 'vkExUnit_pageList_ancestor' ) ) {
|
92 |
+
update_post_meta( $post_id, 'vkExUnit_pageList_ancestor', $mydata );
|
93 |
+
} else if ( '' == $mydata ) {
|
94 |
+
delete_post_meta( $post_id, 'vkExUnit_pageList_ancestor' );
|
95 |
}
|
96 |
+
|
97 |
+
do_action( 'vkExUnit_customField_Page_save_customField' );
|
98 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
plugins/page_custom_field.php
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
-
add_action('admin_menu', 'vkExUnit_add_custom_field_pageOption' );
|
7 |
|
8 |
// add meta_box
|
9 |
function vkExUnit_add_custom_field_pageOption() {
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
}
|
14 |
|
15 |
// display a meta_box
|
16 |
-
function vkExUnit_pageOption_box(){
|
17 |
-
|
18 |
-
}
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* add page custom field
|
5 |
/*-------------------------------------------*/
|
6 |
+
add_action( 'admin_menu', 'vkExUnit_add_custom_field_pageOption' );
|
7 |
|
8 |
// add meta_box
|
9 |
function vkExUnit_add_custom_field_pageOption() {
|
10 |
+
if ( apply_filters( 'vkExUnit_customField_Page_activation', false ) ) {
|
11 |
+
add_meta_box( 'pageOption', __( 'Setting of insert items', 'vkExUnit' ), 'vkExUnit_pageOption_box', 'page', 'normal', 'high' );
|
12 |
+
}
|
13 |
}
|
14 |
|
15 |
// display a meta_box
|
16 |
+
function vkExUnit_pageOption_box() {
|
17 |
+
do_action( 'vkExUnit_customField_Page_box' );
|
18 |
+
}
|
plugins/related_posts/related_posts.php
CHANGED
@@ -1,48 +1,52 @@
|
|
1 |
<?php
|
2 |
add_filter( 'the_content', 'vkExUnit_add_relatedPosts' , 800 , 1 );
|
3 |
|
4 |
-
function vkExUnit_add_relatedPosts( $content ){
|
5 |
/*-------------------------------------------*/
|
6 |
-
/*
|
7 |
/*-------------------------------------------*/
|
8 |
|
9 |
$max_show_posts = 10;
|
10 |
-
$border_of_and_to_in = 10;
|
11 |
|
12 |
$args_base = array(
|
13 |
'posts_per_page' => $max_show_posts,
|
14 |
'offset' => 0,
|
15 |
'orderby' => 'date',
|
16 |
'order' => 'DESC',
|
17 |
-
'post__not_in' => array(get_the_id()),
|
18 |
'post_type' => 'post',
|
19 |
'post_status' => 'publish',
|
20 |
-
'suppress_filters' => true
|
21 |
);
|
22 |
|
23 |
-
if ( !is_single() || get_post_type() != 'post' ) return $content;
|
24 |
|
25 |
global $is_pagewidget;
|
26 |
-
if( $is_pagewidget ) return $content;
|
27 |
|
28 |
$mytags = get_the_tags();
|
29 |
|
30 |
-
if(
|
31 |
-
|
32 |
|
33 |
$tags = array();
|
34 |
-
foreach( $mytags as $t ) $tags[] = $t->term_id;
|
35 |
|
36 |
$args = $args_base;
|
37 |
$args['tag__and'] = $tags;
|
38 |
|
39 |
$posts_array = get_posts( $args );
|
|
|
40 |
|
41 |
-
|
|
|
42 |
$args = $args_base;
|
|
|
|
|
43 |
$args['tag__in'] = $tags;
|
44 |
-
$
|
|
|
45 |
}
|
|
|
46 |
$tag_posts = $posts_array;
|
47 |
|
48 |
// $posts_count = mb_convert_kana($relatedPostCount, "a", "UTF-8");
|
@@ -50,22 +54,22 @@ function vkExUnit_add_relatedPosts( $content ){
|
|
50 |
if ( $tag_posts ) {
|
51 |
$relatedPostsHtml = '<!-- [ .relatedPosts ] -->';
|
52 |
$relatedPostsHtml .= '<aside class="veu_relatedPosts subSection veu_contentAddSection">';
|
53 |
-
$relatedPostsHtml .= '<h1 class="mainSection-title">'.__('Related posts','vkExUnit').'</h1>';
|
54 |
$i = 1;
|
55 |
$relatedPostsHtml .= '<div class="row">';
|
56 |
-
foreach ($tag_posts as $key => $post) {
|
57 |
$relatedPostsHtml .= '<div class="col-sm-6 relatedPosts_item">';
|
58 |
$relatedPostsHtml .= '<div class="media">';
|
59 |
-
if ( has_post_thumbnail($post->ID)) :
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
endif;
|
66 |
$relatedPostsHtml .= '<div class="media-body">';
|
67 |
-
$relatedPostsHtml .= '<div class="media-heading"><a href="'.get_the_permalink($post->ID).'">'.$post->post_title.'</a></div>';
|
68 |
-
$relatedPostsHtml .= '<div><i class="fa fa-calendar"></i> '.get_the_date(false , $post->ID).'</div>';
|
69 |
$relatedPostsHtml .= '</div>';
|
70 |
$relatedPostsHtml .= '</div>';
|
71 |
$relatedPostsHtml .= '</div>'."\n";
|
@@ -79,4 +83,4 @@ function vkExUnit_add_relatedPosts( $content ){
|
|
79 |
wp_reset_postdata();
|
80 |
|
81 |
return $content;
|
82 |
-
}
|
1 |
<?php
|
2 |
add_filter( 'the_content', 'vkExUnit_add_relatedPosts' , 800 , 1 );
|
3 |
|
4 |
+
function vkExUnit_add_relatedPosts( $content ) {
|
5 |
/*-------------------------------------------*/
|
6 |
+
/* Related posts
|
7 |
/*-------------------------------------------*/
|
8 |
|
9 |
$max_show_posts = 10;
|
|
|
10 |
|
11 |
$args_base = array(
|
12 |
'posts_per_page' => $max_show_posts,
|
13 |
'offset' => 0,
|
14 |
'orderby' => 'date',
|
15 |
'order' => 'DESC',
|
16 |
+
'post__not_in' => array( get_the_id() ),
|
17 |
'post_type' => 'post',
|
18 |
'post_status' => 'publish',
|
19 |
+
'suppress_filters' => true,
|
20 |
);
|
21 |
|
22 |
+
if ( ! is_single() || get_post_type() != 'post' ) { return $content; }
|
23 |
|
24 |
global $is_pagewidget;
|
25 |
+
if ( $is_pagewidget ) { return $content; }
|
26 |
|
27 |
$mytags = get_the_tags();
|
28 |
|
29 |
+
if ( ! $mytags || ! is_array( $mytags ) ) { return $content; }
|
|
|
30 |
|
31 |
$tags = array();
|
32 |
+
foreach ( $mytags as $t ) { $tags[] = $t->term_id; }
|
33 |
|
34 |
$args = $args_base;
|
35 |
$args['tag__and'] = $tags;
|
36 |
|
37 |
$posts_array = get_posts( $args );
|
38 |
+
if ( !is_array( $posts_array ) ) { $posts_array = array(); }
|
39 |
|
40 |
+
$post_shortage = $max_show_posts - count( $posts_array );
|
41 |
+
if ( $post_shortage > 0 ) {
|
42 |
$args = $args_base;
|
43 |
+
$args['posts_per_page'] = $post_shortage;
|
44 |
+
foreach ( $posts_array as $post ) { $args['post__not_in'][] = $post->ID; }
|
45 |
$args['tag__in'] = $tags;
|
46 |
+
$singletags = get_posts( $args );
|
47 |
+
if ( is_array( $singletags ) && count( $singletags ) ) { $posts_array = array_merge( $posts_array, $singletags ); }
|
48 |
}
|
49 |
+
|
50 |
$tag_posts = $posts_array;
|
51 |
|
52 |
// $posts_count = mb_convert_kana($relatedPostCount, "a", "UTF-8");
|
54 |
if ( $tag_posts ) {
|
55 |
$relatedPostsHtml = '<!-- [ .relatedPosts ] -->';
|
56 |
$relatedPostsHtml .= '<aside class="veu_relatedPosts subSection veu_contentAddSection">';
|
57 |
+
$relatedPostsHtml .= '<h1 class="mainSection-title">'.__( 'Related posts','vkExUnit' ).'</h1>';
|
58 |
$i = 1;
|
59 |
$relatedPostsHtml .= '<div class="row">';
|
60 |
+
foreach ( $tag_posts as $key => $post ) {
|
61 |
$relatedPostsHtml .= '<div class="col-sm-6 relatedPosts_item">';
|
62 |
$relatedPostsHtml .= '<div class="media">';
|
63 |
+
if ( has_post_thumbnail( $post->ID ) ) :
|
64 |
+
$relatedPostsHtml .= '<div class="media-left postList_thumbnail">';
|
65 |
+
$relatedPostsHtml .= '<a href="'.get_the_permalink( $post->ID ).'">';
|
66 |
+
$relatedPostsHtml .= get_the_post_thumbnail( $post->ID,'thumbnail' );
|
67 |
+
$relatedPostsHtml .= '</a>';
|
68 |
+
$relatedPostsHtml .= '</div>';
|
69 |
endif;
|
70 |
$relatedPostsHtml .= '<div class="media-body">';
|
71 |
+
$relatedPostsHtml .= '<div class="media-heading"><a href="'.get_the_permalink( $post->ID ).'">'.$post->post_title.'</a></div>';
|
72 |
+
$relatedPostsHtml .= '<div><i class="fa fa-calendar"></i> '.get_the_date( false , $post->ID ).'</div>';
|
73 |
$relatedPostsHtml .= '</div>';
|
74 |
$relatedPostsHtml .= '</div>';
|
75 |
$relatedPostsHtml .= '</div>'."\n";
|
83 |
wp_reset_postdata();
|
84 |
|
85 |
return $content;
|
86 |
+
}
|
plugins/sitemap_page/sitemap_admin.php
CHANGED
@@ -2,21 +2,21 @@
|
|
2 |
$options = vkExUnit_get_sitemap_options();
|
3 |
// $options_default = vkExUnit_get_sns_options_default();
|
4 |
/*-------------------------------------------*/
|
5 |
-
/*
|
6 |
/*-------------------------------------------*/
|
7 |
?>
|
8 |
<div id="sitemapSetting" class="sectionBox">
|
9 |
-
<h3><?php _e('HTML Sitemap Settings', 'vkExUnit'); ?></h3>
|
10 |
<table class="form-table">
|
11 |
<!-- sitemap -->
|
12 |
<tr>
|
13 |
-
<th><?php _e('Exclude page Settings', 'vkExUnit'); ?></th>
|
14 |
<td>
|
15 |
-
<?php _e('Input you want to exclude page id.', 'vkExUnit'); ?><br />
|
16 |
<p><input type="text" name="vkExUnit_sitemap_options[excludeId]" id="excludeId" value="<?php echo esc_attr( $options['excludeId'] ); ?>" style="width:50%;" /></p>
|
17 |
-
<?php _e('* Please enter separated by ","(commas) if there is more than one page ID that you want to exclude.', 'vkExUnit'); ?>
|
18 |
</td>
|
19 |
</tr>
|
20 |
</table>
|
21 |
<?php submit_button(); ?>
|
22 |
-
</div>
|
2 |
$options = vkExUnit_get_sitemap_options();
|
3 |
// $options_default = vkExUnit_get_sns_options_default();
|
4 |
/*-------------------------------------------*/
|
5 |
+
/* sitemap page
|
6 |
/*-------------------------------------------*/
|
7 |
?>
|
8 |
<div id="sitemapSetting" class="sectionBox">
|
9 |
+
<h3><?php _e( 'HTML Sitemap Settings', 'vkExUnit' ); ?></h3>
|
10 |
<table class="form-table">
|
11 |
<!-- sitemap -->
|
12 |
<tr>
|
13 |
+
<th><?php _e( 'Exclude page Settings', 'vkExUnit' ); ?></th>
|
14 |
<td>
|
15 |
+
<?php _e( 'Input you want to exclude page id.', 'vkExUnit' ); ?><br />
|
16 |
<p><input type="text" name="vkExUnit_sitemap_options[excludeId]" id="excludeId" value="<?php echo esc_attr( $options['excludeId'] ); ?>" style="width:50%;" /></p>
|
17 |
+
<?php _e( '* Please enter separated by ","(commas) if there is more than one page ID that you want to exclude.', 'vkExUnit' ); ?>
|
18 |
</td>
|
19 |
</tr>
|
20 |
</table>
|
21 |
<?php submit_button(); ?>
|
22 |
+
</div>
|
plugins/sitemap_page/sitemap_page.php
CHANGED
@@ -1,34 +1,34 @@
|
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
-
/*
|
5 |
/*-------------------------------------------*/
|
6 |
-
/*
|
7 |
/*-------------------------------------------*/
|
8 |
-
/*
|
9 |
/*-------------------------------------------*/
|
10 |
-
/*
|
11 |
/*-------------------------------------------*/
|
12 |
-
/*
|
13 |
/*-------------------------------------------*/
|
14 |
|
15 |
|
16 |
/*-------------------------------------------*/
|
17 |
-
/*
|
18 |
/*-------------------------------------------*/
|
19 |
|
20 |
-
function vkExUnit_add_sitemap_options_page(){
|
21 |
require dirname( __FILE__ ) . '/sitemap_admin.php';
|
22 |
}
|
23 |
/*-------------------------------------------*/
|
24 |
-
/*
|
25 |
/*-------------------------------------------*/
|
26 |
function vkExUnit_sitemap_options_init() {
|
27 |
-
if ( false === vkExUnit_get_sitemap_options() )
|
28 |
-
add_option( 'vkExUnit_sitemap_options', vkExUnit_get_sitemap_options_default() );
|
29 |
|
30 |
vkExUnit_register_setting(
|
31 |
-
__('HTML Sitemap', 'vkExUnit'),
|
32 |
'vkExUnit_sitemap_options',
|
33 |
'vkExUnit_sitemap_options_validate',
|
34 |
'vkExUnit_add_sitemap_options_page'
|
@@ -39,61 +39,61 @@ add_action( 'admin_init', 'vkExUnit_sitemap_options_init' );
|
|
39 |
function vkExUnit_get_sitemap_options() {
|
40 |
$options = get_option( 'vkExUnit_sitemap_options', vkExUnit_get_sitemap_options_default() );
|
41 |
$options_dafault = vkExUnit_get_sitemap_options_default();
|
42 |
-
foreach ($options_dafault as $key => $value) {
|
43 |
-
$options[$key] = (isset($options[$key])) ? $options[$key] : $options_dafault[$key];
|
44 |
}
|
45 |
return apply_filters( 'vkExUnit_sitemap_options', $options );
|
46 |
}
|
47 |
|
48 |
function vkExUnit_get_sitemap_options_default() {
|
49 |
$default_options = array(
|
50 |
-
'excludeId' => ''
|
51 |
);
|
52 |
return apply_filters( 'vkExUnit_sitemap_options_default', $default_options );
|
53 |
}
|
54 |
|
55 |
/*-------------------------------------------*/
|
56 |
-
/*
|
57 |
/*-------------------------------------------*/
|
58 |
function vkExUnit_sitemap_options_validate( $input ) {
|
59 |
$output = $defaults = vkExUnit_get_sitemap_options_default();
|
60 |
|
61 |
$paras = array( 'excludeId' );
|
62 |
|
63 |
-
foreach ($paras as $key => $value) {
|
64 |
-
$output[$value] = (isset($input[$value])) ? $input[$value] : '';
|
65 |
}
|
66 |
return apply_filters( 'vkExUnit_sitemap_options_validate', $output, $input, $defaults );
|
67 |
}
|
68 |
|
69 |
/*-------------------------------------------*/
|
70 |
-
/*
|
71 |
/*-------------------------------------------*/
|
72 |
-
add_filter('the_content', 'show_sitemap', 7, 1);
|
73 |
|
74 |
-
function show_sitemap($content) {
|
75 |
global $is_pagewidget;
|
76 |
-
if( $is_pagewidget ) return $content;
|
77 |
wp_reset_postdata(); // need under other section / ex:child page index
|
78 |
global $post;
|
79 |
$enable = get_post_meta( $post->ID, 'vkExUnit_sitemap',true );
|
80 |
-
if($enable){
|
81 |
-
return $content . "\n" . do_shortcode('[vkExUnit_sitemap]');
|
82 |
}
|
83 |
return $content;
|
84 |
}
|
85 |
|
86 |
-
function vkExUnit_sitemap($atts) {
|
87 |
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
|
92 |
$sitemap_html = '<div class="row veu_sitemap">'.PHP_EOL;
|
93 |
$options = vkExUnit_get_sitemap_options();
|
94 |
-
$exclude = esc_attr($options['excludeId']);
|
95 |
-
$exclude = str_replace(',',',',$exclude);
|
96 |
-
$exclude = mb_convert_kana($exclude, 'kvrn');
|
97 |
|
98 |
/*-------------------------------------------*/
|
99 |
/* pages
|
@@ -103,9 +103,9 @@ function vkExUnit_sitemap($atts) {
|
|
103 |
$args = array(
|
104 |
'title_li' => '',
|
105 |
'echo' => 0,
|
106 |
-
'exclude_tree' => $exclude
|
107 |
);
|
108 |
-
$sitemap_html .= wp_list_pages($args);
|
109 |
|
110 |
$sitemap_html .= '</ul><!-- [ /.link-list ] -->'.PHP_EOL;
|
111 |
$sitemap_html .= '</div><!-- [ /.sitemap-col ] -->'.PHP_EOL;
|
@@ -116,43 +116,42 @@ function vkExUnit_sitemap($atts) {
|
|
116 |
$sitemap_html .= '<div class="col-md-6 sitemap-col">'.PHP_EOL;
|
117 |
|
118 |
$page_for_posts = vkExUnit_get_page_for_posts();
|
119 |
-
$allPostTypes = get_post_types(
|
120 |
|
121 |
-
foreach ($allPostTypes as $postType) {
|
122 |
-
$post_type_object = get_post_type_object($postType);
|
123 |
|
124 |
-
if($post_type_object){
|
125 |
-
$postType_name = esc_html($post_type_object->name);
|
126 |
// post-type is post
|
127 |
-
if($postType_name === 'post'){
|
128 |
|
129 |
-
$postTypes = array('post');
|
130 |
$taxonomies = get_taxonomies();
|
131 |
// Loop all post types
|
132 |
-
foreach ($postTypes as $key => $postType) {
|
133 |
|
134 |
$sitemap_html .= '<div class="sectionBox">'.PHP_EOL;
|
135 |
-
$post_type_object = get_post_type_object($postType);
|
136 |
-
if($post_type_object){
|
137 |
|
138 |
// Post type name
|
139 |
-
if ( $postType == 'post' && $page_for_posts['post_top_use'] ){
|
140 |
$postTypeName = $page_for_posts['post_top_name'];
|
141 |
-
$postTypeTopUrl = get_the_permalink($page_for_posts['post_top_id']);
|
142 |
} else {
|
143 |
$postTypeName = $post_type_object->labels->name;
|
144 |
$postTypeTopUrl = home_url().'/?post_type='.$postType;
|
145 |
}
|
146 |
-
$sitemap_html .= '<h4><a href="'.$postTypeTopUrl.'">'.esc_html($postTypeName).'</a></h4>'.PHP_EOL;
|
147 |
-
|
148 |
|
149 |
// Loop for all taxonomies
|
150 |
-
foreach ($taxonomies as $key => $taxonomy) {
|
151 |
$taxonomy_info = get_taxonomy( $taxonomy );
|
152 |
|
153 |
// Get tax related post type
|
154 |
$taxonomy_postType = $taxonomy_info->object_type[0];
|
155 |
-
if ( $taxonomy_postType == $postType && ( $taxonomy_info->name != 'post_format')){
|
156 |
$sitemap_html .= '<h5>'.$taxonomy_info->labels->name.'</h5>'.PHP_EOL;
|
157 |
$sitemap_html .= '<ul class="link-list">'.PHP_EOL;
|
158 |
$args = array(
|
@@ -162,21 +161,21 @@ function vkExUnit_sitemap($atts) {
|
|
162 |
'echo' => 0,
|
163 |
'show_option_none' => '',
|
164 |
);
|
165 |
-
|
166 |
-
|
167 |
}
|
168 |
}
|
169 |
} // end if($post_type_object)
|
170 |
} // end foreach ($postTypes as $key => $postType)
|
171 |
} // end post-type is post
|
172 |
// not page_type and post_type
|
173 |
-
else if($postType_name !== 'page' && $postType_name !== 'attachment'){
|
174 |
$customPost_url = home_url().'/?post_type='.$postType_name;
|
175 |
$sitemap_html .= '<h4><a href="'.$customPost_url.'">'.$post_type_object->labels->name.'</a></h4>'.PHP_EOL;
|
176 |
|
177 |
-
$termNames = get_object_taxonomies($postType_name);
|
178 |
|
179 |
-
foreach ($termNames as $termName) {
|
180 |
$termDate = get_taxonomy( $termName );
|
181 |
$sitemap_html .= '<h5>'.$termDate->label.'</h5>'.PHP_EOL;
|
182 |
$sitemap_html .= '<ul class="link-list">'.PHP_EOL;
|
@@ -185,10 +184,10 @@ function vkExUnit_sitemap($atts) {
|
|
185 |
'title_li' => '',
|
186 |
'orderby' => 'order',
|
187 |
'echo' => 0,
|
188 |
-
'show_option_none' => ''
|
189 |
);
|
190 |
-
|
191 |
-
|
192 |
}
|
193 |
} // end not page_type and post_type
|
194 |
} // end if($post_type_object)
|
@@ -197,31 +196,31 @@ function vkExUnit_sitemap($atts) {
|
|
197 |
$sitemap_html .= '</div><!-- [ /.sitemap-col ] -->'.PHP_EOL;
|
198 |
$sitemap_html .= '</div><!-- [ /.sitemap ] -->'.PHP_EOL;
|
199 |
|
200 |
-
|
201 |
}
|
202 |
-
add_shortcode('vkExUnit_sitemap', 'vkExUnit_sitemap');
|
203 |
|
204 |
|
205 |
-
add_filter('vkExUnit_customField_Page_activation', 'vkExUnit_sitemap_activate', 10, 1);
|
206 |
-
function vkExUnit_sitemap_activate( $flag ){
|
207 |
return true;
|
208 |
}
|
209 |
|
210 |
|
211 |
/*-------------------------------------------*/
|
212 |
-
/*
|
213 |
/*-------------------------------------------*/
|
214 |
-
add_action('vkExUnit_customField_Page_box', 'vkExUnit_sitemap_meta_box');
|
215 |
-
function vkExUnit_sitemap_meta_box(){
|
216 |
global $post;
|
217 |
// sitemap display
|
218 |
$enable = get_post_meta( $post->ID, 'vkExUnit_sitemap', true ); ?>
|
219 |
|
220 |
<div>
|
221 |
-
<input type="hidden" name="_nonce_vkExUnit__custom_field_sitemap" id="_nonce_vkExUnit__custom_field_sitemap" value="<?php echo wp_create_nonce(plugin_basename(__FILE__));?>" />
|
222 |
<label for="vkExUnit_sitemap">
|
223 |
<input type="checkbox" id="vkExUnit_sitemap" name="vkExUnit_sitemap" <?php echo ($enable)? ' checked' : ''; ?> />
|
224 |
-
<?php _e('Display a HTML sitemap', 'vkExUnit');?>
|
225 |
</label>
|
226 |
</div>
|
227 |
|
@@ -230,28 +229,28 @@ function vkExUnit_sitemap_meta_box(){
|
|
230 |
|
231 |
|
232 |
// save custom field sitemap
|
233 |
-
add_action('save_post', 'vkExUnit_save_custom_field_sitemapData');
|
234 |
function vkExUnit_save_custom_field_sitemapData( $post_id ) {
|
235 |
-
$sitemap = isset($_POST['_nonce_vkExUnit__custom_field_sitemap']) ? htmlspecialchars($_POST['_nonce_vkExUnit__custom_field_sitemap']) : null;
|
236 |
|
237 |
-
if( !wp_verify_nonce( $sitemap, plugin_basename(__FILE__) )){
|
238 |
-
|
239 |
}
|
240 |
|
241 |
-
if ( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
242 |
-
|
243 |
|
244 |
-
$data = isset($_POST['vkExUnit_sitemap']) ? htmlspecialchars($_POST['vkExUnit_sitemap']) : null;
|
245 |
|
246 |
-
if('page' == $data){
|
247 |
-
if(!current_user_can('edit_page', $post_id)) return $post_id;
|
248 |
}
|
249 |
|
250 |
-
if (
|
251 |
-
add_post_meta( $post_id, 'vkExUnit_sitemap', $data, true )
|
252 |
-
} else if ( $data != get_post_meta( $post_id, 'vkExUnit_sitemap' )) {
|
253 |
-
update_post_meta( $post_id, 'vkExUnit_sitemap', $data )
|
254 |
-
} else if (
|
255 |
-
delete_post_meta( $post_id, 'vkExUnit_sitemap' )
|
256 |
}
|
257 |
-
}
|
1 |
<?php
|
2 |
|
3 |
/*-------------------------------------------*/
|
4 |
+
/* Add setting page
|
5 |
/*-------------------------------------------*/
|
6 |
+
/* Options Init
|
7 |
/*-------------------------------------------*/
|
8 |
+
/* validate
|
9 |
/*-------------------------------------------*/
|
10 |
+
/* insert sitemap page
|
11 |
/*-------------------------------------------*/
|
12 |
+
/* admin _ meta box
|
13 |
/*-------------------------------------------*/
|
14 |
|
15 |
|
16 |
/*-------------------------------------------*/
|
17 |
+
/* Add setting page
|
18 |
/*-------------------------------------------*/
|
19 |
|
20 |
+
function vkExUnit_add_sitemap_options_page() {
|
21 |
require dirname( __FILE__ ) . '/sitemap_admin.php';
|
22 |
}
|
23 |
/*-------------------------------------------*/
|
24 |
+
/* Options Init
|
25 |
/*-------------------------------------------*/
|
26 |
function vkExUnit_sitemap_options_init() {
|
27 |
+
if ( false === vkExUnit_get_sitemap_options() ) {
|
28 |
+
add_option( 'vkExUnit_sitemap_options', vkExUnit_get_sitemap_options_default() ); }
|
29 |
|
30 |
vkExUnit_register_setting(
|
31 |
+
__( 'HTML Sitemap', 'vkExUnit' ),
|
32 |
'vkExUnit_sitemap_options',
|
33 |
'vkExUnit_sitemap_options_validate',
|
34 |
'vkExUnit_add_sitemap_options_page'
|
39 |
function vkExUnit_get_sitemap_options() {
|
40 |
$options = get_option( 'vkExUnit_sitemap_options', vkExUnit_get_sitemap_options_default() );
|
41 |
$options_dafault = vkExUnit_get_sitemap_options_default();
|
42 |
+
foreach ( $options_dafault as $key => $value ) {
|
43 |
+
$options[ $key ] = (isset( $options[ $key ] )) ? $options[ $key ] : $options_dafault[ $key ];
|
44 |
}
|
45 |
return apply_filters( 'vkExUnit_sitemap_options', $options );
|
46 |
}
|
47 |
|
48 |
function vkExUnit_get_sitemap_options_default() {
|
49 |
$default_options = array(
|
50 |
+
'excludeId' => '',
|
51 |
);
|
52 |
return apply_filters( 'vkExUnit_sitemap_options_default', $default_options );
|
53 |
}
|
54 |
|
55 |
/*-------------------------------------------*/
|
56 |
+
/* validate
|
57 |
/*-------------------------------------------*/
|
58 |
function vkExUnit_sitemap_options_validate( $input ) {
|
59 |
$output = $defaults = vkExUnit_get_sitemap_options_default();
|
60 |
|
61 |
$paras = array( 'excludeId' );
|
62 |
|
63 |
+
foreach ( $paras as $key => $value ) {
|
64 |
+
$output[ $value ] = (isset( $input[ $value ] )) ? $input[ $value ] : '';
|
65 |
}
|
66 |
return apply_filters( 'vkExUnit_sitemap_options_validate', $output, $input, $defaults );
|
67 |
}
|
68 |
|
69 |
/*-------------------------------------------*/
|
70 |
+
/* insert sitemap page
|
71 |
/*-------------------------------------------*/
|
72 |
+
add_filter( 'the_content', 'show_sitemap', 7, 1 );
|
73 |
|
74 |
+
function show_sitemap( $content ) {
|
75 |
global $is_pagewidget;
|
76 |
+
if ( $is_pagewidget ) { return $content; }
|
77 |
wp_reset_postdata(); // need under other section / ex:child page index
|
78 |
global $post;
|
79 |
$enable = get_post_meta( $post->ID, 'vkExUnit_sitemap',true );
|
80 |
+
if ( $enable ) {
|
81 |
+
return $content . "\n" . do_shortcode( '[vkExUnit_sitemap]' );
|
82 |
}
|
83 |
return $content;
|
84 |
}
|
85 |
|
86 |
+
function vkExUnit_sitemap( $atts ) {
|
87 |
|
88 |
+
extract(shortcode_atts(array(
|
89 |
+
'exclude' => '',
|
90 |
+
), $atts));
|
91 |
|
92 |
$sitemap_html = '<div class="row veu_sitemap">'.PHP_EOL;
|
93 |
$options = vkExUnit_get_sitemap_options();
|
94 |
+
$exclude = esc_attr( $options['excludeId'] );
|
95 |
+
$exclude = str_replace( ',',',',$exclude );
|
96 |
+
$exclude = mb_convert_kana( $exclude, 'kvrn' );
|
97 |
|
98 |
/*-------------------------------------------*/
|
99 |
/* pages
|
103 |
$args = array(
|
104 |
'title_li' => '',
|
105 |
'echo' => 0,
|
106 |
+
'exclude_tree' => $exclude,
|
107 |
);
|
108 |
+
$sitemap_html .= wp_list_pages( $args );
|
109 |
|
110 |
$sitemap_html .= '</ul><!-- [ /.link-list ] -->'.PHP_EOL;
|
111 |
$sitemap_html .= '</div><!-- [ /.sitemap-col ] -->'.PHP_EOL;
|
116 |
$sitemap_html .= '<div class="col-md-6 sitemap-col">'.PHP_EOL;
|
117 |
|
118 |
$page_for_posts = vkExUnit_get_page_for_posts();
|
119 |
+
$allPostTypes = get_post_types( array( 'public' => true ) );
|
120 |
|
121 |
+
foreach ( $allPostTypes as $postType ) {
|
122 |
+
$post_type_object = get_post_type_object( $postType );
|
123 |
|
124 |
+
if ( $post_type_object ) {
|
125 |
+
$postType_name = esc_html( $post_type_object->name );
|
126 |
// post-type is post
|
127 |
+
if ( $postType_name === 'post' ) {
|
128 |
|
129 |
+
$postTypes = array( 'post' );
|
130 |
$taxonomies = get_taxonomies();
|
131 |
// Loop all post types
|
132 |
+
foreach ( $postTypes as $key => $postType ) {
|
133 |
|
134 |
$sitemap_html .= '<div class="sectionBox">'.PHP_EOL;
|
135 |
+
$post_type_object = get_post_type_object( $postType );
|
136 |
+
if ( $post_type_object ) {
|
137 |
|
138 |
// Post type name
|
139 |
+
if ( $postType == 'post' && $page_for_posts['post_top_use'] ) {
|
140 |
$postTypeName = $page_for_posts['post_top_name'];
|
141 |
+
$postTypeTopUrl = get_the_permalink( $page_for_posts['post_top_id'] );
|
142 |
} else {
|
143 |
$postTypeName = $post_type_object->labels->name;
|
144 |
$postTypeTopUrl = home_url().'/?post_type='.$postType;
|
145 |
}
|
146 |
+
$sitemap_html .= '<h4><a href="'.$postTypeTopUrl.'">'.esc_html( $postTypeName ).'</a></h4>'.PHP_EOL;
|
|
|
147 |
|
148 |
// Loop for all taxonomies
|
149 |
+
foreach ( $taxonomies as $key => $taxonomy ) {
|
150 |
$taxonomy_info = get_taxonomy( $taxonomy );
|
151 |
|
152 |
// Get tax related post type
|
153 |
$taxonomy_postType = $taxonomy_info->object_type[0];
|
154 |
+
if ( $taxonomy_postType == $postType && ( $taxonomy_info->name != 'post_format') ) {
|
155 |
$sitemap_html .= '<h5>'.$taxonomy_info->labels->name.'</h5>'.PHP_EOL;
|
156 |
$sitemap_html .= '<ul class="link-list">'.PHP_EOL;
|
157 |
$args = array(
|
161 |
'echo' => 0,
|
162 |
'show_option_none' => '',
|
163 |
);
|
164 |
+
$sitemap_html .= wp_list_categories( $args );
|
165 |
+
$sitemap_html .= '</ul><!-- [ /.link-list ] -->'.PHP_EOL;
|
166 |
}
|
167 |
}
|
168 |
} // end if($post_type_object)
|
169 |
} // end foreach ($postTypes as $key => $postType)
|
170 |
} // end post-type is post
|
171 |
// not page_type and post_type
|
172 |
+
else if ( $postType_name !== 'page' && $postType_name !== 'attachment' ) {
|
173 |
$customPost_url = home_url().'/?post_type='.$postType_name;
|
174 |
$sitemap_html .= '<h4><a href="'.$customPost_url.'">'.$post_type_object->labels->name.'</a></h4>'.PHP_EOL;
|
175 |
|
176 |
+
$termNames = get_object_taxonomies( $postType_name );
|
177 |
|
178 |
+
foreach ( $termNames as $termName ) {
|
179 |
$termDate = get_taxonomy( $termName );
|
180 |
$sitemap_html .= '<h5>'.$termDate->label.'</h5>'.PHP_EOL;
|
181 |
$sitemap_html .= '<ul class="link-list">'.PHP_EOL;
|
184 |
'title_li' => '',
|
185 |
'orderby' => 'order',
|
186 |
'echo' => 0,
|
187 |
+
'show_option_none' => '',
|
188 |
);
|
189 |
+
$sitemap_html .= wp_list_categories( $args );
|
190 |
+
$sitemap_html .= '</ul>'.PHP_EOL;
|
191 |
}
|
192 |
} // end not page_type and post_type
|
193 |
} // end if($post_type_object)
|
196 |
$sitemap_html .= '</div><!-- [ /.sitemap-col ] -->'.PHP_EOL;
|
197 |
$sitemap_html .= '</div><!-- [ /.sitemap ] -->'.PHP_EOL;
|
198 |
|
199 |
+
return $sitemap_html;
|
200 |
}
|
201 |
+
add_shortcode( 'vkExUnit_sitemap', 'vkExUnit_sitemap' );
|
202 |
|
203 |
|
204 |
+
add_filter( 'vkExUnit_customField_Page_activation', 'vkExUnit_sitemap_activate', 10, 1 );
|
205 |
+
function vkExUnit_sitemap_activate( $flag ) {
|
206 |
return true;
|
207 |
}
|
208 |
|
209 |
|
210 |
/*-------------------------------------------*/
|
211 |
+
/* admin _ meta box
|
212 |
/*-------------------------------------------*/
|
213 |
+
add_action( 'vkExUnit_customField_Page_box', 'vkExUnit_sitemap_meta_box' );
|
214 |
+
function vkExUnit_sitemap_meta_box() {
|
215 |
global $post;
|
216 |
// sitemap display
|
217 |
$enable = get_post_meta( $post->ID, 'vkExUnit_sitemap', true ); ?>
|
218 |
|
219 |
<div>
|
220 |
+
<input type="hidden" name="_nonce_vkExUnit__custom_field_sitemap" id="_nonce_vkExUnit__custom_field_sitemap" value="<?php echo wp_create_nonce( plugin_basename( __FILE__ ) );?>" />
|
221 |
<label for="vkExUnit_sitemap">
|
222 |
<input type="checkbox" id="vkExUnit_sitemap" name="vkExUnit_sitemap" <?php echo ($enable)? ' checked' : ''; ?> />
|
223 |
+
<?php _e( 'Display a HTML sitemap', 'vkExUnit' );?>
|
224 |
</label>
|
225 |
</div>
|
226 |
|
229 |
|
230 |
|
231 |
// save custom field sitemap
|
232 |
+
add_action( 'save_post', 'vkExUnit_save_custom_field_sitemapData' );
|
233 |
function vkExUnit_save_custom_field_sitemapData( $post_id ) {
|
234 |
+
$sitemap = isset( $_POST['_nonce_vkExUnit__custom_field_sitemap'] ) ? htmlspecialchars( $_POST['_nonce_vkExUnit__custom_field_sitemap'] ) : null;
|
235 |
|
236 |
+
if ( ! wp_verify_nonce( $sitemap, plugin_basename( __FILE__ ) ) ) {
|
237 |
+
return $post_id;
|
238 |
}
|
239 |
|
240 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
241 |
+
return $post_id; }
|
242 |
|
243 |
+
$data = isset( $_POST['vkExUnit_sitemap'] ) ? htmlspecialchars( $_POST['vkExUnit_sitemap'] ) : null;
|
244 |
|
245 |
+
if ( 'page' == $data ) {
|
246 |
+
if ( ! current_user_can( 'edit_page', $post_id ) ) { return $post_id; }
|
247 |
}
|
248 |
|
249 |
+
if ( '' == get_post_meta( $post_id, 'vkExUnit_sitemap' ) ) {
|
250 |
+
add_post_meta( $post_id, 'vkExUnit_sitemap', $data, true );
|
251 |
+
} else if ( $data != get_post_meta( $post_id, 'vkExUnit_sitemap' ) ) {
|
252 |
+
update_post_meta( $post_id, 'vkExUnit_sitemap', $data );
|
253 |
+
} else if ( '' == $data ) {
|
254 |
+
delete_post_meta( $post_id, 'vkExUnit_sitemap' );
|
255 |
}
|
256 |
+
}
|
plugins/sns/function_fbPagePlugin.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
-
/*
|
4 |
/*-------------------------------------------*/
|
5 |
class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
|
6 |
|
@@ -10,36 +10,36 @@ class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
|
|
10 |
parent::__construct(
|
11 |
'vkExUnit_fbPagePlugin',
|
12 |
$widget_name,
|
13 |
-
array( 'description' => __(
|
14 |
);
|
15 |
}
|
16 |
|
17 |
|
18 |
-
function widget($args, $instance) {
|
19 |
echo $args['before_widget'];
|
20 |
echo '<div class="veu_fbPagePlugin">';
|
21 |
-
if ( isset($instance['label']) && $instance['label'] ) {
|
22 |
echo $args['before_title'];
|
23 |
echo $instance['label'];
|
24 |
echo $args['after_title'];
|
25 |
}
|
26 |
|
27 |
-
$page_url = ( isset($instance['page_url']) && $instance['page_url'] ) ? $instance['page_url'] : '';
|
28 |
-
$height = ( isset($instance['height']) && $instance['height'] ) ? $instance['height'] : 200;
|
29 |
-
$showFaces = ( isset($instance['showFaces']) && $instance['showFaces'] ) ? $instance['showFaces'] : 'false';
|
30 |
-
$hideCover = ( isset($instance['hideCover']) && $instance['hideCover'] ) ? $instance['hideCover'] : 'false';
|
31 |
-
$showPosts = ( isset($instance['showPosts']) && $instance['showPosts'] ) ? $instance['showPosts'] : 'true';
|
32 |
?>
|
33 |
|
34 |
-
|
35 |
<div class="fb-page" data-href="<?php echo $page_url; ?>" data-width="500" data-height="<?php echo $height; ?>" data-hide-cover="<?php echo $hideCover; ?>" data-show-facepile="<?php echo $showFaces; ?>" data-show-posts="<?php echo $showPosts; ?>">
|
36 |
-
|
37 |
<blockquote cite="<?php echo $page_url; ?>">
|
38 |
<a href="<?php echo $page_url; ?>">Facebook page</a>
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
|
44 |
<?php
|
45 |
echo '</div>';
|
@@ -48,7 +48,7 @@ class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
|
|
48 |
} // widget($args, $instance)
|
49 |
|
50 |
|
51 |
-
function update
|
52 |
$instance = $old_instance;
|
53 |
$instance['label'] = $new_instance['label'];
|
54 |
$instance['page_url'] = $new_instance['page_url'];
|
@@ -61,7 +61,7 @@ class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
|
|
61 |
}
|
62 |
|
63 |
|
64 |
-
function form
|
65 |
|
66 |
$defaults = array(
|
67 |
'label' => 'Facebook',
|
@@ -72,40 +72,39 @@ class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
|
|
72 |
'showPosts' => 'true',
|
73 |
);
|
74 |
|
75 |
-
$instance = wp_parse_args((array) $instance, $defaults);
|
76 |
?>
|
77 |
|
78 |
<?php //タイトル ?>
|
79 |
-
<label for="<?php echo $this->get_field_id('label'); ?>"><?php _e('Title:', 'vkExUnit'); ?></label><br/>
|
80 |
-
<input type="text" id="<?php echo $this->get_field_id('label'); ?>-title" name="<?php echo $this->get_field_name('label'); ?>" value="<?php echo $instance['label']; ?>" />
|
81 |
-
|
82 |
|
83 |
<?php //URL ?>
|
84 |
-
<label for="<?php echo $this->get_field_id('page_url'); ?>"><?php echo 'Facebook Page URL'; ?></label><br/>
|
85 |
-
<input type="text" id="<?php echo $this->get_field_id('page_url'); ?>" name="<?php echo $this->get_field_name('page_url'); ?>" value="<?php echo $instance['page_url']; ?>" />
|
86 |
-
|
87 |
|
88 |
<?php //Height ?>
|
89 |
-
<label for="<?php echo $this->get_field_id('height'); ?>"><?php _e('Height', 'vkExUnit'); ?></label><br/>
|
90 |
-
<input type="text" id="<?php echo $this->get_field_id('height'); ?>" name="<?php echo $this->get_field_name('height'); ?>" value="<?php echo $instance['height']; ?>" />
|
91 |
-
|
92 |
|
93 |
<?php //showFaces ?>
|
94 |
-
<label for="<?php echo $this->get_field_id('showFaces'); ?>"><?php _e("Show Friend's Faces", 'vkExUnit'); ?></label><br/>
|
95 |
-
<input type="checkbox" name="<?php echo $this->get_field_name('showFaces'); ?>" value="true" <?php echo ($instance['showFaces'] == 'true')? 'checked': '' ; ?> >
|
96 |
-
|
97 |
|
98 |
<?php //hideCover ?>
|
99 |
-
<label for="<?php echo $this->get_field_id('hideCover'); ?>"><?php _e('Hide Cover Photo', 'vkExUnit'); ?></label><br/>
|
100 |
-
<input type="checkbox" name="<?php echo $this->get_field_name('hideCover'); ?>" value="true" <?php echo ($instance['hideCover'] == 'true')? 'checked': '' ; ?> >
|
101 |
-
|
102 |
|
103 |
<?php //showPosts ?>
|
104 |
-
<label for="<?php echo $this->get_field_id('showPosts'); ?>"><?php _e('Show Page Posts', 'vkExUnit'); ?></label><br/>
|
105 |
-
<input type="checkbox" name="<?php echo $this->get_field_name('showPosts'); ?>" value="true" <?php echo ($instance['showPosts'] == 'true')? 'checked': '' ; ?> >
|
106 |
-
|
107 |
<?php
|
108 |
}
|
109 |
-
|
110 |
} // class WP_Widget_top_list_post
|
111 |
-
add_action('widgets_init', create_function('', 'return register_widget("WP_Widget_vkExUnit_fbPagePlugin");'));
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
+
/* fbPagePlugin widget
|
4 |
/*-------------------------------------------*/
|
5 |
class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
|
6 |
|
10 |
parent::__construct(
|
11 |
'vkExUnit_fbPagePlugin',
|
12 |
$widget_name,
|
13 |
+
array( 'description' => __( 'Displays a Facebook Page Plugin', 'vkExUnit' ) )
|
14 |
);
|
15 |
}
|
16 |
|
17 |
|
18 |
+
function widget( $args, $instance ) {
|
19 |
echo $args['before_widget'];
|
20 |
echo '<div class="veu_fbPagePlugin">';
|
21 |
+
if ( isset( $instance['label'] ) && $instance['label'] ) {
|
22 |
echo $args['before_title'];
|
23 |
echo $instance['label'];
|
24 |
echo $args['after_title'];
|
25 |
}
|
26 |
|
27 |
+
$page_url = ( isset( $instance['page_url'] ) && $instance['page_url'] ) ? $instance['page_url'] : '';
|
28 |
+
$height = ( isset( $instance['height'] ) && $instance['height'] ) ? $instance['height'] : 200;
|
29 |
+
$showFaces = ( isset( $instance['showFaces'] ) && $instance['showFaces'] ) ? $instance['showFaces'] : 'false';
|
30 |
+
$hideCover = ( isset( $instance['hideCover'] ) && $instance['hideCover'] ) ? $instance['hideCover'] : 'false';
|
31 |
+
$showPosts = ( isset( $instance['showPosts'] ) && $instance['showPosts'] ) ? $instance['showPosts'] : 'true';
|
32 |
?>
|
33 |
|
34 |
+
<div class="fbPagePlugin_body">
|
35 |
<div class="fb-page" data-href="<?php echo $page_url; ?>" data-width="500" data-height="<?php echo $height; ?>" data-hide-cover="<?php echo $hideCover; ?>" data-show-facepile="<?php echo $showFaces; ?>" data-show-posts="<?php echo $showPosts; ?>">
|
36 |
+
<div class="fb-xfbml-parse-ignore">
|
37 |
<blockquote cite="<?php echo $page_url; ?>">
|
38 |
<a href="<?php echo $page_url; ?>">Facebook page</a>
|
39 |
+
</blockquote>
|
40 |
+
</div>
|
41 |
+
</div>
|
42 |
+
</div>
|
43 |
|
44 |
<?php
|
45 |
echo '</div>';
|
48 |
} // widget($args, $instance)
|
49 |
|
50 |
|
51 |
+
function update( $new_instance, $old_instance ) {
|
52 |
$instance = $old_instance;
|
53 |
$instance['label'] = $new_instance['label'];
|
54 |
$instance['page_url'] = $new_instance['page_url'];
|
61 |
}
|
62 |
|
63 |
|
64 |
+
function form( $instance ) {
|
65 |
|
66 |
$defaults = array(
|
67 |
'label' => 'Facebook',
|
72 |
'showPosts' => 'true',
|
73 |
);
|
74 |
|
75 |
+
$instance = wp_parse_args( (array) $instance, $defaults );
|
76 |
?>
|
77 |
|
78 |
<?php //タイトル ?>
|
79 |
+
<label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
|
80 |
+
<input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo $instance['label']; ?>" />
|
81 |
+
<br/>
|
82 |
|
83 |
<?php //URL ?>
|
84 |
+
<label for="<?php echo $this->get_field_id( 'page_url' ); ?>"><?php echo 'Facebook Page URL'; ?></label><br/>
|
85 |
+
<input type="text" id="<?php echo $this->get_field_id( 'page_url' ); ?>" name="<?php echo $this->get_field_name( 'page_url' ); ?>" value="<?php echo $instance['page_url']; ?>" />
|
86 |
+
<br/>
|
87 |
|
88 |
<?php //Height ?>
|
89 |
+
<label for="<?php echo $this->get_field_id( 'height' ); ?>"><?php _e( 'Height', 'vkExUnit' ); ?></label><br/>
|
90 |
+
<input type="text" id="<?php echo $this->get_field_id( 'height' ); ?>" name="<?php echo $this->get_field_name( 'height' ); ?>" value="<?php echo $instance['height']; ?>" />
|
91 |
+
<br/>
|
92 |
|
93 |
<?php //showFaces ?>
|
94 |
+
<label for="<?php echo $this->get_field_id( 'showFaces' ); ?>"><?php _e( "Show Friend's Faces", 'vkExUnit' ); ?></label><br/>
|
95 |
+
<input type="checkbox" name="<?php echo $this->get_field_name( 'showFaces' ); ?>" value="true" <?php echo ($instance['showFaces'] == 'true')? 'checked': '' ; ?> >
|
96 |
+
<br/>
|
97 |
|
98 |
<?php //hideCover ?>
|
99 |
+
<label for="<?php echo $this->get_field_id( 'hideCover' ); ?>"><?php _e( 'Hide Cover Photo', 'vkExUnit' ); ?></label><br/>
|
100 |
+
<input type="checkbox" name="<?php echo $this->get_field_name( 'hideCover' ); ?>" value="true" <?php echo ($instance['hideCover'] == 'true')? 'checked': '' ; ?> >
|
101 |
+
<br/>
|
102 |
|
103 |
<?php //showPosts ?>
|
104 |
+
<label for="<?php echo $this->get_field_id( 'showPosts' ); ?>"><?php _e( 'Show Page Posts', 'vkExUnit' ); ?></label><br/>
|
105 |
+
<input type="checkbox" name="<?php echo $this->get_field_name( 'showPosts' ); ?>" value="true" <?php echo ($instance['showPosts'] == 'true')? 'checked': '' ; ?> >
|
106 |
+
<br/>
|
107 |
<?php
|
108 |
}
|
|
|
109 |
} // class WP_Widget_top_list_post
|
110 |
+
add_action( 'widgets_init', create_function( '', 'return register_widget("WP_Widget_vkExUnit_fbPagePlugin");' ) );
|
plugins/sns/function_follow.php
CHANGED
@@ -1,36 +1,36 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
add_filter( 'the_content', 'vkExUnit_add_follow');
|
4 |
|
5 |
-
function vkExUnit_add_follow($content){
|
6 |
$postType = vkExUnit_get_post_type();
|
7 |
-
|
8 |
if ( is_single() && $postType['slug'] == 'post' ) :
|
9 |
|
10 |
$options = vkExUnit_get_sns_options();
|
11 |
-
if(
|
12 |
|
13 |
-
if (isset($options['followMe_title']) && $options['followMe_title'] ) {
|
14 |
$title = $options['followMe_title'];
|
15 |
} else {
|
16 |
-
$title = __('Follow me','vkExUnit').'!';
|
17 |
}
|
18 |
|
19 |
// https://about.twitter.com/resources/buttons#follow
|
20 |
$follow_html = '';
|
21 |
|
22 |
-
$fbPageUrl = (isset($options['fbPageUrl'])) ? $options['fbPageUrl'] : '';
|
23 |
-
$twitterId = (isset($options['twitterId'])) ? $options['twitterId'] : '';
|
24 |
|
25 |
$follow_html .= '<div class="veu_followSet veu_contentAddSection">'."\n";
|
26 |
$follow_html .= '<h3 class="followSet_title">'.$title.'</h3>';
|
27 |
|
28 |
if ( $fbPageUrl ) {
|
29 |
-
$follow_html .= '<div class="follow_btn fb-like" data-href="'.esc_url( $options['fbPageUrl'] ).'" data-layout="button" data-action="like" data-show-faces="false" data-share="true"></div>'."\n";
|
30 |
}
|
31 |
|
32 |
if ( $twitterId ) {
|
33 |
-
$follow_html .= '<div class="follow_btn follow_twitter"><a href="https://twitter.com/'.esc_html( $options['twitterId'] ).'" class="twitter-follow-button" data-show-count="false" data-lang="ja" data-show-screen-name="false">@'.esc_html( $options['twitterId'] ).'</a></div>'."\n";
|
34 |
}
|
35 |
|
36 |
$follow_html .= '<div class="follow_btn follow_feedly"><a href="http://cloud.feedly.com/#subscription/feed/'.home_url().'/feed/" target="blank"><img id="feedlyFollow" src="http://s3.feedly.com/img/follows/feedly-follow-rectangle-volume-small_2x.png" alt="follow us in feedly" width="66" height="20"></a></div>'."\n";
|
@@ -41,4 +41,4 @@ function vkExUnit_add_follow($content){
|
|
41 |
|
42 |
endif; // if ( $postType == 'post' && is_single() ) :
|
43 |
return $content;
|
44 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
add_filter( 'the_content', 'vkExUnit_add_follow' );
|
4 |
|
5 |
+
function vkExUnit_add_follow( $content ) {
|
6 |
$postType = vkExUnit_get_post_type();
|
7 |
+
|
8 |
if ( is_single() && $postType['slug'] == 'post' ) :
|
9 |
|
10 |
$options = vkExUnit_get_sns_options();
|
11 |
+
if ( ! $options['enableFollowMe'] ) { return $content; }
|
12 |
|
13 |
+
if ( isset( $options['followMe_title'] ) && $options['followMe_title'] ) {
|
14 |
$title = $options['followMe_title'];
|
15 |
} else {
|
16 |
+
$title = __( 'Follow me','vkExUnit' ).'!';
|
17 |
}
|
18 |
|
19 |
// https://about.twitter.com/resources/buttons#follow
|
20 |
$follow_html = '';
|
21 |
|
22 |
+
$fbPageUrl = (isset( $options['fbPageUrl'] )) ? $options['fbPageUrl'] : '';
|
23 |
+
$twitterId = (isset( $options['twitterId'] )) ? $options['twitterId'] : '';
|
24 |
|
25 |
$follow_html .= '<div class="veu_followSet veu_contentAddSection">'."\n";
|
26 |
$follow_html .= '<h3 class="followSet_title">'.$title.'</h3>';
|
27 |
|
28 |
if ( $fbPageUrl ) {
|
29 |
+
$follow_html .= '<div class="follow_btn fb-like" data-href="'.esc_url( $options['fbPageUrl'] ).'" data-layout="button" data-action="like" data-show-faces="false" data-share="true"></div>'."\n";
|
30 |
}
|
31 |
|
32 |
if ( $twitterId ) {
|
33 |
+
$follow_html .= '<div class="follow_btn follow_twitter"><a href="https://twitter.com/'.esc_html( $options['twitterId'] ).'" class="twitter-follow-button" data-show-count="false" data-lang="ja" data-show-screen-name="false">@'.esc_html( $options['twitterId'] ).'</a></div>'."\n";
|
34 |
}
|
35 |
|
36 |
$follow_html .= '<div class="follow_btn follow_feedly"><a href="http://cloud.feedly.com/#subscription/feed/'.home_url().'/feed/" target="blank"><img id="feedlyFollow" src="http://s3.feedly.com/img/follows/feedly-follow-rectangle-volume-small_2x.png" alt="follow us in feedly" width="66" height="20"></a></div>'."\n";
|
41 |
|
42 |
endif; // if ( $postType == 'post' && is_single() ) :
|
43 |
return $content;
|
44 |
+
}
|
plugins/sns/function_meta_box.php
CHANGED
@@ -2,63 +2,63 @@
|
|
2 |
|
3 |
class vkExUnit_sns_metabox {
|
4 |
|
5 |
-
|
6 |
|
7 |
-
|
8 |
|
9 |
-
|
10 |
-
public static function instance() {
|
11 |
-
if ( isset( self::$instance ) )
|
12 |
-
return self::$instance;
|
13 |
-
|
14 |
-
self::$instance = new vkExUnit_sns_metabox;
|
15 |
-
self::$instance->run_init();
|
16 |
-
return self::$instance;
|
17 |
-
}
|
18 |
|
|
|
|
|
|
|
19 |
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
|
25 |
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
}
|
31 |
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
|
|
|
|
36 |
|
37 |
-
echo '<input type="hidden" name="_nonce_vkExUnit_sns_title" id="_nonce_vkExUnit_sns_title_noonce" value="'.wp_create_nonce(plugin_basename(__FILE__)).'" />';
|
38 |
-
echo '<input type=text name="vkExUnit_sns_title" value="'. $disable_autoeyecatch .'" size=50 />';
|
39 |
-
echo '<p>'. __('if filled this area then override title of OGP and Twitter Card', 'vkExUnit').'</p>';
|
40 |
|
41 |
-
|
|
|
|
|
42 |
|
|
|
|
|
|
|
43 |
|
44 |
-
|
45 |
|
46 |
-
$metaKeyword = isset($_POST['_nonce_vkExUnit_sns_title']) ? htmlspecialchars($_POST['_nonce_vkExUnit_sns_title']) : null;
|
47 |
|
48 |
-
|
49 |
-
if( defined('DOING_AUTOSAVE') && DOING_AUTOSAVE )
|
50 |
-
return $post_id;
|
51 |
|
52 |
-
|
53 |
-
return $post_id;
|
54 |
-
}
|
55 |
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
61 |
}
|
62 |
|
63 |
|
64 |
-
vkExUnit_sns_metabox::instance();
|
2 |
|
3 |
class vkExUnit_sns_metabox {
|
4 |
|
5 |
+
private static $instance;
|
6 |
|
7 |
+
public static $allowed_post_types = array( 'post', 'page' );
|
8 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
+
public static function instance() {
|
11 |
+
if ( isset( self::$instance ) ) {
|
12 |
+
return self::$instance; }
|
13 |
|
14 |
+
self::$instance = new vkExUnit_sns_metabox;
|
15 |
+
self::$instance->run_init();
|
16 |
+
return self::$instance;
|
17 |
+
}
|
18 |
|
19 |
|
20 |
+
protected function run_init() {
|
21 |
+
add_action( 'admin_menu', array( $this, 'add_custom_field' ) );
|
22 |
+
add_action( 'save_post' , array( $this, 'save_custom_field' ) );
|
23 |
+
}
|
|
|
24 |
|
25 |
|
26 |
+
public function add_custom_field() {
|
27 |
+
foreach ( self::$allowed_post_types as $post_type ) {
|
28 |
+
add_meta_box( 'vkExUnit_SnsTitle', __( 'Sns Title', 'vkExUnit' ), array( $this, 'render_meta_box' ), $post_type, 'normal', 'high' );
|
29 |
+
}
|
30 |
+
}
|
31 |
|
|
|
|
|
|
|
32 |
|
33 |
+
public function render_meta_box() {
|
34 |
+
global $post;
|
35 |
+
$disable_autoeyecatch = get_post_meta( get_the_id(), 'vkExUnit_sns_title', true );
|
36 |
|
37 |
+
echo '<input type="hidden" name="_nonce_vkExUnit_sns_title" id="_nonce_vkExUnit_sns_title_noonce" value="'.wp_create_nonce( plugin_basename( __FILE__ ) ).'" />';
|
38 |
+
echo '<input type=text name="vkExUnit_sns_title" value="'. $disable_autoeyecatch .'" size=50 />';
|
39 |
+
echo '<p>'. __( 'if filled this area then override title of OGP and Twitter Card', 'vkExUnit' ).'</p>';
|
40 |
|
41 |
+
}
|
42 |
|
|
|
43 |
|
44 |
+
public function save_custom_field( $post_id ) {
|
|
|
|
|
45 |
|
46 |
+
$metaKeyword = isset( $_POST['_nonce_vkExUnit_sns_title'] ) ? htmlspecialchars( $_POST['_nonce_vkExUnit_sns_title'] ) : null;
|
|
|
|
|
47 |
|
48 |
+
// if autosave then deny
|
49 |
+
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
|
50 |
+
return $post_id; }
|
51 |
+
|
52 |
+
if ( ! wp_verify_nonce( $metaKeyword, plugin_basename( __FILE__ ) ) ) {
|
53 |
+
return $post_id;
|
54 |
+
}
|
55 |
+
|
56 |
+
delete_post_meta( $post_id, 'vkExUnit_sns_title' );
|
57 |
+
if ( isset( $_POST['vkExUnit_sns_title'] ) ) {
|
58 |
+
add_post_meta( $post_id, 'vkExUnit_sns_title', $_POST['vkExUnit_sns_title'] );
|
59 |
+
}
|
60 |
+
}
|
61 |
}
|
62 |
|
63 |
|
64 |
+
vkExUnit_sns_metabox::instance();
|
plugins/sns/function_og.php
CHANGED
@@ -3,16 +3,16 @@
|
|
3 |
add_post_type_support( 'page', 'excerpt' ); // add excerpt
|
4 |
|
5 |
/*-------------------------------------------*/
|
6 |
-
/*
|
7 |
/*-------------------------------------------*/
|
8 |
-
add_action('wp_head', 'vkExUnit_print_og',20 );
|
9 |
function vkExUnit_print_og() {
|
10 |
global $vkExUnit_sns_options;
|
11 |
$title = '';
|
12 |
-
if(is_single() || is_page()){
|
13 |
-
$title = get_post_meta(get_the_id(), 'vkExUnit_sns_title', true);
|
14 |
}
|
15 |
-
if(
|
16 |
$title = vkExUnit_get_wp_head_title();
|
17 |
}
|
18 |
|
@@ -20,52 +20,52 @@ function vkExUnit_print_og() {
|
|
20 |
//$fbAppId = $vkExUnit_sns_options['fbAppId'];
|
21 |
global $wp_query;
|
22 |
$post = $wp_query->get_queried_object();
|
23 |
-
if (is_home() || is_front_page()) {
|
24 |
$linkUrl = home_url();
|
25 |
-
} else if (is_single() || is_page()) {
|
26 |
$linkUrl = get_permalink();
|
27 |
} else {
|
28 |
$linkUrl = get_permalink();
|
29 |
}
|
30 |
$vkExUnitOGP = '<!-- [ '.vkExUnit_get_name().' OGP ] -->'."\n";
|
31 |
-
$vkExUnitOGP .= '<meta property="og:site_name" content="'.get_bloginfo('name').'" />'."\n";
|
32 |
$vkExUnitOGP .= '<meta property="og:url" content="'.$linkUrl.'" />'."\n";
|
33 |
$vkExUnitOGP .= '<meta property="og:title" content="'.$title.'" />'."\n";
|
34 |
$vkExUnitOGP .= '<meta property="og:description" content="'.vkExUnit_get_pageDescription().'" />'."\n";
|
35 |
-
if (isset($vkExUnit_sns_options['fbAppId']) && $vkExUnit_sns_options['fbAppId']){
|
36 |
$vkExUnitOGP = $vkExUnitOGP.'<meta property="fb:app_id" content="'.$vkExUnit_sns_options['fbAppId'].'" />'."\n";
|
37 |
}
|
38 |
-
if (is_front_page() || is_home()) {
|
39 |
$vkExUnitOGP .= '<meta property="og:type" content="website" />'."\n";
|
40 |
-
if (isset($vkExUnit_sns_options['ogImage']) && $vkExUnit_sns_options['ogImage']){
|
41 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$vkExUnit_sns_options['ogImage'].'" />'."\n";
|
42 |
}
|
43 |
-
} else if (is_category() || is_archive()) {
|
44 |
$vkExUnitOGP .= '<meta property="og:type" content="article" />'."\n";
|
45 |
-
if (isset($vkExUnit_sns_options['ogImage']) && $vkExUnit_sns_options['ogImage']){
|
46 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$vkExUnit_sns_options['ogImage'].'" />'."\n";
|
47 |
}
|
48 |
-
} else if (is_page() || is_single()) {
|
49 |
$vkExUnitOGP .= '<meta property="og:type" content="article" />'."\n";
|
50 |
// image
|
51 |
-
if (has_post_thumbnail()) {
|
52 |
$image_id = get_post_thumbnail_id();
|
53 |
-
$image_url = wp_get_attachment_image_src($image_id,'large', true);
|
54 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$image_url[0].'" />'."\n";
|
55 |
-
} else if (isset($vkExUnit_sns_options['ogImage']) && $vkExUnit_sns_options['ogImage'] ){
|
56 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$vkExUnit_sns_options['ogImage'].'" />'."\n";
|
57 |
}
|
58 |
} else {
|
59 |
$vkExUnitOGP .= '<meta property="og:type" content="article" />'."\n";
|
60 |
-
if (isset($vkExUnit_sns_options['ogImage']) && $vkExUnit_sns_options['ogImage']){
|
61 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$vkExUnit_sns_options['ogImage'].'" />'."\n";
|
62 |
}
|
63 |
}
|
64 |
|
65 |
$vkExUnitOGP .= '<!-- [ /'.vkExUnit_get_name().' OGP ] -->'."\n";
|
66 |
-
if ( isset($vkExUnit_sns_options['ogTagDisplay']) && $vkExUnit_sns_options['ogTagDisplay'] != true ) {
|
67 |
$vkExUnitOGP = '';
|
68 |
}
|
69 |
-
$vkExUnitOGP = apply_filters('vkExUnitOGPCustom', $vkExUnitOGP );
|
70 |
echo $vkExUnitOGP;
|
71 |
-
}
|
3 |
add_post_type_support( 'page', 'excerpt' ); // add excerpt
|
4 |
|
5 |
/*-------------------------------------------*/
|
6 |
+
/* Add OGP
|
7 |
/*-------------------------------------------*/
|
8 |
+
add_action( 'wp_head', 'vkExUnit_print_og',20 );
|
9 |
function vkExUnit_print_og() {
|
10 |
global $vkExUnit_sns_options;
|
11 |
$title = '';
|
12 |
+
if ( is_single() || is_page() ) {
|
13 |
+
$title = get_post_meta( get_the_id(), 'vkExUnit_sns_title', true );
|
14 |
}
|
15 |
+
if ( ! $title ) {
|
16 |
$title = vkExUnit_get_wp_head_title();
|
17 |
}
|
18 |
|
20 |
//$fbAppId = $vkExUnit_sns_options['fbAppId'];
|
21 |
global $wp_query;
|
22 |
$post = $wp_query->get_queried_object();
|
23 |
+
if ( is_home() || is_front_page() ) {
|
24 |
$linkUrl = home_url();
|
25 |
+
} else if ( is_single() || is_page() ) {
|
26 |
$linkUrl = get_permalink();
|
27 |
} else {
|
28 |
$linkUrl = get_permalink();
|
29 |
}
|
30 |
$vkExUnitOGP = '<!-- [ '.vkExUnit_get_name().' OGP ] -->'."\n";
|
31 |
+
$vkExUnitOGP .= '<meta property="og:site_name" content="'.get_bloginfo( 'name' ).'" />'."\n";
|
32 |
$vkExUnitOGP .= '<meta property="og:url" content="'.$linkUrl.'" />'."\n";
|
33 |
$vkExUnitOGP .= '<meta property="og:title" content="'.$title.'" />'."\n";
|
34 |
$vkExUnitOGP .= '<meta property="og:description" content="'.vkExUnit_get_pageDescription().'" />'."\n";
|
35 |
+
if ( isset( $vkExUnit_sns_options['fbAppId'] ) && $vkExUnit_sns_options['fbAppId'] ) {
|
36 |
$vkExUnitOGP = $vkExUnitOGP.'<meta property="fb:app_id" content="'.$vkExUnit_sns_options['fbAppId'].'" />'."\n";
|
37 |
}
|
38 |
+
if ( is_front_page() || is_home() ) {
|
39 |
$vkExUnitOGP .= '<meta property="og:type" content="website" />'."\n";
|
40 |
+
if ( isset( $vkExUnit_sns_options['ogImage'] ) && $vkExUnit_sns_options['ogImage'] ) {
|
41 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$vkExUnit_sns_options['ogImage'].'" />'."\n";
|
42 |
}
|
43 |
+
} else if ( is_category() || is_archive() ) {
|
44 |
$vkExUnitOGP .= '<meta property="og:type" content="article" />'."\n";
|
45 |
+
if ( isset( $vkExUnit_sns_options['ogImage'] ) && $vkExUnit_sns_options['ogImage'] ) {
|
46 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$vkExUnit_sns_options['ogImage'].'" />'."\n";
|
47 |
}
|
48 |
+
} else if ( is_page() || is_single() ) {
|
49 |
$vkExUnitOGP .= '<meta property="og:type" content="article" />'."\n";
|
50 |
// image
|
51 |
+
if ( has_post_thumbnail() ) {
|
52 |
$image_id = get_post_thumbnail_id();
|
53 |
+
$image_url = wp_get_attachment_image_src( $image_id,'large', true );
|
54 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$image_url[0].'" />'."\n";
|
55 |
+
} else if ( isset( $vkExUnit_sns_options['ogImage'] ) && $vkExUnit_sns_options['ogImage'] ) {
|
56 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$vkExUnit_sns_options['ogImage'].'" />'."\n";
|
57 |
}
|
58 |
} else {
|
59 |
$vkExUnitOGP .= '<meta property="og:type" content="article" />'."\n";
|
60 |
+
if ( isset( $vkExUnit_sns_options['ogImage'] ) && $vkExUnit_sns_options['ogImage'] ) {
|
61 |
$vkExUnitOGP .= '<meta property="og:image" content="'.$vkExUnit_sns_options['ogImage'].'" />'."\n";
|
62 |
}
|
63 |
}
|
64 |
|
65 |
$vkExUnitOGP .= '<!-- [ /'.vkExUnit_get_name().' OGP ] -->'."\n";
|
66 |
+
if ( isset( $vkExUnit_sns_options['ogTagDisplay'] ) && $vkExUnit_sns_options['ogTagDisplay'] != true ) {
|
67 |
$vkExUnitOGP = '';
|
68 |
}
|
69 |
+
$vkExUnitOGP = apply_filters( 'vkExUnitOGPCustom', $vkExUnitOGP );
|
70 |
echo $vkExUnitOGP;
|
71 |
+
}
|
plugins/sns/function_snsBtns.php
CHANGED
@@ -1,17 +1,17 @@
|
|
1 |
<?php
|
2 |
|
3 |
-
add_filter( 'the_content', 'vkExUnit_add_snsBtns', 200, 1);
|
4 |
-
|
5 |
|
6 |
-
function vkExUnit_add_snsBtns($content){
|
7 |
-
|
8 |
-
|
9 |
|
10 |
-
if (is_single() || is_page()) :
|
11 |
-
if (is_home() || is_front_page()) {
|
12 |
$linkUrl = home_url();
|
13 |
$twitterUrl = home_url();
|
14 |
-
} else if ( is_single() || is_archive() || ( is_page() && !is_front_page() ) ) {
|
15 |
// $twitterUrl = home_url().'/?p='.get_the_ID();
|
16 |
// URL is shortened it's id, but perm link because it does not count URL becomes separately
|
17 |
$twitterUrl = get_permalink();
|
@@ -20,11 +20,11 @@ function vkExUnit_add_snsBtns($content){
|
|
20 |
$linkUrl = get_permalink();
|
21 |
}
|
22 |
$pageTitle = '';
|
23 |
-
if(is_single() || is_page()){
|
24 |
-
$pageTitle = get_post_meta(get_the_id(), 'vkExUnit_sns_title', true);
|
25 |
}
|
26 |
-
if(
|
27 |
-
$pageTitle = urlencode(vkExUnit_get_wp_head_title());
|
28 |
}
|
29 |
$socialSet = '<div class="veu_socialSet veu_contentAddSection"><script>window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-wjs"));</script><ul>';
|
30 |
// facebook
|
@@ -35,7 +35,7 @@ function vkExUnit_add_snsBtns($content){
|
|
35 |
$socialSet .= '<li class="sb_hatena sb_icon"><a href="http://b.hatena.ne.jp/add?mode=confirm&url='.$linkUrl.'&title='.$pageTitle.'" target="_blank" onclick="snsWindowOpen();"><span class="vk_icon_w_r_sns_hatena icon_sns"></span><span class="sns_txt">Hatena</span><span class="veu_count_sns_hb"></span></a></li>';
|
36 |
// line
|
37 |
if ( wp_is_mobile() ) :
|
38 |
-
|
39 |
<a href="line://msg/text/'.$pageTitle.' '.$linkUrl.'"><span class="vk_icon_w_r_sns_line icon_sns"></span><span class="sns_txt">LINE</span></a></li>';
|
40 |
endif;
|
41 |
// pocket
|
@@ -45,4 +45,4 @@ function vkExUnit_add_snsBtns($content){
|
|
45 |
$content .= $socialSet;
|
46 |
endif;
|
47 |
return $content;
|
48 |
-
}
|
1 |
<?php
|
2 |
|
3 |
+
add_filter( 'the_content', 'vkExUnit_add_snsBtns', 200, 1 );
|
4 |
+
// is_single()
|
5 |
|
6 |
+
function vkExUnit_add_snsBtns( $content ) {
|
7 |
+
global $is_pagewidget;
|
8 |
+
if ( $is_pagewidget ) { return $content; }
|
9 |
|
10 |
+
if ( is_single() || is_page() ) :
|
11 |
+
if ( is_home() || is_front_page() ) {
|
12 |
$linkUrl = home_url();
|
13 |
$twitterUrl = home_url();
|
14 |
+
} else if ( is_single() || is_archive() || ( is_page() && ! is_front_page() ) ) {
|
15 |
// $twitterUrl = home_url().'/?p='.get_the_ID();
|
16 |
// URL is shortened it's id, but perm link because it does not count URL becomes separately
|
17 |
$twitterUrl = get_permalink();
|
20 |
$linkUrl = get_permalink();
|
21 |
}
|
22 |
$pageTitle = '';
|
23 |
+
if ( is_single() || is_page() ) {
|
24 |
+
$pageTitle = get_post_meta( get_the_id(), 'vkExUnit_sns_title', true );
|
25 |
}
|
26 |
+
if ( ! $pageTitle ) {
|
27 |
+
$pageTitle = urlencode( vkExUnit_get_wp_head_title() );
|
28 |
}
|
29 |
$socialSet = '<div class="veu_socialSet veu_contentAddSection"><script>window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return t;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-wjs"));</script><ul>';
|
30 |
// facebook
|
35 |
$socialSet .= '<li class="sb_hatena sb_icon"><a href="http://b.hatena.ne.jp/add?mode=confirm&url='.$linkUrl.'&title='.$pageTitle.'" target="_blank" onclick="snsWindowOpen();"><span class="vk_icon_w_r_sns_hatena icon_sns"></span><span class="sns_txt">Hatena</span><span class="veu_count_sns_hb"></span></a></li>';
|
36 |
// line
|
37 |
if ( wp_is_mobile() ) :
|
38 |
+
$socialSet .= '<li class="sb_line sb_icon">
|
39 |
<a href="line://msg/text/'.$pageTitle.' '.$linkUrl.'"><span class="vk_icon_w_r_sns_line icon_sns"></span><span class="sns_txt">LINE</span></a></li>';
|
40 |
endif;
|
41 |
// pocket
|
45 |
$content .= $socialSet;
|
46 |
endif;
|
47 |
return $content;
|
48 |
+
}
|
plugins/sns/function_twitterCard.php
CHANGED
@@ -2,40 +2,40 @@
|
|
2 |
|
3 |
add_post_type_support( 'page', 'excerpt' ); // add excerpt
|
4 |
|
5 |
-
add_filter( 'wp_head', 'vkExUnit_add_twitterCard',21);
|
6 |
|
7 |
-
function vkExUnit_add_twitterCard(){
|
8 |
-
global $vkExUnit_sns_options;
|
9 |
-
// url
|
10 |
-
$linkUrl = (is_front_page()) ? home_url():get_permalink();
|
11 |
-
// image
|
12 |
-
if ( ( is_single() || is_page() ) && has_post_thumbnail() ) {
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
} else {
|
17 |
-
|
18 |
-
}
|
19 |
|
20 |
-
$title = '';
|
21 |
-
if(is_single() || is_page()){
|
22 |
-
|
23 |
-
}
|
24 |
-
if(
|
25 |
-
|
26 |
-
}
|
27 |
-
// domain
|
28 |
-
preg_match( '/https?:\/\/(.+?)\//i', admin_url(), $match );
|
29 |
-
// image size
|
30 |
-
if ( isset($vkExUnit_sns_options['twitterId']) && $vkExUnit_sns_options['twitterId'] && $card_image_url ) :?>
|
31 |
-
<!-- [ <?php echo vkExUnit_get_name(); ?> twitter card ] -->
|
32 |
-
<meta name="twitter:card" content="summary_large_image">
|
33 |
-
<meta name="twitter:description" content="<?php echo vkExUnit_get_pageDescription(); ?>">
|
34 |
-
<meta name="twitter:title" content="<?php echo $title; ?>">
|
35 |
-
<meta name="twitter:url" content="<?php echo $linkUrl ?>">
|
36 |
-
<meta name="twitter:image" content="<?php echo esc_url($card_image_url);?>">
|
37 |
-
<meta name="twitter:domain" content="<?php echo $match[1] ?>">
|
38 |
-
<meta name="twitter:site" content="@<?php echo $vkExUnit_sns_options['twitterId'];?>">
|
39 |
-
<!-- [ / <?php echo vkExUnit_get_name(); ?> twitter card ] -->
|
40 |
-
<?php endif;
|
41 |
}
|
2 |
|
3 |
add_post_type_support( 'page', 'excerpt' ); // add excerpt
|
4 |
|
5 |
+
add_filter( 'wp_head', 'vkExUnit_add_twitterCard',21 );
|
6 |
|
7 |
+
function vkExUnit_add_twitterCard() {
|
8 |
+
global $vkExUnit_sns_options;
|
9 |
+
// url
|
10 |
+
$linkUrl = (is_front_page()) ? home_url():get_permalink();
|
11 |
+
// image
|
12 |
+
if ( ( is_single() || is_page() ) && has_post_thumbnail() ) {
|
13 |
+
$image_id = get_post_thumbnail_id();
|
14 |
+
$image_url = wp_get_attachment_image_src( $image_id,'large', true );
|
15 |
+
$card_image_url = $image_url[0];
|
16 |
+
} else {
|
17 |
+
$card_image_url = (isset( $vkExUnit_sns_options['ogImage'] )) ? $vkExUnit_sns_options['ogImage'] : '';
|
18 |
+
}
|
19 |
|
20 |
+
$title = '';
|
21 |
+
if ( is_single() || is_page() ) {
|
22 |
+
$title = get_post_meta( get_the_id(), 'vkExUnit_sns_title', true );
|
23 |
+
}
|
24 |
+
if ( ! $title ) {
|
25 |
+
$title = vkExUnit_get_wp_head_title();
|
26 |
+
}
|
27 |
+
// domain
|
28 |
+
preg_match( '/https?:\/\/(.+?)\//i', admin_url(), $match );
|
29 |
+
// image size
|
30 |
+
if ( isset( $vkExUnit_sns_options['twitterId'] ) && $vkExUnit_sns_options['twitterId'] && $card_image_url ) :?>
|
31 |
+
<!-- [ <?php echo vkExUnit_get_name(); ?> twitter card ] -->
|
32 |
+
<meta name="twitter:card" content="summary_large_image">
|
33 |
+
<meta name="twitter:description" content="<?php echo vkExUnit_get_pageDescription(); ?>">
|
34 |
+
<meta name="twitter:title" content="<?php echo $title; ?>">
|
35 |
+
<meta name="twitter:url" content="<?php echo $linkUrl ?>">
|
36 |
+
<meta name="twitter:image" content="<?php echo esc_url( $card_image_url );?>">
|
37 |
+
<meta name="twitter:domain" content="<?php echo $match[1] ?>">
|
38 |
+
<meta name="twitter:site" content="@<?php echo $vkExUnit_sns_options['twitterId'];?>">
|
39 |
+
<!-- [ / <?php echo vkExUnit_get_name(); ?> twitter card ] -->
|
40 |
+
<?php endif;
|
41 |
}
|
plugins/sns/sns.php
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
-
/*
|
4 |
/*-------------------------------------------*/
|
5 |
-
/*
|
6 |
/*-------------------------------------------*/
|
7 |
-
/*
|
8 |
/*-------------------------------------------*/
|
9 |
-
/*
|
10 |
/*-------------------------------------------*/
|
11 |
|
12 |
|
13 |
function vkExUnit_sns_options_init() {
|
14 |
-
if ( false === vkExUnit_get_sns_options() )
|
15 |
-
add_option( 'vkExUnit_sns_options', vkExUnit_get_sns_options_default() );
|
16 |
vkExUnit_register_setting(
|
17 |
-
__('SNS', 'vkExUnit'), // tab label.
|
18 |
'vkExUnit_sns_options', // name attr
|
19 |
'vkExUnit_sns_options_validate', // sanitaise function name
|
20 |
'vkExUnit_add_sns_options_page' // setting_page function name
|
@@ -25,8 +25,8 @@ add_action( 'admin_init', 'vkExUnit_sns_options_init' );
|
|
25 |
function vkExUnit_get_sns_options() {
|
26 |
$options = get_option( 'vkExUnit_sns_options', vkExUnit_get_sns_options_default() );
|
27 |
$options_dafault = vkExUnit_get_sns_options_default();
|
28 |
-
foreach ($options_dafault as $key => $value) {
|
29 |
-
$options[$key] = (isset($options[$key])) ? $options[$key] : $options_dafault[$key];
|
30 |
}
|
31 |
return apply_filters( 'vkExUnit_sns_options', $options );
|
32 |
}
|
@@ -47,7 +47,7 @@ function vkExUnit_get_sns_options_default() {
|
|
47 |
}
|
48 |
|
49 |
/*-------------------------------------------*/
|
50 |
-
/*
|
51 |
/*-------------------------------------------*/
|
52 |
|
53 |
function vkExUnit_sns_options_validate( $input ) {
|
@@ -57,41 +57,41 @@ function vkExUnit_sns_options_validate( $input ) {
|
|
57 |
$output['fbPageUrl'] = $input['fbPageUrl'];
|
58 |
$output['ogImage'] = $input['ogImage'];
|
59 |
$output['twitterId'] = $input['twitterId'];
|
60 |
-
$output['enableOGTags'] = ( isset($input['enableOGTags']) && isset($input['enableOGTags']) == 'true' )? true: false;
|
61 |
-
$output['enableTwitterCardTags'] = ( isset($input['enableTwitterCardTags']) && isset($input['enableTwitterCardTags']) == 'true' )? true: false;
|
62 |
-
$output['enableSnsBtns'] = ( isset($input['enableSnsBtns']) && isset($input['enableSnsBtns']) == 'true' )? true: false;
|
63 |
-
$output['enableFollowMe'] = ( isset($input['enableFollowMe']) && isset($input['enableFollowMe']) == 'true' )? true: false;
|
64 |
$output['followMe_title'] = $input['followMe_title'];
|
65 |
|
66 |
return apply_filters( 'vkExUnit_sns_options_validate', $output, $input, $defaults );
|
67 |
}
|
68 |
|
69 |
/*-------------------------------------------*/
|
70 |
-
/*
|
71 |
/*-------------------------------------------*/
|
72 |
-
add_action('wp_head', 'vkExUnit_set_sns_options',1 );
|
73 |
function vkExUnit_set_sns_options() {
|
74 |
global $vkExUnit_sns_options;
|
75 |
$vkExUnit_sns_options = vkExUnit_get_sns_options();
|
76 |
}
|
77 |
|
78 |
/*-------------------------------------------*/
|
79 |
-
/*
|
80 |
/*-------------------------------------------*/
|
81 |
-
add_action('wp_footer', 'exUnit_print_fbId_script');
|
82 |
-
function exUnit_print_fbId_script(){
|
83 |
?>
|
84 |
<div id="fb-root"></div>
|
85 |
<?php
|
86 |
$options = vkExUnit_get_sns_options();
|
87 |
-
$fbAppId = (isset($options['fbAppId'])) ? $options['fbAppId'] : '';
|
88 |
?>
|
89 |
<script>(function(d, s, id) {
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
js.src = "//connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.3&appId=<?php echo esc_html($fbAppId);?>";
|
94 |
-
|
95 |
}(document, 'script', 'facebook-jssdk'));</script>
|
96 |
<?php //endif;
|
97 |
}
|
@@ -100,22 +100,22 @@ $vkExUnit_sns_options = vkExUnit_get_sns_options();
|
|
100 |
|
101 |
require vkExUnit_get_directory() . '/plugins/sns/function_fbPagePlugin.php';
|
102 |
|
103 |
-
if ($vkExUnit_sns_options['enableOGTags'] == true)
|
104 |
-
require vkExUnit_get_directory() . '/plugins/sns/function_og.php';
|
105 |
-
if ($vkExUnit_sns_options['enableSnsBtns'] == true)
|
106 |
-
require vkExUnit_get_directory() . '/plugins/sns/function_snsBtns.php';
|
107 |
-
if ($vkExUnit_sns_options['enableTwitterCardTags'] == true)
|
108 |
-
require vkExUnit_get_directory() . '/plugins/sns/function_twitterCard.php';
|
109 |
-
if ($vkExUnit_sns_options['enableFollowMe'] == true)
|
110 |
-
require vkExUnit_get_directory() . '/plugins/sns/function_follow.php';
|
111 |
|
112 |
require vkExUnit_get_directory() . '/plugins/sns/function_meta_box.php';
|
113 |
|
114 |
/*-------------------------------------------*/
|
115 |
-
/*
|
116 |
/*-------------------------------------------*/
|
117 |
|
118 |
-
function vkExUnit_add_sns_options_page(){
|
119 |
require dirname( __FILE__ ) . '/sns_admin.php';
|
120 |
?>
|
121 |
<?php
|
1 |
<?php
|
2 |
/*-------------------------------------------*/
|
3 |
+
/* Options Init
|
4 |
/*-------------------------------------------*/
|
5 |
+
/* Add facebook aprication id
|
6 |
/*-------------------------------------------*/
|
7 |
+
/* Add setting page
|
8 |
/*-------------------------------------------*/
|
9 |
+
/* Options Init
|
10 |
/*-------------------------------------------*/
|
11 |
|
12 |
|
13 |
function vkExUnit_sns_options_init() {
|
14 |
+
if ( false === vkExUnit_get_sns_options() ) {
|
15 |
+
add_option( 'vkExUnit_sns_options', vkExUnit_get_sns_options_default() ); }
|
16 |
vkExUnit_register_setting(
|
17 |
+
__( 'SNS', 'vkExUnit' ), // tab label.
|
18 |
'vkExUnit_sns_options', // name attr
|
19 |
'vkExUnit_sns_options_validate', // sanitaise function name
|
20 |
'vkExUnit_add_sns_options_page' // setting_page function name
|
25 |
function vkExUnit_get_sns_options() {
|
26 |
$options = get_option( 'vkExUnit_sns_options', vkExUnit_get_sns_options_default() );
|
27 |
$options_dafault = vkExUnit_get_sns_options_default();
|
28 |
+
foreach ( $options_dafault as $key => $value ) {
|
29 |
+
$options[ $key ] = (isset( $options[ $key ] )) ? $options[ $key ] : $options_dafault[ $key ];
|
30 |
}
|
31 |
return apply_filters( 'vkExUnit_sns_options', $options );
|
32 |
}
|
47 |
}
|
48 |
|
49 |
/*-------------------------------------------*/
|
50 |
+
/* validate
|
51 |
/*-------------------------------------------*/
|
52 |
|
53 |
function vkExUnit_sns_options_validate( $input ) {
|
57 |
$output['fbPageUrl'] = $input['fbPageUrl'];
|
58 |
$output['ogImage'] = $input['ogImage'];
|
59 |
$output['twitterId'] = $input['twitterId'];
|
60 |
+
$output['enableOGTags'] = ( isset( $input['enableOGTags'] ) && isset( $input['enableOGTags'] ) == 'true' )? true: false;
|
61 |
+
$output['enableTwitterCardTags'] = ( isset( $input['enableTwitterCardTags'] ) && isset( $input['enableTwitterCardTags'] ) == 'true' )? true: false;
|
62 |
+
$output['enableSnsBtns'] = ( isset( $input['enableSnsBtns'] ) && isset( $input['enableSnsBtns'] ) == 'true' )? true: false;
|
63 |
+
$output['enableFollowMe'] = ( isset( $input['enableFollowMe'] ) && isset( $input['enableFollowMe'] ) == 'true' )? true: false;
|
64 |
$output['followMe_title'] = $input['followMe_title'];
|
65 |
|
66 |
return apply_filters( 'vkExUnit_sns_options_validate', $output, $input, $defaults );
|
67 |
}
|
68 |
|
69 |
/*-------------------------------------------*/
|
70 |
+
/* set global
|
71 |
/*-------------------------------------------*/
|
72 |
+
add_action( 'wp_head', 'vkExUnit_set_sns_options',1 );
|
73 |
function vkExUnit_set_sns_options() {
|
74 |
global $vkExUnit_sns_options;
|
75 |
$vkExUnit_sns_options = vkExUnit_get_sns_options();
|
76 |
}
|
77 |
|
78 |
/*-------------------------------------------*/
|
79 |
+
/* Add facebook aprication id
|
80 |
/*-------------------------------------------*/
|
81 |
+
add_action( 'wp_footer', 'exUnit_print_fbId_script' );
|
82 |
+
function exUnit_print_fbId_script() {
|
83 |
?>
|
84 |
<div id="fb-root"></div>
|
85 |
<?php
|
86 |
$options = vkExUnit_get_sns_options();
|
87 |
+
$fbAppId = (isset( $options['fbAppId'] )) ? $options['fbAppId'] : '';
|
88 |
?>
|
89 |
<script>(function(d, s, id) {
|
90 |
+
var js, fjs = d.getElementsByTagName(s)[0];
|
91 |
+
if (d.getElementById(id)) return;
|
92 |
+
js = d.createElement(s); js.id = id;
|
93 |
+
js.src = "//connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.3&appId=<?php echo esc_html( $fbAppId );?>";
|
94 |
+
fjs.parentNode.insertBefore(js, fjs);
|
95 |
}(document, 'script', 'facebook-jssdk'));</script>
|
96 |
<?php //endif;
|
97 |
}
|
100 |
|
101 |
require vkExUnit_get_directory() . '/plugins/sns/function_fbPagePlugin.php';
|
102 |
|
103 |
+
if ( $vkExUnit_sns_options['enableOGTags'] == true ) {
|
104 |
+
require vkExUnit_get_directory() . '/plugins/sns/function_og.php'; }
|
105 |
+
if ( $vkExUnit_sns_options['enableSnsBtns'] == true ) {
|
106 |
+
require vkExUnit_get_directory() . '/plugins/sns/function_snsBtns.php'; }
|
107 |
+
if ( $vkExUnit_sns_options['enableTwitterCardTags'] == true ) {
|
108 |
+
require vkExUnit_get_directory() . '/plugins/sns/function_twitterCard.php'; }
|
109 |
+
if ( $vkExUnit_sns_options['enableFollowMe'] == true ) {
|
110 |
+
require vkExUnit_get_directory() . '/plugins/sns/function_follow.php'; }
|
111 |
|
112 |
require vkExUnit_get_directory() . '/plugins/sns/function_meta_box.php';
|
113 |
|
114 |
/*-------------------------------------------*/
|
115 |
+
/* Add setting page
|
116 |
/*-------------------------------------------*/
|
117 |
|
118 |
+
function vkExUnit_add_sns_options_page() {
|
119 |
require dirname( __FILE__ ) . '/sns_admin.php';
|
120 |
?>
|
121 |
<?php
|
plugins/sns/sns_admin.php
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
-
<h3><?php echo __('SNS Settings');?></h3>
|
2 |
<?php
|
3 |
$options = vkExUnit_get_sns_options();
|
4 |
/*-------------------------------------------*/
|
5 |
-
/*
|
6 |
/*-------------------------------------------*/
|
7 |
?>
|
8 |
<div id="snsSetting" class="sectionBox">
|
@@ -10,58 +10,58 @@
|
|
10 |
<!-- OGP hidden -->
|
11 |
<table class="form-table">
|
12 |
<tr>
|
13 |
-
<th><?php _e('facebook application ID', 'vkExUnit'); ?></th>
|
14 |
<td><input type="text" name="vkExUnit_sns_options[fbAppId]" id="fbAppId" value="<?php echo esc_attr( $options['fbAppId'] ); ?>" /><br />
|
15 |
-
<span>[ <a href="https://developers.facebook.com/apps" target="_blank">» <?php _e('I will check and get the application ID', 'vkExUnit'); ?></a> ]</span><br />
|
16 |
-
<?php _e('* If an application ID is not specified, neither a Like button nor the comment field displays and operates correctly.', 'vkExUnit'); ?><br />
|
17 |
-
<?php _e('Please search for terms as [get Facebook application ID] If you do not know much about how to get application ID for Facebook.', 'vkExUnit'); ?>
|
18 |
</td>
|
19 |
</tr>
|
20 |
<tr>
|
21 |
-
<th><?php _e('facebook page URL', 'vkExUnit'); ?></th>
|
22 |
<td><input type="text" name="vkExUnit_sns_options[fbPageUrl]" id="fbPageUrl" value="<?php echo esc_url( $options['fbPageUrl'] ); ?>" /></td>
|
23 |
</tr>
|
24 |
<!-- OGP -->
|
25 |
<tr>
|
26 |
-
<th><?php _e('OG default image', 'vkExUnit'); ?></th>
|
27 |
-
<td><?php _e('If, for example someone pressed the Facebook [Like] button, this is the image that appears on the Facebook timeline.', 'vkExUnit'); ?><br />
|
28 |
-
<?php _e('If a featured image is specified for the page, it takes precedence.', 'vkExUnit'); ?><br />
|
29 |
<input type="text" name="vkExUnit_sns_options[ogImage]" id="ogImage" value="<?php echo esc_attr( $options['ogImage'] ); ?>" />
|
30 |
-
<button id="media_ogImage" class="media_btn button"><?php _e('Select an image', 'vkExUnit'); ?></button><br />
|
31 |
-
<span><?php _e('ex) ', 'vkExUnit')
|
32 |
-
<?php _e('* Picture sizes are 300x300 pixels or more and picture ratio 16:9 is recommended.', 'vkExUnit'); ?>
|
33 |
</td>
|
34 |
</tr>
|
35 |
<tr>
|
36 |
-
<th><?php _e('twitter ID', 'vkExUnit'); ?></th>
|
37 |
<td>@<input type="text" name="vkExUnit_sns_options[twitterId]" id="twitterId" value="<?php echo esc_attr( $options['twitterId'] ); ?>" /></td>
|
38 |
</tr>
|
39 |
|
40 |
<tr>
|
41 |
-
<th><?php _e('OG tags', 'vkExUnit'); ?></th>
|
42 |
<td><label>
|
43 |
-
<input type="checkbox" name="vkExUnit_sns_options[enableOGTags]" id="enableOGTags" value="true" <?php echo ( $options['enableOGTags'] )? 'checked': ''; ?> /><?php _e('Print the OG tags', 'vkExUnit');?></label>
|
44 |
-
<p><?php _e('If other plug-ins are used for the OG, do not output the OG using this plugin.', 'vkExUnit'); ?></p>
|
45 |
</td>
|
46 |
</tr>
|
47 |
|
48 |
<tr>
|
49 |
-
<th><?php _e('Twitter Card tags', 'vkExUnit'); ?></th>
|
50 |
<td><label>
|
51 |
-
<input type="checkbox" name="vkExUnit_sns_options[enableTwitterCardTags]" id="enableTwitterCardTags" value="true" <?php echo ( $options['enableTwitterCardTags'] )? 'checked': ''; ?> /><?php _e('Print the Twitter Card tags', 'vkExUnit');?></label>
|
52 |
</td>
|
53 |
</tr>
|
54 |
|
55 |
<tr>
|
56 |
-
<th><label for="enableSnsBtns"><?php _e('Social bookmark buttons', 'vkExUnit'); ?></label></th>
|
57 |
-
<td><label><input type="checkbox" name="vkExUnit_sns_options[enableSnsBtns]" id="enableSnsBtns" value="true" <?php echo ( $options['enableSnsBtns'] )? 'checked': ''; ?> /><?php _e('Print the social bookmark buttons', 'vkExUnit');?></label></td>
|
58 |
</tr>
|
59 |
|
60 |
<tr>
|
61 |
-
<th><label for="enableFollowMe"><?php _e('Follow me box', 'vkExUnit'); ?></label></th>
|
62 |
-
<td><label><input type="checkbox" name="vkExUnit_sns_options[enableFollowMe]" id="enableFollowMe" value="true" <?php echo ( $options['enableFollowMe'] )? 'checked': ''; ?> /><?php _e('Print the Follow me box', 'vkExUnit');?></label>
|
63 |
<dl>
|
64 |
-
<dt><?php _e('Follow me box title', 'vkExUnit'); ?></dt>
|
65 |
<dd><input type="text" name="vkExUnit_sns_options[followMe_title]" id="followMe_title" value="<?php echo esc_attr( $options['followMe_title'] ); ?>" /></dd>
|
66 |
</dl>
|
67 |
</td>
|
@@ -70,4 +70,4 @@
|
|
70 |
</table>
|
71 |
|
72 |
<?php submit_button(); ?>
|
73 |
-
</div>
|
1 |
+
<h3><?php echo __( 'SNS Settings' );?></h3>
|
2 |
<?php
|
3 |
$options = vkExUnit_get_sns_options();
|
4 |
/*-------------------------------------------*/
|
5 |
+
/* SNS
|
6 |
/*-------------------------------------------*/
|
7 |
?>
|
8 |
<div id="snsSetting" class="sectionBox">
|
10 |
<!-- OGP hidden -->
|
11 |
<table class="form-table">
|
12 |
<tr>
|
13 |
+
<th><?php _e( 'facebook application ID', 'vkExUnit' ); ?></th>
|
14 |
<td><input type="text" name="vkExUnit_sns_options[fbAppId]" id="fbAppId" value="<?php echo esc_attr( $options['fbAppId'] ); ?>" /><br />
|
15 |
+
<span>[ <a href="https://developers.facebook.com/apps" target="_blank">» <?php _e( 'I will check and get the application ID', 'vkExUnit' ); ?></a> ]</span><br />
|
16 |
+
<?php _e( '* If an application ID is not specified, neither a Like button nor the comment field displays and operates correctly.', 'vkExUnit' ); ?><br />
|
17 |
+
<?php _e( 'Please search for terms as [get Facebook application ID] If you do not know much about how to get application ID for Facebook.', 'vkExUnit' ); ?>
|
18 |
</td>
|
19 |
</tr>
|
20 |
<tr>
|
21 |
+
<th><?php _e( 'facebook page URL', 'vkExUnit' ); ?></th>
|
22 |
<td><input type="text" name="vkExUnit_sns_options[fbPageUrl]" id="fbPageUrl" value="<?php echo esc_url( $options['fbPageUrl'] ); ?>" /></td>
|
23 |
</tr>
|
24 |
<!-- OGP -->
|
25 |
<tr>
|
26 |
+
<th><?php _e( 'OG default image', 'vkExUnit' ); ?></th>
|
27 |
+
<td><?php _e( 'If, for example someone pressed the Facebook [Like] button, this is the image that appears on the Facebook timeline.', 'vkExUnit' ); ?><br />
|
28 |
+
<?php _e( 'If a featured image is specified for the page, it takes precedence.', 'vkExUnit' ); ?><br />
|
29 |
<input type="text" name="vkExUnit_sns_options[ogImage]" id="ogImage" value="<?php echo esc_attr( $options['ogImage'] ); ?>" />
|
30 |
+
<button id="media_ogImage" class="media_btn button"><?php _e( 'Select an image', 'vkExUnit' ); ?></button><br />
|
31 |
+
<span><?php _e( 'ex) ', 'vkExUnit' );?>http://www.vektor-inc.co.jp/images/ogImage.png</span><br />
|
32 |
+
<?php _e( '* Picture sizes are 300x300 pixels or more and picture ratio 16:9 is recommended.', 'vkExUnit' ); ?>
|
33 |
</td>
|
34 |
</tr>
|
35 |
<tr>
|
36 |
+
<th><?php _e( 'twitter ID', 'vkExUnit' ); ?></th>
|
37 |
<td>@<input type="text" name="vkExUnit_sns_options[twitterId]" id="twitterId" value="<?php echo esc_attr( $options['twitterId'] ); ?>" /></td>
|
38 |
</tr>
|
39 |
|
40 |
<tr>
|
41 |
+
<th><?php _e( 'OG tags', 'vkExUnit' ); ?></th>
|
42 |
<td><label>
|
43 |
+
<input type="checkbox" name="vkExUnit_sns_options[enableOGTags]" id="enableOGTags" value="true" <?php echo ( $options['enableOGTags'] )? 'checked': ''; ?> /><?php _e( 'Print the OG tags', 'vkExUnit' );?></label>
|
44 |
+
<p><?php _e( 'If other plug-ins are used for the OG, do not output the OG using this plugin.', 'vkExUnit' ); ?></p>
|
45 |
</td>
|
46 |
</tr>
|
47 |
|
48 |
<tr>
|
49 |
+
<th><?php _e( 'Twitter Card tags', 'vkExUnit' ); ?></th>
|
50 |
<td><label>
|
51 |
+
<input type="checkbox" name="vkExUnit_sns_options[enableTwitterCardTags]" id="enableTwitterCardTags" value="true" <?php echo ( $options['enableTwitterCardTags'] )? 'checked': ''; ?> /><?php _e( 'Print the Twitter Card tags', 'vkExUnit' );?></label>
|
52 |
</td>
|
53 |
</tr>
|
54 |
|
55 |
<tr>
|
56 |
+
<th><label for="enableSnsBtns"><?php _e( 'Social bookmark buttons', 'vkExUnit' ); ?></label></th>
|
57 |
+
<td><label><input type="checkbox" name="vkExUnit_sns_options[enableSnsBtns]" id="enableSnsBtns" value="true" <?php echo ( $options['enableSnsBtns'] )? 'checked': ''; ?> /><?php _e( 'Print the social bookmark buttons', 'vkExUnit' );?></label></td>
|
58 |
</tr>
|
59 |
|
60 |
<tr>
|
61 |
+
<th><label for="enableFollowMe"><?php _e( 'Follow me box', 'vkExUnit' ); ?></label></th>
|
62 |
+
<td><label><input type="checkbox" name="vkExUnit_sns_options[enableFollowMe]" id="enableFollowMe" value="true" <?php echo ( $options['enableFollowMe'] )? 'checked': ''; ?> /><?php _e( 'Print the Follow me box', 'vkExUnit' );?></label>
|
63 |
<dl>
|
64 |
+
<dt><?php _e( 'Follow me box title', 'vkExUnit' ); ?></dt>
|
65 |
<dd><input type="text" name="vkExUnit_sns_options[followMe_title]" id="followMe_title" value="<?php echo esc_attr( $options['followMe_title'] ); ?>" /></dd>
|
66 |
</dl>
|
67 |
</td>
|
70 |
</table>
|
71 |
|
72 |
<?php submit_button(); ?>
|
73 |
+
</div>
|
plugins_admin/admin_banner.php
CHANGED
@@ -1,9 +1,9 @@
|
|
1 |
<?php
|
2 |
-
function vkExUnit_admin_banner(){
|
3 |
-
if (strtoupper(get_locale()) == 'JA'){
|
4 |
-
$banner = '<a href="http://lightning.bizvektor.com/ja/" target="_blank"><img src="'.vkExUnit_get_directory_uri('/images/lightning_bnr_ja.jpg').'" alt="lightning_bnr_ja" /></a>';
|
5 |
} else {
|
6 |
-
$banner = '<a href="http://lightning.bizvektor.com/" target="_blank"><img src="'.vkExUnit_get_directory_uri('/images/lightning_bnr_en.jpg').'" alt="lightning_bnr_en" /></a>';
|
7 |
}
|
8 |
-
|
9 |
-
}
|
1 |
<?php
|
2 |
+
function vkExUnit_admin_banner() {
|
3 |
+
if ( strtoupper( get_locale() ) == 'JA' ) {
|
4 |
+
$banner = '<a href="http://lightning.bizvektor.com/ja/" target="_blank"><img src="'.vkExUnit_get_directory_uri( '/images/lightning_bnr_ja.jpg' ).'" alt="lightning_bnr_ja" /></a>';
|
5 |
} else {
|
6 |
+
$banner = '<a href="http://lightning.bizvektor.com/" target="_blank"><img src="'.vkExUnit_get_directory_uri( '/images/lightning_bnr_en.jpg' ).'" alt="lightning_bnr_en" /></a>';
|
7 |
}
|
8 |
+
echo apply_filters( 'vkExUnit_news_admin_banner_html' , $banner );
|
9 |
+
}
|
plugins_admin/admin_bar.php
CHANGED
@@ -11,11 +11,11 @@
|
|
11 |
|
12 |
add_action( 'admin_bar_menu', 'vkExUnit_adminbar_disable', 999 );
|
13 |
function vkExUnit_adminbar_disable( $wp_admin_bar ) {
|
14 |
-
if(is_user_logged_in() && !is_admin() && current_user_can('administrator') || current_user_can('editor')){
|
15 |
$args = array(
|
16 |
'id' => 'veu_disable_admin_edit',
|
17 |
-
'title' => __('Edit Guide', 'vkExUnit').' : SHOW',
|
18 |
-
'meta' => array( 'class' => 'veu_admin_bar_disable_button' , 'onClick' => 'javascript:void(0);')
|
19 |
);
|
20 |
$wp_admin_bar->add_node( $args );
|
21 |
}
|
@@ -23,15 +23,15 @@ function vkExUnit_adminbar_disable( $wp_admin_bar ) {
|
|
23 |
|
24 |
|
25 |
|
26 |
-
add_action('wp_head','vkExUnit_adminbar_edit_header');
|
27 |
-
function vkExUnit_adminbar_edit_header(){
|
28 |
-
if(is_user_logged_in() && !is_admin() && current_user_can('administrator') || current_user_can('editor')){
|
29 |
<style>#wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item { background-color: #0085C8; cursor: pointer; }
|
30 |
#wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item.active { background-color: #17A686; color: #555; }
|
31 |
#wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item:hover { background-color: #17A686; color: #555; }
|
32 |
#wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item.active:hover { background-color: #0085C8; color: #fff; }
|
33 |
</style><script type="text/javascript">;(function($,d){var a=false,b='',c='',f=function(){
|
34 |
-
if(a){a=false;c.show();b.removeClass('active').text('<?php echo __('Edit Guide', 'vkExUnit').' : SHOW'; ?>');}else{a=true;c.hide();b.addClass('active').text('<?php echo __('Edit Guide', 'vkExUnit').' : HIDE'; ?>');}
|
35 |
};$(d).ready(function(){b=$('#wp-admin-bar-veu_disable_admin_edit .ab-item').on('click',f);c=$('.veu_adminEdit');});})(jQuery,document);</script>
|
36 |
<?php }
|
37 |
}
|
@@ -39,25 +39,25 @@ if(a){a=false;c.show();b.removeClass('active').text('<?php echo __('Edit Guide',
|
|
39 |
|
40 |
|
41 |
add_action( 'admin_bar_menu', 'vkExUnit_adminbar_link', 40 );
|
42 |
-
function vkExUnit_adminbar_link( $wp_admin_bar ){
|
43 |
|
44 |
global $current_user;
|
45 |
get_currentuserinfo();
|
46 |
-
if ($current_user->ID == '') return ;
|
47 |
-
if( !user_can( $current_user->ID, 'activate_plugins' ) ) return;
|
48 |
|
49 |
$args = array(
|
50 |
'id' => 'veu_adminlink',
|
51 |
'title' => vkExUnit_get_little_short_name(),
|
52 |
'href' => admin_url() . 'admin.php?page=vkExUnit_main_setting',
|
53 |
-
'meta' => array()
|
54 |
);
|
55 |
$wp_admin_bar->add_node( $args );
|
56 |
$wp_admin_bar->add_node(
|
57 |
array(
|
58 |
'parent' => 'veu_adminlink',
|
59 |
'id' => 'veu_adminlink_active',
|
60 |
-
'title' => __('Active Setting','vkExUnit'),
|
61 |
'href' => admin_url() . 'admin.php?page=vkExUnit_setting_page',
|
62 |
)
|
63 |
);
|
11 |
|
12 |
add_action( 'admin_bar_menu', 'vkExUnit_adminbar_disable', 999 );
|
13 |
function vkExUnit_adminbar_disable( $wp_admin_bar ) {
|
14 |
+
if ( is_user_logged_in() && ! is_admin() && current_user_can( 'administrator' ) || current_user_can( 'editor' ) ) {
|
15 |
$args = array(
|
16 |
'id' => 'veu_disable_admin_edit',
|
17 |
+
'title' => __( 'Edit Guide', 'vkExUnit' ).' : SHOW',
|
18 |
+
'meta' => array( 'class' => 'veu_admin_bar_disable_button' , 'onClick' => 'javascript:void(0);' ),
|
19 |
);
|
20 |
$wp_admin_bar->add_node( $args );
|
21 |
}
|
23 |
|
24 |
|
25 |
|
26 |
+
add_action( 'wp_head','vkExUnit_adminbar_edit_header' );
|
27 |
+
function vkExUnit_adminbar_edit_header() {
|
28 |
+
if ( is_user_logged_in() && ! is_admin() && current_user_can( 'administrator' ) || current_user_can( 'editor' ) ) { ?>
|
29 |
<style>#wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item { background-color: #0085C8; cursor: pointer; }
|
30 |
#wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item.active { background-color: #17A686; color: #555; }
|
31 |
#wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item:hover { background-color: #17A686; color: #555; }
|
32 |
#wpadminbar #wp-admin-bar-veu_disable_admin_edit .ab-item.active:hover { background-color: #0085C8; color: #fff; }
|
33 |
</style><script type="text/javascript">;(function($,d){var a=false,b='',c='',f=function(){
|
34 |
+
if(a){a=false;c.show();b.removeClass('active').text('<?php echo __( 'Edit Guide', 'vkExUnit' ).' : SHOW'; ?>');}else{a=true;c.hide();b.addClass('active').text('<?php echo __( 'Edit Guide', 'vkExUnit' ).' : HIDE'; ?>');}
|
35 |
};$(d).ready(function(){b=$('#wp-admin-bar-veu_disable_admin_edit .ab-item').on('click',f);c=$('.veu_adminEdit');});})(jQuery,document);</script>
|
36 |
<?php }
|
37 |
}
|
39 |
|
40 |
|
41 |
add_action( 'admin_bar_menu', 'vkExUnit_adminbar_link', 40 );
|
42 |
+
function vkExUnit_adminbar_link( $wp_admin_bar ) {
|
43 |
|
44 |
global $current_user;
|
45 |
get_currentuserinfo();
|
46 |
+
if ( $current_user->ID == '' ) { return ; }
|
47 |
+
if ( ! user_can( $current_user->ID, 'activate_plugins' ) ) { return; }
|
48 |
|
49 |
$args = array(
|
50 |
'id' => 'veu_adminlink',
|
51 |
'title' => vkExUnit_get_little_short_name(),
|
52 |
'href' => admin_url() . 'admin.php?page=vkExUnit_main_setting',
|
53 |
+
'meta' => array(),
|
54 |
);
|
55 |
$wp_admin_bar->add_node( $args );
|
56 |
$wp_admin_bar->add_node(
|
57 |
array(
|
58 |
'parent' => 'veu_adminlink',
|
59 |
'id' => 'veu_adminlink_active',
|
60 |
+
'title' => __( 'Active Setting','vkExUnit' ),
|
61 |
'href' => admin_url() . 'admin.php?page=vkExUnit_setting_page',
|
62 |
)
|
63 |
);
|
plugins_admin/dashboard_info_widget.php
CHANGED
@@ -1,27 +1,28 @@
|
|
1 |
<?php
|
2 |
/*--------------------------------------------------*/
|
3 |
-
/*
|
4 |
/*--------------------------------------------------*/
|
5 |
|
6 |
-
add_filter('vkExUnit_is_plugin_dashboard_info_widget', 'vkExUnit_dash_beacon', 10, 1 );
|
7 |
-
function vkExUnit_dash_beacon($flag){
|
8 |
$flag = true;
|
9 |
return $flag;
|
10 |
}
|
11 |
|
12 |
add_action( 'wp_dashboard_setup', 'vkExUnit_dashboard_widget' );
|
13 |
|
14 |
-
function vkExUnit_dashboard_widget()
|
15 |
-
|
16 |
wp_add_dashboard_widget(
|
17 |
'vkExUnit_dashboard_widget',
|
18 |
-
__('News from VK All in One Expansion Unit','vkExUnit'),
|
19 |
'vkExUnit_dashboard_widget_body'
|
20 |
);
|
21 |
}
|
22 |
|
23 |
-
function vkExUnit_dashboard_widget_body(){
|
24 |
echo vkExUnit_get_systemlogo();
|
25 |
vkExUnit_news_body();
|
26 |
|
27 |
-
}
|
|
1 |
<?php
|
2 |
/*--------------------------------------------------*/
|
3 |
+
/* Display a Ex_unit information on the dashboard
|
4 |
/*--------------------------------------------------*/
|
5 |
|
6 |
+
add_filter( 'vkExUnit_is_plugin_dashboard_info_widget', 'vkExUnit_dash_beacon', 10, 1 );
|
7 |
+
function vkExUnit_dash_beacon( $flag ) {
|
8 |
$flag = true;
|
9 |
return $flag;
|
10 |
}
|
11 |
|
12 |
add_action( 'wp_dashboard_setup', 'vkExUnit_dashboard_widget' );
|
13 |
|
14 |
+
function vkExUnit_dashboard_widget() {
|
15 |
+
|
16 |
wp_add_dashboard_widget(
|
17 |
'vkExUnit_dashboard_widget',
|
18 |
+
__( 'News from VK All in One Expansion Unit','vkExUnit' ),
|
19 |
'vkExUnit_dashboard_widget_body'
|
20 |
);
|
21 |
}
|
22 |
|
23 |
+
function vkExUnit_dashboard_widget_body() {
|
24 |
echo vkExUnit_get_systemlogo();
|
25 |
vkExUnit_news_body();
|
26 |
|
27 |
+
}
|
28 |
+
|
plugins_admin/news_from_exUnit.php
CHANGED
@@ -1,26 +1,22 @@
|
|
1 |
<?php
|
2 |
-
function vkExUnit_news_body()
|
3 |
-
{
|
4 |
|
5 |
-
include_once(ABSPATH . WPINC . '/feed.php');
|
6 |
|
7 |
if ( 'ja' == get_locale() ) {
|
8 |
-
$exUnit_feed_url = apply_filters( 'vkExUnit_news_RSS_URL_ja', 'http://ex-unit.bizvektor.com/ja/?feed?'.date('his') );
|
9 |
} else {
|
10 |
-
$exUnit_feed_url = apply_filters( 'vkExUnit_news_RSS_URL', 'http://ex-unit.bizvektor.com/?feed?'.date('his') );
|
11 |
}
|
12 |
|
13 |
$my_feeds = array(
|
14 |
-
array('feed_url' => $exUnit_feed_url)
|
15 |
);
|
16 |
|
|
|
|
|
17 |
|
18 |
-
|
19 |
-
{
|
20 |
-
$rss = fetch_feed( $feed["feed_url"] );
|
21 |
-
|
22 |
-
if ( !is_wp_error($rss) )
|
23 |
-
{
|
24 |
$output = '';
|
25 |
|
26 |
$maxitems = $rss->get_item_quantity( 5 ); //number of news to display (maximum)
|
@@ -30,32 +26,25 @@ function vkExUnit_news_body()
|
|
30 |
$output .= '<h1 class="veu_admin_subTitle">Information</h1>';
|
31 |
$output .= '<ul>';
|
32 |
|
33 |
-
if ( $maxitems == 0 )
|
34 |
-
{
|
35 |
$output .= '<li>';
|
36 |
-
$output .= __('Sorry, there is no post', 'vkExUnit');
|
37 |
$output .= '</li>';
|
38 |
-
}
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
{
|
43 |
-
foreach ( $rss_items as $item )
|
44 |
-
{
|
45 |
$test_date = $item->get_local_date();
|
46 |
$content = $item->get_content();
|
47 |
|
48 |
-
if( isset($test_date) && !is_null($test_date) )
|
49 |
-
$item_date = $item->get_date( get_option('date_format') ) . '<br />';
|
50 |
-
|
51 |
-
$item_date = '';
|
52 |
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
}
|
60 |
}
|
61 |
|
@@ -65,4 +54,4 @@ function vkExUnit_news_body()
|
|
65 |
echo $output;
|
66 |
}
|
67 |
}
|
68 |
-
}
|
1 |
<?php
|
2 |
+
function vkExUnit_news_body() {
|
|
|
3 |
|
4 |
+
include_once( ABSPATH . WPINC . '/feed.php' );
|
5 |
|
6 |
if ( 'ja' == get_locale() ) {
|
7 |
+
$exUnit_feed_url = apply_filters( 'vkExUnit_news_RSS_URL_ja', 'http://ex-unit.bizvektor.com/ja/?feed?'.date( 'his' ) );
|
8 |
} else {
|
9 |
+
$exUnit_feed_url = apply_filters( 'vkExUnit_news_RSS_URL', 'http://ex-unit.bizvektor.com/?feed?'.date( 'his' ) );
|
10 |
}
|
11 |
|
12 |
$my_feeds = array(
|
13 |
+
array( 'feed_url' => $exUnit_feed_url ),
|
14 |
);
|
15 |
|
16 |
+
foreach ( $my_feeds as $feed ) {
|
17 |
+
$rss = fetch_feed( $feed['feed_url'] );
|
18 |
|
19 |
+
if ( ! is_wp_error( $rss ) ) {
|
|
|
|
|
|
|
|
|
|
|
20 |
$output = '';
|
21 |
|
22 |
$maxitems = $rss->get_item_quantity( 5 ); //number of news to display (maximum)
|
26 |
$output .= '<h1 class="veu_admin_subTitle">Information</h1>';
|
27 |
$output .= '<ul>';
|
28 |
|
29 |
+
if ( $maxitems == 0 ) {
|
|
|
30 |
$output .= '<li>';
|
31 |
+
$output .= __( 'Sorry, there is no post', 'vkExUnit' );
|
32 |
$output .= '</li>';
|
33 |
+
} else {
|
34 |
+
foreach ( $rss_items as $item ) {
|
|
|
|
|
|
|
|
|
|
|
35 |
$test_date = $item->get_local_date();
|
36 |
$content = $item->get_content();
|
37 |
|
38 |
+
if ( isset( $test_date ) && ! is_null( $test_date ) ) {
|
39 |
+
$item_date = $item->get_date( get_option( 'date_format' ) ) . '<br />'; } else {
|
40 |
+
$item_date = ''; }
|
|
|
41 |
|
42 |
+
$output .= '<li style="color:#777;">';
|
43 |
+
$output .= $item_date;
|
44 |
+
$output .= '<a href="' . esc_url( $item->get_permalink() ) . '" title="' . $item_date . '" target="_blank">';
|
45 |
+
$output .= esc_html( $item->get_title() );
|
46 |
+
$output .= '</a>';
|
47 |
+
$output .= '</li>';
|
48 |
}
|
49 |
}
|
50 |
|
54 |
echo $output;
|
55 |
}
|
56 |
}
|
57 |
+
}
|
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: 4.2
|
6 |
Tested up to: 4.3
|
7 |
-
Stable tag: 3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -44,6 +44,7 @@ Many features can be stopped individually.
|
|
44 |
* Insert Related Posts
|
45 |
* Insert Call to action
|
46 |
* Insert Child page List to page
|
|
|
47 |
* Insert Auto HTML Site Map
|
48 |
* Automatic Eye Catch insert
|
49 |
|
@@ -70,6 +71,12 @@ e.g.
|
|
70 |
|
71 |
== Changelog ==
|
72 |
|
|
|
|
|
|
|
|
|
|
|
|
|
73 |
= 3.6.3 =
|
74 |
* [ bug fix( by twitter api Specification change) ] Stop display the tweet count.
|
75 |
|
4 |
Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
|
5 |
Requires at least: 4.2
|
6 |
Tested up to: 4.3
|
7 |
+
Stable tag: 3.7.0
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
44 |
* Insert Related Posts
|
45 |
* Insert Call to action
|
46 |
* Insert Child page List to page
|
47 |
+
* Insert Page list from ancestor
|
48 |
* Insert Auto HTML Site Map
|
49 |
* Automatic Eye Catch insert
|
50 |
|
71 |
|
72 |
== Changelog ==
|
73 |
|
74 |
+
= 3.7.0 =
|
75 |
+
* [ Add function ] Insert Page list from ancestor.
|
76 |
+
* [ Specification change ][ Related post ] Change related logic.
|
77 |
+
* [ bug fix ][ Description ] Delete <br />
|
78 |
+
* [ bug fix ] php7
|
79 |
+
|
80 |
= 3.6.3 =
|
81 |
* [ bug fix( by twitter api Specification change) ] Stop display the tweet count.
|
82 |
|
uninstaller.php
CHANGED
@@ -1,53 +1,53 @@
|
|
1 |
<?php
|
2 |
|
3 |
$vkExUnit_options = vkExUnit_get_common_options();
|
4 |
-
if(
|
5 |
|
6 |
$delete_options = array(
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
);
|
19 |
|
20 |
$delete_customfields = array(
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
);
|
33 |
|
34 |
-
$delete_options = apply_filters(
|
35 |
-
foreach( $delete_options as $delete_option_name ){
|
36 |
-
|
37 |
}
|
38 |
|
39 |
-
$delete_customfields = apply_filters(
|
40 |
global $wpdb;
|
41 |
-
foreach( $delete_customfields as $delete_customfield ){
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
}
|
48 |
|
49 |
$wpdb->delete(
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
);
|
1 |
<?php
|
2 |
|
3 |
$vkExUnit_options = vkExUnit_get_common_options();
|
4 |
+
if ( ! $vkExUnit_options['delete_options_at_deactivate'] ) { return; }
|
5 |
|
6 |
$delete_options = array(
|
7 |
+
'vkExUnit_common_options',
|
8 |
+
'vkExUnit_cta_settings',
|
9 |
+
'vkExUnit_css_customize',
|
10 |
+
'vkExUnit_ga_options',
|
11 |
+
'vkExUnit_sitemap_options',
|
12 |
+
'vkExUnit_sns_options',
|
13 |
+
'vkExUnit_contact',
|
14 |
+
'vkExUnit_icon_settings',
|
15 |
+
'vkExUnit_Ads',
|
16 |
+
'vkExUnit_description_options',
|
17 |
+
'vkExUnit_common_keywords',
|
18 |
);
|
19 |
|
20 |
$delete_customfields = array(
|
21 |
+
'vkexunit_cta_each_option',
|
22 |
+
'vkExUnit_cta_img',
|
23 |
+
'vkExUnit_cta_img_position',
|
24 |
+
'vkExUnit_cta_button_text',
|
25 |
+
'vkExUnit_cta_url',
|
26 |
+
'vkExUnit_cta_text',
|
27 |
+
'vkExUnit_childPageIndex',
|
28 |
+
'vkExUnit_sitemap',
|
29 |
+
'vkExUnit_EyeCatch_disable',
|
30 |
+
'vkExUnit_contact_enable',
|
31 |
+
'vkExUnit_metaKeyword',
|
32 |
);
|
33 |
|
34 |
+
$delete_options = apply_filters( 'vkExUnit_uninstall_option', $delete_options );
|
35 |
+
foreach ( $delete_options as $delete_option_name ) {
|
36 |
+
delete_option( $delete_option_name );
|
37 |
}
|
38 |
|
39 |
+
$delete_customfields = apply_filters( 'vkExUnit_uninstall_postmeta', $delete_customfields );
|
40 |
global $wpdb;
|
41 |
+
foreach ( $delete_customfields as $delete_customfield ) {
|
42 |
+
$wpdb->delete(
|
43 |
+
$wpdb->prefix . 'postmeta',
|
44 |
+
array( 'meta_key' => $delete_customfield ),
|
45 |
+
array( '%s' )
|
46 |
+
);
|
47 |
}
|
48 |
|
49 |
$wpdb->delete(
|
50 |
+
$wpdb->prefix . 'posts',
|
51 |
+
array( 'post_type' => 'cta' ),
|
52 |
+
array( '%s' )
|
53 |
+
);
|
vkExUnit.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
Plugin Name: VK All in One Expansion Unit
|
4 |
Plugin URI: http://ex-unit.vektor-inc.co.jp
|
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: 3.
|
7 |
Author: Vektor,Inc.
|
8 |
Author URI: http://vektor-inc.co.jp
|
9 |
License: GPL2
|
@@ -26,36 +26,36 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
26 |
*/
|
27 |
|
28 |
/*-------------------------------------------*/
|
29 |
-
/*
|
30 |
/*-------------------------------------------*/
|
31 |
-
/*
|
32 |
/*-------------------------------------------*/
|
33 |
-
/*
|
34 |
/*-------------------------------------------*/
|
35 |
-
/*
|
36 |
/*-------------------------------------------*/
|
37 |
-
/*
|
38 |
/*-------------------------------------------*/
|
39 |
|
40 |
// Get Plugin version
|
41 |
$data = get_file_data( __FILE__, array( 'version' => 'Version' ) );
|
42 |
-
global $
|
43 |
-
$
|
44 |
|
45 |
//include('plugins/css_customize/css-customize.php');
|
46 |
-
load_plugin_textdomain('vkExUnit', false, basename( dirname( __FILE__ ) ) . '/languages' );
|
47 |
|
48 |
|
49 |
-
function vkExUnit_get_directory($path=''){
|
50 |
return $dirctory = dirname( __FILE__ ) . $path;
|
51 |
}
|
52 |
|
53 |
-
function vkExUnit_get_directory_uri($path=''){
|
54 |
-
return plugins_url( $path , __FILE__);
|
55 |
}
|
56 |
|
57 |
/*-------------------------------------------*/
|
58 |
-
/*
|
59 |
/*-------------------------------------------*/
|
60 |
add_action( 'admin_menu', 'vkExUnit_setting_menu_parent' );
|
61 |
function vkExUnit_setting_menu_parent() {
|
@@ -70,20 +70,20 @@ function vkExUnit_setting_menu_parent() {
|
|
70 |
'vkExUnit_setting_page', // ユニークなこのサブメニューページの識別子
|
71 |
'vkExUnit_add_setting_page' // メニューページのコンテンツを出力する関数
|
72 |
);
|
73 |
-
if ( ! $custom_page ) return;
|
74 |
}
|
75 |
|
76 |
/*-------------------------------------------*/
|
77 |
-
/*
|
78 |
/*-------------------------------------------*/
|
79 |
-
function vkExUnit_add_setting_page(){
|
80 |
require dirname( __FILE__ ) . '/vkExUnit_admin.php';
|
81 |
}
|
82 |
|
83 |
require_once( 'admin_wrapper.php' );
|
84 |
|
85 |
/*-------------------------------------------*/
|
86 |
-
/*
|
87 |
/*-------------------------------------------*/
|
88 |
|
89 |
require vkExUnit_get_directory() . '/common_init.php';
|
@@ -100,73 +100,67 @@ require vkExUnit_get_directory() . '/plugins_admin/admin_bar.php';
|
|
100 |
require vkExUnit_get_directory() . '/plugins/footer_copyright_change.php';
|
101 |
require vkExUnit_get_directory() . '/plugins/page_custom_field.php';
|
102 |
|
103 |
-
vkExUnit_package_include();
|
104 |
|
105 |
-
if ( vkExUnit_package_is_enable( 'wpTitle' ) )
|
106 |
-
add_filter('wp_title','vkExUnit_get_wp_head_title',11);
|
107 |
|
108 |
|
109 |
/*-------------------------------------------*/
|
110 |
-
/*
|
111 |
/*-------------------------------------------*/
|
112 |
// Add vkExUnit css
|
113 |
-
add_action('wp_enqueue_scripts','vkExUnit_print_css');
|
114 |
-
function vkExUnit_print_css(){
|
115 |
-
global $
|
116 |
$options = vkExUnit_get_common_options();
|
117 |
-
if ( isset($options['active_bootstrap']) && $options['active_bootstrap'] ) {
|
118 |
-
wp_enqueue_style('vkExUnit_common_style', plugins_url('', __FILE__).'/css/vkExUnit_style_in_bs.css', array(), $
|
119 |
} else {
|
120 |
-
wp_enqueue_style('vkExUnit_common_style', plugins_url('', __FILE__).'/css/vkExUnit_style.css', array(), $
|
|
|
|
|
|
|
121 |
}
|
122 |
}
|
123 |
/*-------------------------------------------*/
|
124 |
-
/*
|
125 |
/*-------------------------------------------*/
|
126 |
-
add_action('wp_head','vkExUnit_addJs');
|
127 |
-
function vkExUnit_addJs(){
|
128 |
-
global $
|
129 |
$options = vkExUnit_get_common_options();
|
130 |
-
if ( isset($options['active_bootstrap']) && $options['active_bootstrap'] ) {
|
131 |
-
|
132 |
} else {
|
133 |
-
wp_register_script( 'vkExUnit_master-js' , plugins_url('', __FILE__).'/js/all.min.js', array('jquery'), $
|
134 |
}
|
135 |
wp_enqueue_script( 'vkExUnit_master-js' );
|
136 |
}
|
137 |
|
138 |
/*-------------------------------------------*/
|
139 |
-
/*
|
140 |
/*-------------------------------------------*/
|
141 |
-
add_action('admin_print_scripts-vk-ex-unit_page_vkExUnit_main_setting', 'vkExUnit_admin_add_js');
|
142 |
function vkExUnit_admin_add_js( $hook_suffix ) {
|
143 |
-
global $
|
144 |
wp_enqueue_media();
|
145 |
-
wp_register_script( 'vkExUnit_admin_js', plugins_url('', __FILE__).'/js/vkExUnit_admin.js', array('jquery'), $
|
146 |
wp_enqueue_script( 'jquery' );
|
147 |
wp_enqueue_script( 'vkExUnit_admin_js' );
|
148 |
}
|
149 |
|
150 |
-
/*-------------------------------------------*/
|
151 |
-
/* Add fontawesome
|
152 |
-
/*-------------------------------------------*/
|
153 |
-
add_action('wp_head','vkExUnit_addfontawesome', 5);
|
154 |
-
function vkExUnit_addfontawesome(){
|
155 |
-
$options = vkExUnit_get_common_options();
|
156 |
-
if ( isset($options['active_fontawesome']) && $options['active_fontawesome'] ) {
|
157 |
-
echo '<link href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">'.PHP_EOL;
|
158 |
-
}
|
159 |
-
}
|
160 |
|
161 |
-
add_action( 'admin_print_styles-index.php', 'vkExUnit_admin_enq');
|
162 |
-
add_action( 'admin_print_styles-toplevel_page_vkExUnit_setting_page', 'vkExUnit_admin_enq');
|
163 |
-
add_action( 'admin_print_styles-vk-ex-unit_page_vkExUnit_main_setting', 'vkExUnit_admin_enq');
|
164 |
-
function vkExUnit_admin_enq(){
|
165 |
-
|
|
|
166 |
}
|
167 |
|
168 |
/*-------------------------------------------*/
|
169 |
-
/*
|
170 |
/*-------------------------------------------*/
|
171 |
|
172 |
// add_action("admin_head", 'vkExUnit_suffix2console');
|
@@ -178,21 +172,21 @@ function vkExUnit_admin_enq(){
|
|
178 |
// }
|
179 |
// }
|
180 |
|
181 |
-
if( function_exists('register_activation_hook') ){
|
182 |
register_activation_hook( __FILE__ , 'vkExUnit_install_function' );
|
183 |
}
|
184 |
-
function vkExUnit_install_function(){
|
185 |
-
$opt = get_option('vkExUnit_common_options');
|
186 |
-
if(
|
187 |
add_option( 'vkExUnit_common_options', vkExUnit_get_common_options_default() );
|
188 |
}
|
189 |
}
|
190 |
|
191 |
-
if (function_exists('register_deactivation_hook')){
|
192 |
-
|
193 |
}
|
194 |
|
195 |
-
function vkExUnit_uninstall_function()
|
196 |
-
|
197 |
include vkExUnit_get_directory( '/uninstaller.php' );
|
198 |
-
}
|
3 |
Plugin Name: VK All in One Expansion Unit
|
4 |
Plugin URI: http://ex-unit.vektor-inc.co.jp
|
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: 3.7.0
|
7 |
Author: Vektor,Inc.
|
8 |
Author URI: http://vektor-inc.co.jp
|
9 |
License: GPL2
|
26 |
*/
|
27 |
|
28 |
/*-------------------------------------------*/
|
29 |
+
/* Load master setting page
|
30 |
/*-------------------------------------------*/
|
31 |
+
/* Load modules
|
32 |
/*-------------------------------------------*/
|
33 |
+
/* Add Parent menu
|
34 |
/*-------------------------------------------*/
|
35 |
+
/* Add vkExUnit css
|
36 |
/*-------------------------------------------*/
|
37 |
+
/* Add vkExUnit js
|
38 |
/*-------------------------------------------*/
|
39 |
|
40 |
// Get Plugin version
|
41 |
$data = get_file_data( __FILE__, array( 'version' => 'Version' ) );
|
42 |
+
global $vkExUnit_version;
|
43 |
+
$vkExUnit_version = $data['version'];
|
44 |
|
45 |
//include('plugins/css_customize/css-customize.php');
|
46 |
+
load_plugin_textdomain( 'vkExUnit', false, basename( dirname( __FILE__ ) ) . '/languages' );
|
47 |
|
48 |
|
49 |
+
function vkExUnit_get_directory( $path = '' ) {
|
50 |
return $dirctory = dirname( __FILE__ ) . $path;
|
51 |
}
|
52 |
|
53 |
+
function vkExUnit_get_directory_uri( $path = '' ) {
|
54 |
+
return plugins_url( $path , __FILE__ );
|
55 |
}
|
56 |
|
57 |
/*-------------------------------------------*/
|
58 |
+
/* Add Parent menu
|
59 |
/*-------------------------------------------*/
|
60 |
add_action( 'admin_menu', 'vkExUnit_setting_menu_parent' );
|
61 |
function vkExUnit_setting_menu_parent() {
|
70 |
'vkExUnit_setting_page', // ユニークなこのサブメニューページの識別子
|
71 |
'vkExUnit_add_setting_page' // メニューページのコンテンツを出力する関数
|
72 |
);
|
73 |
+
if ( ! $custom_page ) { return; }
|
74 |
}
|
75 |
|
76 |
/*-------------------------------------------*/
|
77 |
+
/* Load master setting page
|
78 |
/*-------------------------------------------*/
|
79 |
+
function vkExUnit_add_setting_page() {
|
80 |
require dirname( __FILE__ ) . '/vkExUnit_admin.php';
|
81 |
}
|
82 |
|
83 |
require_once( 'admin_wrapper.php' );
|
84 |
|
85 |
/*-------------------------------------------*/
|
86 |
+
/* Load modules
|
87 |
/*-------------------------------------------*/
|
88 |
|
89 |
require vkExUnit_get_directory() . '/common_init.php';
|
100 |
require vkExUnit_get_directory() . '/plugins/footer_copyright_change.php';
|
101 |
require vkExUnit_get_directory() . '/plugins/page_custom_field.php';
|
102 |
|
103 |
+
vkExUnit_package_include(); // package_manager.php
|
104 |
|
105 |
+
if ( vkExUnit_package_is_enable( 'wpTitle' ) ) {
|
106 |
+
add_filter( 'wp_title','vkExUnit_get_wp_head_title',11 ); }
|
107 |
|
108 |
|
109 |
/*-------------------------------------------*/
|
110 |
+
/* Add vkExUnit css
|
111 |
/*-------------------------------------------*/
|
112 |
// Add vkExUnit css
|
113 |
+
add_action( 'wp_enqueue_scripts','vkExUnit_print_css' );
|
114 |
+
function vkExUnit_print_css() {
|
115 |
+
global $vkExUnit_version;
|
116 |
$options = vkExUnit_get_common_options();
|
117 |
+
if ( isset( $options['active_bootstrap'] ) && $options['active_bootstrap'] ) {
|
118 |
+
wp_enqueue_style( 'vkExUnit_common_style', plugins_url( '', __FILE__ ).'/css/vkExUnit_style_in_bs.css', array(), $vkExUnit_version, 'all' );
|
119 |
} else {
|
120 |
+
wp_enqueue_style( 'vkExUnit_common_style', plugins_url( '', __FILE__ ).'/css/vkExUnit_style.css', array(), $vkExUnit_version, 'all' );
|
121 |
+
}
|
122 |
+
if ( isset( $options['active_fontawesome'] ) && $options['active_fontawesome'] ) {
|
123 |
+
wp_enqueue_style( 'font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css', array(), '4.3.0', 'all' );
|
124 |
}
|
125 |
}
|
126 |
/*-------------------------------------------*/
|
127 |
+
/* Add vkExUnit js
|
128 |
/*-------------------------------------------*/
|
129 |
+
add_action( 'wp_head','vkExUnit_addJs' );
|
130 |
+
function vkExUnit_addJs() {
|
131 |
+
global $vkExUnit_version;
|
132 |
$options = vkExUnit_get_common_options();
|
133 |
+
if ( isset( $options['active_bootstrap'] ) && $options['active_bootstrap'] ) {
|
134 |
+
wp_register_script( 'vkExUnit_master-js' , plugins_url( '', __FILE__ ).'/js/all_in_bs.min.js', array( 'jquery' ), $vkExUnit_version );
|
135 |
} else {
|
136 |
+
wp_register_script( 'vkExUnit_master-js' , plugins_url( '', __FILE__ ).'/js/all.min.js', array( 'jquery' ), $vkExUnit_version );
|
137 |
}
|
138 |
wp_enqueue_script( 'vkExUnit_master-js' );
|
139 |
}
|
140 |
|
141 |
/*-------------------------------------------*/
|
142 |
+
/* Print admin js
|
143 |
/*-------------------------------------------*/
|
144 |
+
add_action( 'admin_print_scripts-vk-ex-unit_page_vkExUnit_main_setting', 'vkExUnit_admin_add_js' );
|
145 |
function vkExUnit_admin_add_js( $hook_suffix ) {
|
146 |
+
global $vkExUnit_version;
|
147 |
wp_enqueue_media();
|
148 |
+
wp_register_script( 'vkExUnit_admin_js', plugins_url( '', __FILE__ ).'/js/vkExUnit_admin.js', array( 'jquery' ), $vkExUnit_version );
|
149 |
wp_enqueue_script( 'jquery' );
|
150 |
wp_enqueue_script( 'vkExUnit_admin_js' );
|
151 |
}
|
152 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
153 |
|
154 |
+
add_action( 'admin_print_styles-index.php', 'vkExUnit_admin_enq' );
|
155 |
+
add_action( 'admin_print_styles-toplevel_page_vkExUnit_setting_page', 'vkExUnit_admin_enq' );
|
156 |
+
add_action( 'admin_print_styles-vk-ex-unit_page_vkExUnit_main_setting', 'vkExUnit_admin_enq' );
|
157 |
+
function vkExUnit_admin_enq() {
|
158 |
+
global $vkExUnit_version;
|
159 |
+
wp_enqueue_style( 'vkexunit-css-admin', plugins_url( '/css/vkExUnit_admin.css', __FILE__ ), array(), $vkExUnit_version, 'all' );
|
160 |
}
|
161 |
|
162 |
/*-------------------------------------------*/
|
163 |
+
/* 管理画面_admin_head JavaScriptのデバッグコンソールにhook_suffixの値を出力
|
164 |
/*-------------------------------------------*/
|
165 |
|
166 |
// add_action("admin_head", 'vkExUnit_suffix2console');
|
172 |
// }
|
173 |
// }
|
174 |
|
175 |
+
if ( function_exists( 'register_activation_hook' ) ) {
|
176 |
register_activation_hook( __FILE__ , 'vkExUnit_install_function' );
|
177 |
}
|
178 |
+
function vkExUnit_install_function() {
|
179 |
+
$opt = get_option( 'vkExUnit_common_options' );
|
180 |
+
if ( ! $opt ) {
|
181 |
add_option( 'vkExUnit_common_options', vkExUnit_get_common_options_default() );
|
182 |
}
|
183 |
}
|
184 |
|
185 |
+
if ( function_exists( 'register_deactivation_hook' ) ) {
|
186 |
+
register_deactivation_hook( __FILE__, 'vkExUnit_uninstall_function' );
|
187 |
}
|
188 |
|
189 |
+
function vkExUnit_uninstall_function() {
|
190 |
+
|
191 |
include vkExUnit_get_directory( '/uninstaller.php' );
|
192 |
+
}
|
vkExUnit_admin.php
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
<div class="wrap vkExUnit_admin_page">
|
2 |
<h2>
|
3 |
-
<span class="pageTitleTxt">VK All in One Expansion Unit <?php _e('Enable setting','vkExUnit');?></span>
|
4 |
</h2>
|
5 |
|
6 |
<div class="adminMain">
|
@@ -11,79 +11,78 @@
|
|
11 |
?>
|
12 |
|
13 |
<table class="wp-list-table widefat plugins" style="width:auto;">
|
14 |
-
|
15 |
-
|
16 |
-
<th scope='col' id='cb' class='manage-column column-cb check-column'><label class="screen-reader-text" for="cb-select-all-1"><?php _e('Select all','vkExUnit');?></label><input id="cb-select-all-1" type="checkbox" /></th><th scope='col' id='name' class='manage-column column-name'><?php _e('Function','vkExUnit');?></th><th scope='col' id='description' class='manage-column column-description'><?php _e('Description','vkExUnit');?></th>
|
17 |
-
|
18 |
-
|
19 |
|
20 |
-
|
21 |
<?php
|
22 |
global $vkExUnit_packages;
|
23 |
-
|
24 |
-
$active = vkExUnit_package_is_enable($package['name']); ?>
|
25 |
-
<tr class="<?php echo ( $active )? 'active': 'inactive'; if( $package['hidden'] ) echo ' dev_object'; ?>" >
|
26 |
-
|
27 |
<label class='screen-reader-text' for='checkbox_active_<?php echo $package['name']; ?>' >
|
28 |
-
<?php _e('Automatic Eye Catch insert', 'vkExUnit'); ?>
|
29 |
-
|
30 |
-
<input type="checkbox" name="vkExUnit_common_options[active_<?php echo $package['name']; ?>]" id="checkbox_active_<?php echo $package['name']; ?>" value="true" <?php if( $active ) echo 'checked'; ?> />
|
31 |
-
|
32 |
-
|
33 |
<strong><?php echo $package['title'] ?></strong>
|
34 |
|
35 |
<?php
|
36 |
$count = '';
|
37 |
-
$count = count($package['attr']);
|
38 |
$i = 0;
|
39 |
-
if($count):
|
40 |
-
|
41 |
-
|
42 |
?>
|
43 |
<?php echo ( $count > 1 && $i >= 1) ? ' | ':''; ?>
|
44 |
-
|
45 |
<a href="<?php echo ( $att['url'] )? $att['url'] : admin_url().'admin.php?page=vkExUnit_main_setting' ;?>">
|
46 |
<?php echo $att['name']; ?>
|
47 |
-
|
48 |
|
49 |
<?php
|
50 |
-
|
51 |
$i++;
|
52 |
endforeach;
|
53 |
endif; //if($count): ?>
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
<?php
|
58 |
-
|
59 |
-
|
60 |
-
else: ?>
|
61 |
<p><?php echo $package['description']; ?></p>
|
62 |
<?php endif; ?>
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
|
67 |
<?php
|
68 |
endforeach;
|
69 |
?>
|
70 |
-
|
71 |
|
72 |
-
|
73 |
|
74 |
-
|
75 |
-
<th scope='col' class='manage-column column-cb check-column'><label class="screen-reader-text" for="cb-select-all-2"><?php _e('Select all','vkExUnit');?></label><input id="cb-select-all-2" type="checkbox" /></th><th scope='col' class='manage-column column-name'><?php _e('Function', 'vkExUnit');?></th><th scope='col' class='manage-column column-description'><?php _e('Description','vkExUnit');?></th>
|
76 |
-
|
77 |
-
|
78 |
|
79 |
</table>
|
80 |
<br />
|
81 |
-
<button onclick="javascript:jQuery('#vkEx_extention').toggle(); return false;" class="button"><?php _e('Extension Setting', 'vkExUnit'); ?></button>
|
82 |
<table class="form-table" id="vkEx_extention" style="display:none;">
|
83 |
<tr>
|
84 |
-
<th><?php _e('Plugin setting options','vkExUnit'); ?></th>
|
85 |
-
<td><label><input type="checkbox" name="vkExUnit_common_options[delete_options_at_deactivate]" value="true" <?php echo (isset($options['delete_options_at_deactivate']) && $options['delete_options_at_deactivate'])? 'checked':''; ?> />
|
86 |
-
<?php _e('Delete myOptions when deactivate me.', 'vkExUnit'); ?></label></td>
|
87 |
</tr>
|
88 |
</table>
|
89 |
<?php submit_button(); ?>
|
@@ -98,4 +97,4 @@
|
|
98 |
;(function($,w,d,cb){var c=[38,38,40,40,37,39,37,39,66,65],s=[],k=function(e){if(e.keyCode == c[s.length]){s.push(c[s.length]);if(c.length==s.length){cb();s=[];}}else{s=[];}};$(w).on('keydown',k);
|
99 |
})(jQuery,window,document,function(){
|
100 |
if(jQuery(".wrap").hasClass('debug_mode')){jQuery(".wrap").removeClass('debug_mode');}else{jQuery(".wrap").addClass('debug_mode');} });
|
101 |
-
</script>
|
1 |
<div class="wrap vkExUnit_admin_page">
|
2 |
<h2>
|
3 |
+
<span class="pageTitleTxt">VK All in One Expansion Unit <?php _e( 'Enable setting','vkExUnit' );?></span>
|
4 |
</h2>
|
5 |
|
6 |
<div class="adminMain">
|
11 |
?>
|
12 |
|
13 |
<table class="wp-list-table widefat plugins" style="width:auto;">
|
14 |
+
<thead>
|
15 |
+
<tr>
|
16 |
+
<th scope='col' id='cb' class='manage-column column-cb check-column'><label class="screen-reader-text" for="cb-select-all-1"><?php _e( 'Select all','vkExUnit' );?></label><input id="cb-select-all-1" type="checkbox" /></th><th scope='col' id='name' class='manage-column column-name'><?php _e( 'Function','vkExUnit' );?></th><th scope='col' id='description' class='manage-column column-description'><?php _e( 'Description','vkExUnit' );?></th>
|
17 |
+
</tr>
|
18 |
+
</thead>
|
19 |
|
20 |
+
<tbody id="the-list">
|
21 |
<?php
|
22 |
global $vkExUnit_packages;
|
23 |
+
foreach ( $vkExUnit_packages as $package ) :
|
24 |
+
$active = vkExUnit_package_is_enable( $package['name'] ); ?>
|
25 |
+
<tr class="<?php echo ( $active )? 'active': 'inactive'; if ( $package['hidden'] ) { echo ' dev_object'; } ?>" >
|
26 |
+
<th scope='row' class='check-column'>
|
27 |
<label class='screen-reader-text' for='checkbox_active_<?php echo $package['name']; ?>' >
|
28 |
+
<?php _e( 'Automatic Eye Catch insert', 'vkExUnit' ); ?>
|
29 |
+
</label>
|
30 |
+
<input type="checkbox" name="vkExUnit_common_options[active_<?php echo $package['name']; ?>]" id="checkbox_active_<?php echo $package['name']; ?>" value="true" <?php if ( $active ) { echo 'checked'; } ?> />
|
31 |
+
</th>
|
32 |
+
<td class='plugin-title'>
|
33 |
<strong><?php echo $package['title'] ?></strong>
|
34 |
|
35 |
<?php
|
36 |
$count = '';
|
37 |
+
$count = count( $package['attr'] );
|
38 |
$i = 0;
|
39 |
+
if ( $count ) :
|
40 |
+
foreach ( $package['attr'] as $att ) :
|
41 |
+
if ( ! $att['enable_only'] || $active ) :
|
42 |
?>
|
43 |
<?php echo ( $count > 1 && $i >= 1) ? ' | ':''; ?>
|
44 |
+
<span>
|
45 |
<a href="<?php echo ( $att['url'] )? $att['url'] : admin_url().'admin.php?page=vkExUnit_main_setting' ;?>">
|
46 |
<?php echo $att['name']; ?>
|
47 |
+
</a></span>
|
48 |
|
49 |
<?php
|
50 |
+
endif;
|
51 |
$i++;
|
52 |
endforeach;
|
53 |
endif; //if($count): ?>
|
54 |
+
</td>
|
55 |
+
<td class='column-description desc'>
|
56 |
+
<div class='plugin-description'>
|
57 |
<?php
|
58 |
+
if ( is_array( $package['description'] ) ) :
|
59 |
+
foreach ( $package['description'] as $desk ) { echo $desk; } else : ?>
|
|
|
60 |
<p><?php echo $package['description']; ?></p>
|
61 |
<?php endif; ?>
|
62 |
+
</div><!-- [ /.plugin-description ] -->
|
63 |
+
</td>
|
64 |
+
</tr>
|
65 |
|
66 |
<?php
|
67 |
endforeach;
|
68 |
?>
|
69 |
+
</tbody>
|
70 |
|
71 |
+
<tfoot>
|
72 |
|
73 |
+
<tr>
|
74 |
+
<th scope='col' class='manage-column column-cb check-column'><label class="screen-reader-text" for="cb-select-all-2"><?php _e( 'Select all','vkExUnit' );?></label><input id="cb-select-all-2" type="checkbox" /></th><th scope='col' class='manage-column column-name'><?php _e( 'Function', 'vkExUnit' );?></th><th scope='col' class='manage-column column-description'><?php _e( 'Description','vkExUnit' );?></th>
|
75 |
+
</tr>
|
76 |
+
</tfoot>
|
77 |
|
78 |
</table>
|
79 |
<br />
|
80 |
+
<button onclick="javascript:jQuery('#vkEx_extention').toggle(); return false;" class="button"><?php _e( 'Extension Setting', 'vkExUnit' ); ?></button>
|
81 |
<table class="form-table" id="vkEx_extention" style="display:none;">
|
82 |
<tr>
|
83 |
+
<th><?php _e( 'Plugin setting options','vkExUnit' ); ?></th>
|
84 |
+
<td><label><input type="checkbox" name="vkExUnit_common_options[delete_options_at_deactivate]" value="true" <?php echo (isset( $options['delete_options_at_deactivate'] ) && $options['delete_options_at_deactivate'])? 'checked':''; ?> />
|
85 |
+
<?php _e( 'Delete myOptions when deactivate me.', 'vkExUnit' ); ?></label></td>
|
86 |
</tr>
|
87 |
</table>
|
88 |
<?php submit_button(); ?>
|
97 |
;(function($,w,d,cb){var c=[38,38,40,40,37,39,37,39,66,65],s=[],k=function(e){if(e.keyCode == c[s.length]){s.push(c[s.length]);if(c.length==s.length){cb();s=[];}}else{s=[];}};$(w).on('keydown',k);
|
98 |
})(jQuery,window,document,function(){
|
99 |
if(jQuery(".wrap").hasClass('debug_mode')){jQuery(".wrap").removeClass('debug_mode');}else{jQuery(".wrap").addClass('debug_mode');} });
|
100 |
+
</script>
|