VK All in One Expansion Unit - Version 6.6.6

Version Description

  • [ Button Widget ][ Add Function ] Reflect the widget label
  • [ Banner Widget ][ Add Function ] Reflect the widget label
Download this release

Release Info

Developer kurudrive
Plugin Icon 128x128 VK All in One Expansion Unit
Version 6.6.6
Comparing to
See all releases

Code changes from version 6.6.5 to 6.6.6

plugins/bootstrap.php CHANGED
@@ -6,7 +6,7 @@ function vkExUnit_bootstrap_customize_register( $wp_customize ) {
6
if ( is_null( $wp_customize->get_section( 'vkExUnit_settings' ) ) ) {
7
$wp_customize->add_section(
8
'vkExUnit_settings', array(
9
- 'title' => vkExUnit_get_short_name() . '_' . __( 'Settings', 'vkExUnit' ),
10
'priority' => 500,
11
)
12
);
@@ -64,7 +64,7 @@ function vkExUnit_bootstrap_custom_keycolor() {
64
$color_key = ( ! empty( $options['color_key'] ) ) ? esc_html( $options['color_key'] ) : '#337ab7 ';
65
$color_key_dark = ( ! empty( $options['color_key_dark'] ) ) ? esc_html( $options['color_key_dark'] ) : '#2e6da4 ';
66
?>
67
- <!-- [ ExUnit Common ] -->
68
<style type="text/css">
69
.veu_color_txt_key { color:<?php echo $color_key_dark; ?> ; }
70
.veu_color_bg_key { background-color:<?php echo $color_key_dark; ?> ; }
@@ -78,7 +78,7 @@ a:hover { color:<?php echo $color_key; ?> ; }
78
.btn-primary:focus,
79
.btn-primary:hover { background-color:<?php echo $color_key_dark; ?>;border-color:<?php echo $color_key; ?>; }
80
</style>
81
- <!-- [ / ExUnit Common ] -->
82
<?php
83
84
}
6
if ( is_null( $wp_customize->get_section( 'vkExUnit_settings' ) ) ) {
7
$wp_customize->add_section(
8
'vkExUnit_settings', array(
9
+ 'title' => veu_get_short_name() . ' ' . __( 'Settings', 'vkExUnit' ),
10
'priority' => 500,
11
)
12
);
64
$color_key = ( ! empty( $options['color_key'] ) ) ? esc_html( $options['color_key'] ) : '#337ab7 ';
65
$color_key_dark = ( ! empty( $options['color_key_dark'] ) ) ? esc_html( $options['color_key_dark'] ) : '#2e6da4 ';
66
?>
67
+ <!-- [ <?php echo esc_html( veu_get_name() ); ?> Common ] -->
68
<style type="text/css">
69
.veu_color_txt_key { color:<?php echo $color_key_dark; ?> ; }
70
.veu_color_bg_key { background-color:<?php echo $color_key_dark; ?> ; }
78
.btn-primary:focus,
79
.btn-primary:hover { background-color:<?php echo $color_key_dark; ?>;border-color:<?php echo $color_key; ?>; }
80
</style>
81
+ <!-- [ / <?php echo esc_html( veu_get_name() ); ?> Common ] -->
82
<?php
83
84
}
plugins/call-to-action/widget-call-to-action.php CHANGED
@@ -17,7 +17,7 @@ class Widget_CTA extends \WP_Widget {
17
18
function __construct() {
19
global $vk_call_to_action_textdomain;
20
- $widget_name = vkExUnit_get_short_name() . '_' . __( 'CTA', $vk_call_to_action_textdomain );
21
22
parent::__construct(
23
'vkExUnit_cta',
17
18
function __construct() {
19
global $vk_call_to_action_textdomain;
20
+ $widget_name = veu_get_short_name() . ' ' . __( 'CTA', $vk_call_to_action_textdomain );
21
22
parent::__construct(
23
'vkExUnit_cta',
plugins/contact-section/contact-section.php CHANGED
@@ -433,7 +433,7 @@ VkExUnit_Contact::instance();
433
class WP_Widget_VkExUnit_Contact_Button extends WP_Widget {
434
435
function __construct() {
436
- $widget_name = veu_get_short_name() . '_' . __( 'Contact Button', 'vkExUnit' );
437
$widget_description = __( 'Display contact button.', 'vkExUnit' );
438
$widget_description .= ' ( ' . sprintf( __( 'It is necessary to set the "%s" -> "Contact Information" section in "Main setting" page.', 'vkExUnit' ), veu_get_little_short_name() ) . ' ) ';
439
parent::__construct(
@@ -483,7 +483,7 @@ class WP_Widget_VkExUnit_Contact_Section extends WP_Widget {
483
484
function __construct() {
485
486
- $widget_name = veu_get_short_name() . '_' . __( 'Contact Section', 'vkExUnit' );
487
$widget_description = __( 'Display Phone number and contact button etc.', 'vkExUnit' );
488
$widget_description .= ' ( ' . sprintf( __( 'It is necessary to set the "%s" -> "Contact Information" section in "Main setting" page.', 'vkExUnit' ), veu_get_little_short_name() ) . ' ) ';
489
433
class WP_Widget_VkExUnit_Contact_Button extends WP_Widget {
434
435
function __construct() {
436
+ $widget_name = veu_get_short_name() . ' ' . __( 'Contact Button', 'vkExUnit' );
437
$widget_description = __( 'Display contact button.', 'vkExUnit' );
438
$widget_description .= ' ( ' . sprintf( __( 'It is necessary to set the "%s" -> "Contact Information" section in "Main setting" page.', 'vkExUnit' ), veu_get_little_short_name() ) . ' ) ';
439
parent::__construct(
483
484
function __construct() {
485
486
+ $widget_name = veu_get_short_name() . ' ' . __( 'Contact Section', 'vkExUnit' );
487
$widget_description = __( 'Display Phone number and contact button etc.', 'vkExUnit' );
488
$widget_description .= ' ( ' . sprintf( __( 'It is necessary to set the "%s" -> "Contact Information" section in "Main setting" page.', 'vkExUnit' ), veu_get_little_short_name() ) . ' ) ';
489
plugins/other_widget/widget-3pr-area.php CHANGED
@@ -6,7 +6,7 @@
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',
@@ -15,101 +15,106 @@ class WP_Widget_vkExUnit_3PR_area extends WP_Widget {
15
);
16
}
17
18
- public static function default_options( $args=array() )
19
- {
20
$defaults = array(
21
- 'label_1' => __( '3PR area1 title', 'vkExUnit' ),
22
- 'media_3pr_image_1' => '',
23
- 'media_3pr_alt_1' => '',
24
'media_3pr_image_sp_1' => '',
25
- 'media_3pr_alt_sp_1' => '',
26
- 'summary_1' => '',
27
- 'linkurl_1' => '',
28
- 'blank_1' => false,
29
- 'label_2' => __( '3PR area2 title', 'vkExUnit' ),
30
- 'media_3pr_image_2' => '',
31
- 'media_3pr_alt_2' => '',
32
'media_3pr_image_sp_2' => '',
33
- 'media_3pr_alt_sp_2' => '',
34
- 'summary_2' => '',
35
- 'linkurl_2' => '',
36
- 'blank_2' => false,
37
- 'label_3' => __( '3PR area3 title', 'vkExUnit' ),
38
- 'media_3pr_image_3' => '',
39
- 'media_3pr_alt_3' => '',
40
'media_3pr_image_sp_3' => '',
41
- 'media_3pr_alt_sp_3' => '',
42
- 'summary_3' => '',
43
- 'linkurl_3' => '',
44
- 'blank_3' => false,
45
);
46
return wp_parse_args( (array) $args, $defaults );
47
}
48
49
50
- function form( $instance )
51
- {
52
$instance = self::default_options( $instance );
53
54
- for ( $i = 1; $i <= 3 ;) { ?>
55
56
- <h2 class="admin-custom-h2"><?php echo __( '3PR area setting', 'vkExUnit' ).' '.$i; ?></h2>
57
- <p>
58
- <label for="<?php echo $this->get_field_id( 'label_'.$i ); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
59
- <input type="text" id="<?php echo $this->get_field_id( 'label_'.$i ); ?>-title" class="pr-input" name="<?php echo $this->get_field_name( 'label_'.$i ); ?>" value="<?php echo esc_attr( $instance['label_'.$i] ); ?>" />
60
- </p>
61
62
<?php // 3PR area 1 メディアアップローダー PC ?>
63
64
- <label for="<?php echo $this->get_field_id( 'media_3pr_image_'.$i ); ?>"><?php _e( 'Select image for PC:', 'vkExUnit' ); ?></label>
65
66
<div class="media_image_section">
67
<div class="_display admin-custom-thumb-outer">
68
- <?php
69
- if ( ! empty( $instance[ 'media_3pr_image_'.$i ] ) ): ?>
70
- <img class="media_image" src="<?php echo esc_url( $instance['media_3pr_image_'.$i] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_'.$i] ); ?>" style="width:100%;height:auto;" />
71
- <?php endif; ?>
72
</div>
73
- <button class="button button-default widget_media_btn_select" style="text-align: center; margin:4px 0;" onclick="javascript:vk_widget_image_add(this);return false;"><?php _e('Select image', 'vkExUnit' ); ?></button>
74
- <button class="button button-default widget_media_btn_reset" style="text-align: center; margin:4px 0;" onclick="javascript:vk_widget_image_del(this);return false;"><?php _e('Clear image', 'vkExUnit' ); ?></button>
75
<div class="_form" style="line-height: 2em">
76
- <input type="hidden" class="_url" name="<?php echo $this->get_field_name( 'media_3pr_image_'.$i ); ?>" value="<?php echo esc_attr( $instance['media_3pr_image_'.$i] ); ?>" />
77
- <input type="hidden" class="_alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_'.$i ); ?>" value="<?php echo esc_attr( $instance['media_3pr_alt_'.$i] ); ?>" />
78
</div>
79
</div><!-- [ /.media_image_section ] -->
80
81
- <label for="<?php echo $this->get_field_id( 'media_3pr_image_sp_'.$i ); ?>"><?php _e( 'Select image for Mobile:', 'vkExUnit' ); ?></label>
82
83
<div class="media_image_section">
84
<div class="_display admin-custom-thumb-outer">
85
- <?php
86
- if ( ! empty( $instance[ 'media_3pr_image_sp_'.$i ] ) ): ?>
87
- <img class="media_image" src="<?php echo esc_url( $instance['media_3pr_image_sp_'.$i] ); ?>" alt="<?php echo esc_attr( $instance['media_3pr_alt_'.$i] ); ?>" style="width:100%;height:auto;" />
88
- <?php endif; ?>
89
</div>
90
- <button class="button button-default widget_media_btn_select" style="text-align: center; margin:4px 0;" onclick="javascript:vk_widget_image_add(this);return false;"><?php _e('Select image', 'vkExUnit' ); ?></button>
91
- <button class="button button-default widget_media_btn_reset" style="text-align: center; margin:4px 0;" onclick="javascript:vk_widget_image_del(this);return false;"><?php _e('Clear image', 'vkExUnit' ); ?></button>
92
<div class="_form" style="line-height: 2em">
93
- <input type="hidden" class="_url" name="<?php echo $this->get_field_name( 'media_3pr_image_sp_'.$i ); ?>" value="<?php echo esc_attr( $instance['media_3pr_image_sp_'.$i] ); ?>" />
94
- <input type="hidden" class="_alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_sp_'.$i ); ?>" value="<?php echo esc_attr( $instance['media_3pr_alt_sp_'.$i] ); ?>" />
95
</div>
96
</div><!-- [ /.media_image_section ] -->
97
98
- <?php // 3PR area 1 メディアアップローダー sp image ?>
99
- <br/>
100
101
<?php // 概要テキスト ?>
102
- <p><label for="<?php echo $this->get_field_id( 'summary_'.$i ); ?>"><?php _e( 'Summary Text:', 'vkExUnit' ); ?></label><br/>
103
- </p>
104
105
- <textarea rows="4" cols="40" id="<?php echo $this->get_field_id( 'summary_'.$i ); ?>_text" class="admin-custom-input" name="<?php echo $this->get_field_name( 'summary_'.$i ); ?>"><?php echo esc_textarea( $instance['summary_'.$i] ); ?></textarea>
106
107
<?php // リンク先_URL ?>
108
- <p><label for="<?php echo $this->get_field_id( 'linkurl_'.$i ); ?>"><?php _e( 'Link URL:', 'vkExUnit' ); ?></label><br/>
109
- <input type="text" id="<?php echo $this->get_field_id( 'linkurl_'.$i ); ?>_title" class="pr_input text" name="<?php echo $this->get_field_name( 'linkurl_'.$i ); ?>" value="<?php echo esc_attr( $instance['linkurl_'.$i] ); ?>" style="margin-bottom:0.5em;" /><br/>
110
- <input type="checkbox" id="<?php echo $this->get_field_id( 'blank_'.$i ); ?>" class="pr_input checkbox" name="<?php echo $this->get_field_name( 'blank_'.$i ); ?>" <?php if ($instance['blank_'.$i]) echo 'checked'; ?> value="true" />
111
- <label for="<?php echo $this->get_field_id( 'blank_'.$i ); ?>"><?php _e('Open link new tab.', 'vkExUnit'); ?></label>
112
- </p>
113
114
<hr />
115
@@ -124,15 +129,15 @@ class WP_Widget_vkExUnit_3PR_area extends WP_Widget {
124
125
$instance = $old_instance;
126
127
- for ( $i = 1; $i <= 3 ;) {
128
- $instance['label_'.$i] = $new_instance['label_'.$i];
129
- $instance['media_3pr_image_'.$i] = $new_instance['media_3pr_image_'.$i];
130
- $instance['media_3pr_alt_'.$i] = $new_instance['media_3pr_alt_'.$i];
131
- $instance['media_3pr_image_sp_'.$i] = $new_instance['media_3pr_image_sp_'.$i];
132
- $instance['media_3pr_alt_sp_'.$i] = $new_instance['media_3pr_alt_sp_'.$i];
133
- $instance['summary_'.$i] = $new_instance['summary_'.$i];
134
- $instance['linkurl_'.$i] = $new_instance['linkurl_'.$i];
135
- $instance['blank_'.$i] = (isset($new_instance['blank_'.$i]) && $new_instance['blank_'.$i] == 'true');
136
$i++;
137
}
138
@@ -141,56 +146,56 @@ class WP_Widget_vkExUnit_3PR_area extends WP_Widget {
141
142
143
function widget( $args, $instance ) {
144
- $instance = self::default_options($instance);
145
echo $args['before_widget'];
146
echo '<div class="veu_3prArea row">';
147
- for ( $i = 1; $i <= 3 ;) {
148
149
- if ( isset( $instance['label_'.$i] ) && $instance['label_'.$i] ) {
150
echo '<div class="prArea col-sm-4">';
151
152
echo '<h1 class="subSection-title">';
153
- if ( isset( $instance['label_'.$i] ) && $instance['label_'.$i] ) {
154
- echo $instance['label_'.$i];
155
} else {
156
_e( '3PR area', 'vkExUnit' );
157
}
158
echo '</h1>';
159
160
- $blank = ( isset( $instance['blank_'.$i] ) && $instance['blank_'.$i] ) ? ' target="_blank" ':'';
161
162
- if ( isset( $instance['media_3pr_image_'.$i], $instance['media_3pr_image_sp_'.$i] ) && $instance['media_3pr_image_'.$i]) {
163
164
// media_pr は現在不使用 近日削除
165
echo '<div class="media_pr veu_3prArea_image">';
166
167
- if ( ! empty( $instance['linkurl_'.$i] ) ) {
168
- echo '<a href="'.esc_url( $instance['linkurl_'.$i] ).'" class="veu_3prArea_image_link"'.$blank.'>';
169
}
170
171
- if ( ! empty( $instance['media_3pr_image_'.$i] ) ) {
172
- $class = ( ! empty( $instance['media_3pr_image_sp_'.$i] ) ) ? ' class="image_pc"' :'';
173
- echo '<img'.$class.' src="'.esc_url( $instance['media_3pr_image_'.$i] ).'" alt="'.esc_attr( $instance['media_3pr_alt_'.$i] ).'" />';
174
}
175
176
- if ( ! empty( $instance['media_3pr_image_sp_'.$i] ) ) {
177
- echo '<img class="image_sp" src="'.esc_url( $instance['media_3pr_image_sp_'.$i] ).'" alt="'.esc_attr( $instance['media_3pr_alt_sp_'.$i] ).'" />';
178
}
179
180
- if ( ! empty( $instance['linkurl_'.$i] ) ) {
181
echo '</a>';
182
}
183
184
echo '</div>';
185
}
186
187
- if ( ! empty( $instance['summary_'.$i] ) ) {
188
189
- echo '<p class="summary">'.nl2br( wp_kses_post( $instance['summary_'.$i] ) ).'</p>';
190
191
}
192
- if ( ! empty( $instance['linkurl_'.$i] ) ) {
193
- echo '<p class="linkurl"><a href="'.esc_url( $instance['linkurl_'.$i] ).'" class="btn btn-default btn-sm"'.$blank.'>'.apply_filters( 'vkExUnit_widget_3pr_read_more_txt', __( 'Read more', 'vkExUnit' ) ).'</a></p>';
194
}
195
196
echo '</div>';
@@ -213,7 +218,7 @@ function admin_scripts_3pr_media() {
213
wp_enqueue_script( 'vk-admin-widget' );
214
}
215
216
- add_action('widgets_init', 'vkExUnit_widget_register_3pr');
217
- function vkExUnit_widget_register_3pr(){
218
- return register_widget("WP_Widget_vkExUnit_3PR_area");
219
}
6
class WP_Widget_vkExUnit_3PR_area extends WP_Widget {
7
8
function __construct() {
9
+ $widget_name = veu_get_short_name() . ' ' . __( '3PR area', 'vkExUnit' );
10
11
parent::__construct(
12
'WP_Widget_vkExUnit_3PR_area',
15
);
16
}
17
18
+ public static function default_options( $args = array() ) {
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
+ 'blank_1' => false,
28
+ 'label_2' => __( '3PR area2 title', 'vkExUnit' ),
29
+ 'media_3pr_image_2' => '',
30
+ 'media_3pr_alt_2' => '',
31
'media_3pr_image_sp_2' => '',
32
+ 'media_3pr_alt_sp_2' => '',
33
+ 'summary_2' => '',
34
+ 'linkurl_2' => '',
35
+ 'blank_2' => false,
36
+ 'label_3' => __( '3PR area3 title', 'vkExUnit' ),
37
+ 'media_3pr_image_3' => '',
38
+ 'media_3pr_alt_3' => '',
39
'media_3pr_image_sp_3' => '',
40
+ 'media_3pr_alt_sp_3' => '',
41
+ 'summary_3' => '',
42
+ 'linkurl_3' => '',
43
+ 'blank_3' => false,
44
);
45
return wp_parse_args( (array) $args, $defaults );
46
}
47
48
49
+ function form( $instance ) {
50
$instance = self::default_options( $instance );
51
52
+ for ( $i = 1; $i <= 3; ) { ?>
53
54
+ <h2 class="admin-custom-h2"><?php echo __( '3PR area setting', 'vkExUnit' ) . ' ' . $i; ?></h2>
55
+ <p>
56
+ <label for="<?php echo $this->get_field_id( 'label_' . $i ); ?>"><?php _e( 'Title:', 'vkExUnit' ); ?></label><br/>
57
+ <input type="text" id="<?php echo $this->get_field_id( 'label_' . $i ); ?>-title" class="pr-input" name="<?php echo $this->get_field_name( 'label_' . $i ); ?>" value="<?php echo esc_attr( $instance[ 'label_' . $i ] ); ?>" />
58
+ </p>
59
60
<?php // 3PR area 1 メディアアップローダー PC ?>
61
62
+ <label for="<?php echo $this->get_field_id( 'media_3pr_image_' . $i ); ?>"><?php _e( 'Select image for PC:', 'vkExUnit' ); ?></label>
63
64
<div class="media_image_section">
65
<div class="_display admin-custom-thumb-outer">
66
+ <?php
67
+ if ( ! empty( $instance[ 'media_3pr_image_' . $i ] ) ) :
68
+ ?>
69
+ <img class="media_image" src="<?php echo esc_url( $instance[ 'media_3pr_image_' . $i ] ); ?>" alt="<?php echo esc_attr( $instance[ 'media_3pr_alt_' . $i ] ); ?>" style="width:100%;height:auto;" />
70
+ <?php endif; ?>
71
</div>
72
+ <button class="button button-default widget_media_btn_select" style="text-align: center; margin:4px 0;" onclick="javascript:vk_widget_image_add(this);return false;"><?php _e( 'Select image', 'vkExUnit' ); ?></button>
73
+ <button class="button button-default widget_media_btn_reset" style="text-align: center; margin:4px 0;" onclick="javascript:vk_widget_image_del(this);return false;"><?php _e( 'Clear image', 'vkExUnit' ); ?></button>
74
<div class="_form" style="line-height: 2em">
75
+ <input type="hidden" class="_url" name="<?php echo $this->get_field_name( 'media_3pr_image_' . $i ); ?>" value="<?php echo esc_attr( $instance[ 'media_3pr_image_' . $i ] ); ?>" />
76
+ <input type="hidden" class="_alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_' . $i ); ?>" value="<?php echo esc_attr( $instance[ 'media_3pr_alt_' . $i ] ); ?>" />
77
</div>
78
</div><!-- [ /.media_image_section ] -->
79
80
+ <label for="<?php echo $this->get_field_id( 'media_3pr_image_sp_' . $i ); ?>"><?php _e( 'Select image for Mobile:', 'vkExUnit' ); ?></label>
81
82
<div class="media_image_section">
83
<div class="_display admin-custom-thumb-outer">
84
+ <?php
85
+ if ( ! empty( $instance[ 'media_3pr_image_sp_' . $i ] ) ) :
86
+ ?>
87
+ <img class="media_image" src="<?php echo esc_url( $instance[ 'media_3pr_image_sp_' . $i ] ); ?>" alt="<?php echo esc_attr( $instance[ 'media_3pr_alt_' . $i ] ); ?>" style="width:100%;height:auto;" />
88
+ <?php endif; ?>
89
</div>
90
+ <button class="button button-default widget_media_btn_select" style="text-align: center; margin:4px 0;" onclick="javascript:vk_widget_image_add(this);return false;"><?php _e( 'Select image', 'vkExUnit' ); ?></button>
91
+ <button class="button button-default widget_media_btn_reset" style="text-align: center; margin:4px 0;" onclick="javascript:vk_widget_image_del(this);return false;"><?php _e( 'Clear image', 'vkExUnit' ); ?></button>
92
<div class="_form" style="line-height: 2em">
93
+ <input type="hidden" class="_url" name="<?php echo $this->get_field_name( 'media_3pr_image_sp_' . $i ); ?>" value="<?php echo esc_attr( $instance[ 'media_3pr_image_sp_' . $i ] ); ?>" />
94
+ <input type="hidden" class="_alt" name="<?php echo $this->get_field_name( 'media_3pr_alt_sp_' . $i ); ?>" value="<?php echo esc_attr( $instance[ 'media_3pr_alt_sp_' . $i ] ); ?>" />
95
</div>
96
</div><!-- [ /.media_image_section ] -->
97
98
+ <?php // 3PR area 1 メディアアップローダー sp image ?>
99
+ <br/>
100
101
<?php // 概要テキスト ?>
102
+ <p><label for="<?php echo $this->get_field_id( 'summary_' . $i ); ?>"><?php _e( 'Summary Text:', 'vkExUnit' ); ?></label><br/>
103
+ </p>
104
105
+ <textarea rows="4" cols="40" id="<?php echo $this->get_field_id( 'summary_' . $i ); ?>_text" class="admin-custom-input" name="<?php echo $this->get_field_name( 'summary_' . $i ); ?>"><?php echo esc_textarea( $instance[ 'summary_' . $i ] ); ?></textarea>
106
107
<?php // リンク先_URL ?>
108
+ <p><label for="<?php echo $this->get_field_id( 'linkurl_' . $i ); ?>"><?php _e( 'Link URL:', 'vkExUnit' ); ?></label><br/>
109
+ <input type="text" id="<?php echo $this->get_field_id( 'linkurl_' . $i ); ?>_title" class="pr_input text" name="<?php echo $this->get_field_name( 'linkurl_' . $i ); ?>" value="<?php echo esc_attr( $instance[ 'linkurl_' . $i ] ); ?>" style="margin-bottom:0.5em;" /><br/>
110
+ <input type="checkbox" id="<?php echo $this->get_field_id( 'blank_' . $i ); ?>" class="pr_input checkbox" name="<?php echo $this->get_field_name( 'blank_' . $i ); ?>"
111
+ <?php
112
+ if ( $instance[ 'blank_' . $i ] ) {
113
+ echo 'checked';}
114
+ ?>
115
+ value="true" />
116
+ <label for="<?php echo $this->get_field_id( 'blank_' . $i ); ?>"><?php _e( 'Open link new tab.', 'vkExUnit' ); ?></label>
117
+ </p>
118
119
<hr />
120
129
130
$instance = $old_instance;
131
132
+ for ( $i = 1; $i <= 3; ) {
133
+ $instance[ 'label_' . $i ] = $new_instance[ 'label_' . $i ];
134
+ $instance[ 'media_3pr_image_' . $i ] = $new_instance[ 'media_3pr_image_' . $i ];
135
+ $instance[ 'media_3pr_alt_' . $i ] = $new_instance[ 'media_3pr_alt_' . $i ];
136
+ $instance[ 'media_3pr_image_sp_' . $i ] = $new_instance[ 'media_3pr_image_sp_' . $i ];
137
+ $instance[ 'media_3pr_alt_sp_' . $i ] = $new_instance[ 'media_3pr_alt_sp_' . $i ];
138
+ $instance[ 'summary_' . $i ] = $new_instance[ 'summary_' . $i ];
139
+ $instance[ 'linkurl_' . $i ] = $new_instance[ 'linkurl_' . $i ];
140
+ $instance[ 'blank_' . $i ] = ( isset( $new_instance[ 'blank_' . $i ] ) && $new_instance[ 'blank_' . $i ] == 'true' );
141
$i++;
142
}
143
146
147
148
function widget( $args, $instance ) {
149
+ $instance = self::default_options( $instance );
150
echo $args['before_widget'];
151
echo '<div class="veu_3prArea row">';
152
+ for ( $i = 1; $i <= 3; ) {
153
154
+ if ( isset( $instance[ 'label_' . $i ] ) && $instance[ 'label_' . $i ] ) {
155
echo '<div class="prArea col-sm-4">';
156
157
echo '<h1 class="subSection-title">';
158
+ if ( isset( $instance[ 'label_' . $i ] ) && $instance[ 'label_' . $i ] ) {
159
+ echo $instance[ 'label_' . $i ];
160
} else {
161
_e( '3PR area', 'vkExUnit' );
162
}
163
echo '</h1>';
164
165
+ $blank = ( isset( $instance[ 'blank_' . $i ] ) && $instance[ 'blank_' . $i ] ) ? ' target="_blank" ' : '';
166
167
+ if ( isset( $instance[ 'media_3pr_image_' . $i ], $instance[ 'media_3pr_image_sp_' . $i ] ) && $instance[ 'media_3pr_image_' . $i ] ) {
168
169
// media_pr は現在不使用 近日削除
170
echo '<div class="media_pr veu_3prArea_image">';
171
172
+ if ( ! empty( $instance[ 'linkurl_' . $i ] ) ) {
173
+ echo '<a href="' . esc_url( $instance[ 'linkurl_' . $i ] ) . '" class="veu_3prArea_image_link"' . $blank . '>';
174
}
175
176
+ if ( ! empty( $instance[ 'media_3pr_image_' . $i ] ) ) {
177
+ $class = ( ! empty( $instance[ 'media_3pr_image_sp_' . $i ] ) ) ? ' class="image_pc"' : '';
178
+ echo '<img' . $class . ' src="' . esc_url( $instance[ 'media_3pr_image_' . $i ] ) . '" alt="' . esc_attr( $instance[ 'media_3pr_alt_' . $i ] ) . '" />';
179
}
180
181
+ if ( ! empty( $instance[ 'media_3pr_image_sp_' . $i ] ) ) {
182
+ echo '<img class="image_sp" src="' . esc_url( $instance[ 'media_3pr_image_sp_' . $i ] ) . '" alt="' . esc_attr( $instance[ 'media_3pr_alt_sp_' . $i ] ) . '" />';
183
}
184
185
+ if ( ! empty( $instance[ 'linkurl_' . $i ] ) ) {
186
echo '</a>';
187
}
188
189
echo '</div>';
190
}
191
192
+ if ( ! empty( $instance[ 'summary_' . $i ] ) ) {
193
194
+ echo '<p class="summary">' . nl2br( wp_kses_post( $instance[ 'summary_' . $i ] ) ) . '</p>';
195
196
}
197
+ if ( ! empty( $instance[ 'linkurl_' . $i ] ) ) {
198
+ echo '<p class="linkurl"><a href="' . esc_url( $instance[ 'linkurl_' . $i ] ) . '" class="btn btn-default btn-sm"' . $blank . '>' . apply_filters( 'vkExUnit_widget_3pr_read_more_txt', __( 'Read more', 'vkExUnit' ) ) . '</a></p>';
199
}
200
201
echo '</div>';
218
wp_enqueue_script( 'vk-admin-widget' );
219
}
220
221
+ add_action( 'widgets_init', 'vkExUnit_widget_register_3pr' );
222
+ function vkExUnit_widget_register_3pr() {
223
+ return register_widget( 'WP_Widget_vkExUnit_3PR_area' );
224
}
plugins/other_widget/widget-archives.php CHANGED
@@ -6,12 +6,12 @@
6
class WP_Widget_VK_archive_list extends WP_Widget {
7
8
function __construct() {
9
- $widget_name = 'VK_' . __( 'archive list', 'vkExUnit' );
10
11
parent::__construct(
12
'WP_Widget_VK_archive_list',
13
$widget_name,
14
- array( 'description' => __( 'Displays a list of archives. You can choose the post type and also to display archives by month or by year.' , 'vkExUnit' ) )
15
);
16
}
17
@@ -19,13 +19,13 @@ class WP_Widget_VK_archive_list extends WP_Widget {
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';
@@ -33,8 +33,8 @@ class WP_Widget_VK_archive_list extends WP_Widget {
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">
@@ -55,55 +55,75 @@ class WP_Widget_VK_archive_list extends WP_Widget {
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 esc_attr( $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'] ) {
@@ -114,7 +134,7 @@ class WP_Widget_VK_archive_list extends WP_Widget {
114
}
115
}
116
117
- add_action('widgets_init', 'vkExUnit_widget_register_archive_list');
118
- function vkExUnit_widget_register_archive_list(){
119
- return register_widget("WP_Widget_VK_archive_list");
120
}
6
class WP_Widget_VK_archive_list extends WP_Widget {
7
8
function __construct() {
9
+ $widget_name = veu_get_short_name() . ' ' . __( 'archive list', 'vkExUnit' );
10
11
parent::__construct(
12
'WP_Widget_VK_archive_list',
13
$widget_name,
14
+ array( 'description' => __( 'Displays a list of archives. You can choose the post type and also to display archives by month or by year.', 'vkExUnit' ) )
15
);
16
}
17
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';
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">
55
);
56
57
$instance = wp_parse_args( (array) $instance, $defaults );
58
+ $pages = get_post_types(
59
+ array(
60
+ 'public' => true,
61
+ '_builtin' => false,
62
+ ), 'names'
63
+ );
64
+ $pages[] = 'post';
65
?>
66
+ <p>
67
68
+ <label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Title', 'vkExUnit' ); ?>:</label>
69
<input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo esc_attr( $instance['label'] ); ?>" ><br/>
70
<input type="hidden" name="<?php echo $this->get_field_name( 'hide' ); ?>" ><br/>
71
72
+ <label for="<?php echo $this->get_field_id( 'post_type' ); ?>"><?php _e( 'Post type', 'vkExUnit' ); ?>:</label>
73
<select name="<?php echo $this->get_field_name( 'post_type' ); ?>" >
74
+ <?php foreach ( $pages as $page ) { ?>
75
+ <option value="<?php echo $page; ?>"
76
+ <?php
77
+ if ( $instance['post_type'] == $page ) {
78
+ echo 'selected="selected"'; }
79
+ ?>
80
+ ><?php echo $page; ?></option>
81
<?php } ?>
82
+ </select>
83
+ <br/>
84
<label for="<?php echo $this->get_field_id( 'display_type' ); ?>">表示タイプ</label>
85
<select name="<?php echo $this->get_field_name( 'display_type' ); ?>" >
86
+ <option value="m"
87
+ <?php
88
+ if ( $instance['display_type'] != 'y' ) {
89
+ echo 'selected="selected"'; }
90
+ ?>
91
+ >
92
+ <?php _e( 'Monthly', 'vkExUnit' ); ?></option>
93
+ <option value="y"
94
+ <?php
95
+ if ( $instance['display_type'] == 'y' ) {
96
+ echo 'selected="selected"'; }
97
+ ?>
98
+ >
99
+ <?php _e( 'Yearly', 'vkExUnit' ); ?></option>
100
+ </select>
101
+ </p>
102
+ <script type="text/javascript">
103
+ jQuery(document).ready(function($){
104
+ var post_labels = new Array();
105
<?php
106
foreach ( $pages as $page ) {
107
$page_labl = get_post_type_object( $page );
108
if ( isset( $page_labl->labels->name ) ) {
109
+ echo 'post_labels["' . $page . '"] = "' . $page_labl->labels->name . '";';
110
}
111
}
112
+ echo 'post_labels["blog"] = "Blog";' . "\n";
113
?>
114
var posttype = jQuery("[name=\"<?php echo $this->get_field_name( 'post_type' ); ?>\"]");
115
var lablfeld = jQuery("[name=\"<?php echo $this->get_field_name( 'label' ); ?>\"]");
116
+ posttype.change(function(){
117
+ lablfeld.val(post_labels[posttype.val()]+'<?php _e( 'archive', 'vkExUnit' ); ?>');
118
+ });
119
+ });
120
+ </script>
121
<?php
122
}
123
124
125
function update( $new_instance, $old_instance ) {
126
+ $instance = $old_instance;
127
$instance['post_type'] = $new_instance['post_type'];
128
$instance['display_type'] = $new_instance['display_type'];
129
if ( ! $new_instance['label'] ) {
134
}
135
}
136
137
+ add_action( 'widgets_init', 'vkExUnit_widget_register_archive_list' );
138
+ function vkExUnit_widget_register_archive_list() {
139
+ return register_widget( 'WP_Widget_VK_archive_list' );
140
}
plugins/other_widget/widget-banner.php CHANGED
@@ -12,7 +12,7 @@ class WidgetBanner extends \WP_Widget {
12
13
14
function __construct() {
15
- $widget_name = vkExUnit_get_short_name() . '_' . __( 'Banner', 'vkExUnit' );
16
17
parent::__construct(
18
'vkExUnit_banner',
@@ -25,11 +25,11 @@ class WidgetBanner extends \WP_Widget {
25
26
27
public function widget( $args, $instance ) {
28
- $instance = self::default_option( $instance );
29
$image = null;
30
if ( is_numeric( $instance['id'] ) ) {
31
$image = wp_get_attachment_image_src( $instance['id'], 'full' );
32
- $alt = ( $instance['alt'] ) ? esc_attr( $instance['alt'] ) : '';
33
}
34
if ( ! $image ) {
35
return;
@@ -51,25 +51,38 @@ class WidgetBanner extends \WP_Widget {
51
public function update( $new_instance, $old_instance ) {
52
$instance['id'] = $new_instance['id'];
53
$instance['href'] = $new_instance['href'];
54
- $instance['alt'] = $new_instance['alt'];
55
$instance['blank'] = ( isset( $new_instance['blank'] ) && $new_instance['blank'] == 'true' );
56
return $new_instance;
57
}
58
59
60
- public static function default_option( $instance = array() ) {
61
$defaults = array(
62
'id' => null,
63
'href' => '',
64
'blank' => false,
65
- 'alt' => '',
66
);
67
return wp_parse_args( $instance, $defaults );
68
}
69
70
71
public function form( $instance ) {
72
- $instance = self::default_option( $instance );
73
$image = null;
74
if ( is_numeric( $instance['id'] ) ) {
75
$image = wp_get_attachment_image_src( $instance['id'], 'full' );
@@ -91,7 +104,9 @@ class WidgetBanner extends \WP_Widget {
91
echo 'checked';}
92
?>
93
/> <?php _e( 'Open link new tab.', 'vkExUnit' ); ?></label><br/>
94
- <label><?php _e( 'Alternative text', 'vkExUnit' ); ?> : <input type="text" name="<?php echo $this->get_field_name( 'alt' ); ?>" style="width: 100%" value="<?php echo esc_attr( $instance['alt'] ); ?>" /></label><br/>
95
</div>
96
</div>
97
<script type="text/javascript">
12
13
14
function __construct() {
15
+ $widget_name = veu_get_short_name() . ' ' . __( 'Banner', 'vkExUnit' );
16
17
parent::__construct(
18
'vkExUnit_banner',
25
26
27
public function widget( $args, $instance ) {
28
+ $instance = self::get_bnr_option( $instance );
29
$image = null;
30
if ( is_numeric( $instance['id'] ) ) {
31
$image = wp_get_attachment_image_src( $instance['id'], 'full' );
32
+ $alt = ( $instance['title'] ) ? esc_attr( $instance['title'] ) : '';
33
}
34
if ( ! $image ) {
35
return;
51
public function update( $new_instance, $old_instance ) {
52
$instance['id'] = $new_instance['id'];
53
$instance['href'] = $new_instance['href'];
54
+ $instance['title'] = $new_instance['title'];
55
$instance['blank'] = ( isset( $new_instance['blank'] ) && $new_instance['blank'] == 'true' );
56
return $new_instance;
57
}
58
59
60
+ public static function get_bnr_option( $instance = array() ) {
61
+
62
+ // 以前は alt に格納していたが後から titile に変更した
63
+ // title が入力されてkるか 空 の場合 そのままtitleに適用
64
+ if ( isset( $instance['title'] ) ) {
65
+ $title = $instance['title'];
66
+ } elseif ( ! empty( $instance['alt'] ) ) {
67
+ $title = $instance['alt'];
68
+ } else {
69
+ $title = '';
70
+ }
71
+ $instance['title'] = $title;
72
+
73
$defaults = array(
74
'id' => null,
75
'href' => '',
76
'blank' => false,
77
+ 'title' => '',
78
);
79
+
80
return wp_parse_args( $instance, $defaults );
81
}
82
83
84
public function form( $instance ) {
85
+ $instance = self::get_bnr_option( $instance );
86
$image = null;
87
if ( is_numeric( $instance['id'] ) ) {
88
$image = wp_get_attachment_image_src( $instance['id'], 'full' );
104
echo 'checked';}
105
?>
106
/> <?php _e( 'Open link new tab.', 'vkExUnit' ); ?></label><br/>
107
+ <label><?php _e( 'Alternative text', 'vkExUnit' ); ?> :
108
+ <input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" style="width: 100%" value="<?php echo esc_attr( $instance['title'] ); ?>" />
109
+ </label><br/>
110
</div>
111
</div>
112
<script type="text/javascript">
plugins/other_widget/widget-button.php CHANGED
@@ -17,7 +17,7 @@ class WP_Widget_Button extends WP_Widget {
17
18
static function defaults() {
19
return array(
20
- 'maintext' => '',
21
'icon_before' => '',
22
'icon_after' => '',
23
'subtext' => '',
@@ -29,7 +29,7 @@ class WP_Widget_Button extends WP_Widget {
29
}
30
31
function __construct() {
32
- $widget_name = 'VK_' . __( 'Button', 'vkExUnit' );
33
34
parent::__construct(
35
'vkExUnit_button',
@@ -40,7 +40,7 @@ class WP_Widget_Button extends WP_Widget {
40
41
42
function widget( $args, $instance ) {
43
- $options = self::default_options( $instance );
44
45
$classes = array(
46
'btn',
@@ -50,16 +50,17 @@ class WP_Widget_Button extends WP_Widget {
50
if ( in_array( $options['size'], array( 'sm', 'lg' ) ) ) {
51
$classes[] = 'btn-' . $options['size'];
52
}
53
- ?>
54
- <?php echo $args['before_widget']; ?>
55
- <?php if ( $options['linkurl'] && $options['maintext'] ) : ?>
56
- <div class="veu_button">
57
- <a type="button" class="<?php echo implode( ' ', $classes ); ?>" href="<?php echo $options['linkurl']; ?>"
58
- <?php
59
- if ( $options['blank'] ) {
60
- echo 'target="_blank"';}
61
- ?>
62
- >
63
<span class="button_mainText">
64
65
<?php
@@ -73,7 +74,7 @@ class WP_Widget_Button extends WP_Widget {
73
echo '<i class="' . $fa . esc_attr( $instance['icon_before'] ) . ' font_icon"></i>';
74
}
75
76
- echo esc_html( $options['maintext'] );
77
78
if ( isset( $instance['icon_after'] ) && $instance['icon_after'] ) {
79
echo '<i class="' . $fa . esc_attr( $instance['icon_after'] ) . ' font_icon"></i>';
@@ -84,26 +85,36 @@ class WP_Widget_Button extends WP_Widget {
84
<?php if ( $options['subtext'] ) : ?>
85
<span class="veu_caption button_subText"><?php echo htmlspecialchars( $options['subtext'] ); ?></span>
86
<?php endif; ?>
87
- </a>
88
- </div>
89
- <?php endif; ?>
90
<?php echo $args['after_widget']; ?>
91
<?php
92
}
93
94
- public static function default_options( $option = array() ) {
95
- return wp_parse_args( $option, static::defaults() );
96
}
97
98
-
99
function form( $instance ) {
100
- $instance = self::default_options( $instance );
101
102
?>
103
<div class="warp" style="padding: 1em 0;line-height: 2.5em;">
104
105
<?php _e( 'Main text(Required):', 'vkExUnit' ); ?>
106
- <input type="text" id="<?php echo $this->get_field_id( 'maintext' ); ?>" name="<?php echo $this->get_field_name( 'maintext' ); ?>" style="width:100%; margin-bottom: 0.5em;" value="<?php echo esc_attr( $instance['maintext'] ); ?>">
107
108
<?php
109
// icon font class input
@@ -112,7 +123,7 @@ class WP_Widget_Button extends WP_Widget {
112
echo '<label for="' . $this->get_field_id( 'icon_before' ) . '">' . __( 'Before :', 'vkExUnit' );
113
echo '<input type="text" id="' . $this->get_field_id( 'icon_before' ) . '-font" class="font_class" name="' . $this->get_field_name( 'icon_before' ) . '" value="' . esc_attr( $instance['icon_before'] ) . '" /><br>';
114
echo '<label for="' . $this->get_field_id( 'icon_after' ) . '">' . __( 'After :', 'vkExUnit' );
115
- echo '<input type="text" id="' . $this->get_field_id( 'icon_after' ) . '-font" class="font_class" name="' . $this->get_field_name( 'icon_after' ) . '" value="' . esc_attr( $instance['icon_after'] ) . '" />';
116
117
if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
118
echo Vk_Font_Awesome_Versions::ex_and_link();
@@ -185,7 +196,7 @@ class WP_Widget_Button extends WP_Widget {
185
186
function update( $new_instance, $old_instance ) {
187
$opt = array();
188
- $opt['maintext'] = $new_instance['maintext'];
189
$opt['icon_before'] = $new_instance['icon_before'];
190
$opt['icon_after'] = $new_instance['icon_after'];
191
$opt['subtext'] = $new_instance['subtext'];
17
18
static function defaults() {
19
return array(
20
+ 'title' => '',
21
'icon_before' => '',
22
'icon_after' => '',
23
'subtext' => '',
29
}
30
31
function __construct() {
32
+ $widget_name = veu_get_short_name() . ' ' . __( 'Button', 'vkExUnit' );
33
34
parent::__construct(
35
'vkExUnit_button',
40
41
42
function widget( $args, $instance ) {
43
+ $options = self::get_btn_options( $instance );
44
45
$classes = array(
46
'btn',
50
if ( in_array( $options['size'], array( 'sm', 'lg' ) ) ) {
51
$classes[] = 'btn-' . $options['size'];
52
}
53
+ echo $args['before_widget'];
54
+
55
+ if ( $options['blank'] ) {
56
+ $blank = ' target="_blank"';
57
+ } else {
58
+ $blank = '';
59
+ }
60
+
61
+ if ( $options['linkurl'] && $options['title'] ) : ?>
62
+ <div class="veu_button">
63
+ <a type="button" class="<?php echo implode( ' ', $classes ); ?>" href="<?php echo $options['linkurl']; ?>"<?php echo $blank; ?>>
64
<span class="button_mainText">
65
66
<?php
74
echo '<i class="' . $fa . esc_attr( $instance['icon_before'] ) . ' font_icon"></i>';
75
}
76
77
+ echo wp_kses_post( $options['title'] );
78
79
if ( isset( $instance['icon_after'] ) && $instance['icon_after'] ) {
80
echo '<i class="' . $fa . esc_attr( $instance['icon_after'] ) . ' font_icon"></i>';
85
<?php if ( $options['subtext'] ) : ?>
86
<span class="veu_caption button_subText"><?php echo htmlspecialchars( $options['subtext'] ); ?></span>
87
<?php endif; ?>
88
+ </a>
89
+ </div>
90
+ <?php endif; ?>
91
<?php echo $args['after_widget']; ?>
92
<?php
93
}
94
95
+ public static function get_btn_options( $option = array() ) {
96
+ // 以前は maintext に格納していたが後から titile に変更した
97
+ // title が入力されてkるか 空 の場合 そのままtitleに適用
98
+ if ( isset( $option['title'] ) ) {
99
+ $title = $option['title'];
100
+ } elseif ( ! empty( $option['maintext'] ) ) {
101
+ $title = $option['maintext'];
102
+ } else {
103
+ $title = '';
104
+ }
105
+ $defaults = static::defaults();
106
+ $option['title'] = $title;
107
+ return wp_parse_args( $option, $defaults );
108
}
109
110
function form( $instance ) {
111
+ $instance = self::get_btn_options( $instance );
112
113
?>
114
<div class="warp" style="padding: 1em 0;line-height: 2.5em;">
115
116
<?php _e( 'Main text(Required):', 'vkExUnit' ); ?>
117
+ <input type="text" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" style="width:100%; margin-bottom: 0.5em;" value="<?php echo $instance['title']; ?>">
118
119
<?php
120
// icon font class input
123
echo '<label for="' . $this->get_field_id( 'icon_before' ) . '">' . __( 'Before :', 'vkExUnit' );
124
echo '<input type="text" id="' . $this->get_field_id( 'icon_before' ) . '-font" class="font_class" name="' . $this->get_field_name( 'icon_before' ) . '" value="' . esc_attr( $instance['icon_before'] ) . '" /><br>';
125
echo '<label for="' . $this->get_field_id( 'icon_after' ) . '">' . __( 'After :', 'vkExUnit' );
126
+ echo '<input type="text" id="' . $this->get_field_id( 'icon_after' ) . '-font" class="font_class" name="' . $this->get_field_name( 'icon_after' ) . '" value="' . esc_attr( $instance['icon_after'] ) . '" /><br>';
127
128
if ( class_exists( 'Vk_Font_Awesome_Versions' ) ) {
129
echo Vk_Font_Awesome_Versions::ex_and_link();
196
197
function update( $new_instance, $old_instance ) {
198
$opt = array();
199
+ $opt['title'] = wp_kses_post( $new_instance['title'] );
200
$opt['icon_before'] = $new_instance['icon_before'];
201
$opt['icon_after'] = $new_instance['icon_after'];
202
$opt['subtext'] = $new_instance['subtext'];
plugins/other_widget/widget-child-page-list.php CHANGED
@@ -7,7 +7,7 @@
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',
@@ -18,22 +18,31 @@ class WP_Widget_vkExUnit_child_page extends WP_Widget {
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">';
@@ -57,6 +66,8 @@ class WP_Widget_vkExUnit_child_page extends WP_Widget {
57
return $instance;
58
}
59
}
60
- add_action( 'widgets_init', function() {
61
- return register_widget( 'WP_Widget_vkExUnit_child_page' );
62
- });
7
class WP_Widget_vkExUnit_child_page extends WP_Widget {
8
9
function __construct() {
10
+ $widget_name = veu_get_short_name() . ' ' . __( 'Child Page List', 'vkExUnit' );
11
12
parent::__construct(
13
'vkExUnit_child_pages',
18
19
20
function widget( $args, $instance ) {
21
+ if ( ! is_page() ) {
22
+ return; }
23
$post_id = get_the_id();
24
+ if ( ! $post_id ) {
25
+ return; }
26
$parent_id = 0;
27
28
+ $post_three = array();
29
$post_three[] = $post_id;
30
31
while ( end( $post_three ) ) {
32
+ $the_query = new WP_Query(
33
+ array(
34
+ 'p' => end( $post_three ),
35
+ 'post_type' => 'page',
36
+ 'posts_per_page' => 1,
37
+ )
38
+ );
39
$post_three[] = $the_query->posts[0]->post_parent;
40
unset( $the_query );
41
}
42
+ $parent_id = $post_three[ count( $post_three ) - 2 ];
43
+ $children = wp_list_pages( 'title_li=&child_of=' . $parent_id . '&echo=0' );
44
+ if ( ! $children ) {
45
+ return; }
46
// var_dump($args);
47
echo $args['before_widget'];
48
echo '<div class="sideWidget widget_childPageList widget_nav_menu">';
66
return $instance;
67
}
68
}
69
+ add_action(
70
+ 'widgets_init', function() {
71
+ return register_widget( 'WP_Widget_vkExUnit_child_page' );
72
+ }
73
+ );
plugins/other_widget/widget-new-posts.php CHANGED
@@ -8,7 +8,7 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
8
public $taxonomies = array( 'category' );
9
10
function __construct() {
11
- $widget_name = vkExUnit_get_short_name(). '_' . __( 'Recent Posts', 'vkExUnit' );
12
13
parent::__construct(
14
'vkExUnit_post_list',
@@ -20,11 +20,10 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
20
/*-------------------------------------------*/
21
/* 一覧へのリンクhtmlを出力する関数
22
/*-------------------------------------------*/
23
- static public function more_link_html( $instance )
24
- {
25
- if ( ! empty ( $instance['more_text'] ) && ! empty ( $instance['more_url'] )) {
26
- $more_link_html = '<div class="postList_more">';
27
- $more_link_html .= '<a href="'.esc_url( $instance['more_url'] ).'">'.wp_kses_post( $instance['more_text'] ).'</a>';
28
$more_link_html .= '</div>';
29
} else {
30
$more_link_html = '';
@@ -34,13 +33,14 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
34
35
36
function widget( $args, $instance ) {
37
- $instance = static::default_options($instance);
38
39
- if ( ! isset( $instance['format'] ) ) { $instance['format'] = 0; }
40
41
echo $args['before_widget'];
42
- echo '<div class="veu_postList pt_'.$instance['format'].'">';
43
- if ( ! empty ( $instance['label'] ) ) {
44
echo $args['before_title'];
45
echo $instance['label'];
46
echo $args['after_title'];
@@ -48,29 +48,30 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
48
49
$count = ( isset( $instance['count'] ) && $instance['count'] ) ? $instance['count'] : 10;
50
$post_type = ( isset( $instance['post_type'] ) && $instance['post_type'] ) ? $instance['post_type'] : 'post';
51
- $is_modified = ( isset( $instance['orderby'] ) && $instance['orderby'] == 'modified');
52
$orderby = ( isset( $instance['orderby'] ) ) ? $instance['orderby'] : 'date';
53
54
- if ( $instance['format'] ) { $this->_taxonomy_init( $post_type ); }
55
56
$p_args = array(
57
- 'post_type' => $post_type,
58
'posts_per_page' => $count,
59
- 'orderby' => $orderby,
60
- 'paged' => 1,
61
);
62
63
if ( isset( $instance['terms'] ) && $instance['terms'] ) {
64
- $taxonomies = get_taxonomies( array() );
65
$p_args['tax_query'] = array(
66
'relation' => 'OR',
67
);
68
- $terms_array = explode( ',', $instance['terms'] );
69
foreach ( $taxonomies as $taxonomy ) {
70
$p_args['tax_query'][] = array(
71
'taxonomy' => $taxonomy,
72
- 'field' => 'id',
73
- 'terms' => $terms_array,
74
);
75
}
76
}
@@ -80,14 +81,16 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
80
if ( $post_loop->have_posts() ) :
81
if ( ! $instance['format'] ) {
82
echo '<div class="postList postList_miniThumb">';
83
- while ( $post_loop->have_posts() ) : $post_loop->the_post();
84
- $this->display_pattern_0($is_modified);
85
endwhile;
86
echo '</div>';
87
} else {
88
echo '<ul class="postList">';
89
- while ( $post_loop->have_posts() ) : $post_loop->the_post();
90
- $this->display_pattern_1($is_modified);
91
endwhile;
92
echo '</ul>';
93
}
@@ -106,34 +109,38 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
106
} // widget($args, $instance)
107
108
109
- function display_pattern_0($is_modified=false) {
110
?>
111
<!-- [ .postList は近日削除されます ] -->
112
<div class="postList postList_item" id="post-<?php the_ID(); ?>">
113
<?php if ( has_post_thumbnail() ) : ?>
114
- <div class="postList_thumbnail">
115
<a href="<?php the_permalink(); ?>">
116
<?php
117
$thumbnail_size = 'thumbnail';
118
the_post_thumbnail( apply_filters( 'vk_post_list_widget_thumbnail', esc_attr( $thumbnail_size ) ) );
119
?>
120
</a>
121
- </div><!-- [ /.postList_thumbnail ] -->
122
<?php endif; ?>
123
- <div class="postList_body">
124
<?php
125
do_action( 'vk_post_list_widget_media_body_prepend' );
126
- $media_body_output = '<div class="postList_title entry-title"><a href="'.esc_url( get_the_permalink() ).'">'.esc_html( get_the_title() ).'</a></div>';
127
- if ($is_modified) $media_body_output .= '<div class="modified postList_date postList_meta_items">'.esc_html( get_the_modified_date() ).'</div>';
128
- else $media_body_output .= '<div class="published postList_date postList_meta_items">'.esc_html( get_the_date() ).'</div>';
129
echo apply_filters( 'vk_post_list_widget_media_body', $media_body_output );
130
do_action( 'vk_post_list_widget_media_body_append' );
131
?>
132
- </div><!-- [ /.postList_body ] -->
133
- </div><?php
134
}
135
136
- function display_pattern_1($is_modified=false) {
137
?>
138
<li id="post-<?php the_ID(); ?>">
139
@@ -146,32 +153,40 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
146
.modified
147
*/
148
$li_items_output = '';
149
- if ( $is_modified ) $li_items_output .= '<span class="modified postList_date postList_meta_items">'.esc_html( get_the_modified_date() ).'</span>';
150
- else $li_items_output = '<span class="published postList_date postList_meta_items">'.esc_html( get_the_date() ).'</span>';
151
- $li_items_output .= '<span class="postList_terms postList_meta_items">'.$this->taxonomy_list( get_the_id(), '', '', '' ).'</span>';
152
- $li_items_output .= '<span class="postList_title entry-title"><a href="'.esc_url( get_the_permalink() ).'">'.esc_html( get_the_title() ).'</a></span>';
153
echo apply_filters( 'vk_post_list_widget_li_items', $li_items_output );
154
do_action( 'vk_post_list_widget_li_append' );
155
?>
156
- </li><?php
157
}
158
159
function _taxonomy_init( $post_type ) {
160
- if ( $post_type == 'post' ) { return; }
161
$this->taxonomies = get_object_taxonomies( $post_type );
162
}
163
164
function taxonomy_list( $post_id = 0, $before = ' ', $sep = ',', $after = '' ) {
165
- if ( ! $post_id ) { $post_id = get_the_ID(); }
166
167
$taxo_catelist = array();
168
169
foreach ( $this->taxonomies as $taxonomy ) {
170
- $terms = get_the_term_list( $post_id, $taxonomy, $before, $sep , $after );
171
- if ( $terms ) { $taxo_catelist[] = $terms; }
172
}
173
174
- if ( count( $taxo_catelist ) ) { return join( $taxo_catelist, $sep ); }
175
return '';
176
}
177
@@ -197,69 +212,90 @@ class WP_Widget_vkExUnit_post_list extends WP_Widget {
197
但し、これがある事で過去にnotice が出た経緯があるようなので、要調査
198
※20行目付近にも同様の記述あり
199
*/
200
- $instance = static::default_options($instance);
201
?>
202
<br />
203
- <?php //タイトル ?>
204
- <label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Title:' ); ?></label><br/>
205
<input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo esc_attr( $instance['label'] ); ?>" />
206
- <br /><br />
207
208
<?php echo _e( 'Display Format', 'vkExUnit' ); ?>:<br/>
209
- <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/>
210
- <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>
211
- <br/><br/>
212
213
<?php echo _e( 'Order by', 'vkExUnit' ); ?>:<br/>
214
- <label style="padding-bottom: 0.5em"><input type="radio" name="<?php echo $this->get_field_name( 'orderby' ); ?>" value="date" <?php if ( $instance['orderby'] != 'modified' ) { echo 'checked'; } ?> /><?php _e( 'Publish date', 'vkExUnit' ); ?></label><br/>
215
- <label><input type="radio" name="<?php echo $this->get_field_name( 'orderby' ); ?>" value="modified" <?php if ( $instance['orderby'] == 'modified' ) { echo 'checked'; } ?>/><?php _e( 'Modified date', 'vkExUnit' ); ?></label>
216
- <br/><br/>
217
218
<?php //表示件数 ?>
219
- <label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Display count','vkExUnit' ); ?>:</label><br/>
220
<input type="text" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" value="<?php echo esc_attr( $instance['count'] ); ?>" />
221
- <br /><br />
222
223
<?php //投稿タイプ ?>
224
- <label for="<?php echo $this->get_field_id( 'post_type' ); ?>"><?php _e( 'Slug for the custom type you want to display', 'vkExUnit' ) ?>:</label><br />
225
- <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'] ) ?>" />
226
- <br/><br/>
227
228
<?php // Terms ?>
229
- <label for="<?php echo $this->get_field_id( 'terms' ); ?>"><?php _e( 'taxonomy ID', 'vkExUnit' ) ?>:</label><br />
230
- <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 />
231
- <?php _e( 'if you need filtering by term, add the term ID separate by ",".', 'vkExUnit' );
232
echo '<br/>';
233
_e( 'if empty this area, I will do not filtering.', 'vkExUnit' );
234
?>
235
<br/><br/>
236
237
<?php // Read more ?>
238
- <label for="<?php echo $this->get_field_id( 'more_url' ); ?>"><?php _e( 'Destination URL:', 'vkExUnit' ); ?></label><br/>
239
<input type="text" id="<?php echo $this->get_field_id( 'more_url' ); ?>" name="<?php echo $this->get_field_name( 'more_url' ); ?>" value="<?php echo esc_attr( $instance['more_url'] ); ?>" />
240
<br /><br />
241
- <label for="<?php echo $this->get_field_id( 'more_text' ); ?>"><?php _e( 'Notation text:', 'vkExUnit' ); ?></label><br/>
242
<input type="text" placeholder="最新記事一覧 ≫" id="<?php echo $this->get_field_id( 'more_text' ); ?>" name="<?php echo $this->get_field_name( 'more_text' ); ?>" value="<?php echo esc_attr( $instance['more_text'] ); ?>" />
243
<br /><br />
244
245
<?php
246
- }
247
248
function update( $new_instance, $old_instance ) {
249
- $instance = $old_instance;
250
- $instance['format'] = $new_instance['format'];
251
- $instance['count'] = $new_instance['count'];
252
- $instance['label'] = $new_instance['label'];
253
- $instance['orderby'] = in_array($new_instance['orderby'], array('date', 'modified'))? $new_instance['orderby']: 'date';
254
- $instance['post_type'] = ! empty( $new_instance['post_type'] ) ? strip_tags( $new_instance['post_type'] ) : 'post';
255
- $instance['terms'] = preg_replace( '/([^0-9,]+)/', '', $new_instance['terms'] );
256
- $instance['more_url'] = $new_instance['more_url'];
257
- $instance['more_text'] = $new_instance['more_text'];
258
return $instance;
259
}
260
}
261
262
- add_action('widgets_init', 'vkExUnit_widget_register_post_list');
263
- function vkExUnit_widget_register_post_list(){
264
- return register_widget("WP_Widget_vkExUnit_post_list");
265
}
8
public $taxonomies = array( 'category' );
9
10
function __construct() {
11
+ $widget_name = veu_get_short_name() . ' ' . __( 'Recent Posts', 'vkExUnit' );
12
13
parent::__construct(
14
'vkExUnit_post_list',
20
/*-------------------------------------------*/
21
/* 一覧へのリンクhtmlを出力する関数
22
/*-------------------------------------------*/
23
+ static public function more_link_html( $instance ) {
24
+ if ( ! empty( $instance['more_text'] ) && ! empty( $instance['more_url'] ) ) {
25
+ $more_link_html = '<div class="postList_more">';
26
+ $more_link_html .= '<a href="' . esc_url( $instance['more_url'] ) . '">' . wp_kses_post( $instance['more_text'] ) . '</a>';
27
$more_link_html .= '</div>';
28
} else {
29
$more_link_html = '';
33
34
35
function widget( $args, $instance ) {
36
+ $instance = static::default_options( $instance );
37
38
+ if ( ! isset( $instance['format'] ) ) {
39
+ $instance['format'] = 0; }
40
41
echo $args['before_widget'];
42
+ echo '<div class="veu_postList pt_' . $instance['format'] . '">';
43
+ if ( ! empty( $instance['label'] ) ) {
44
echo $args['before_title'];
45
echo $instance['label'];
46
echo $args['after_title'];
48
49
$count = ( isset( $instance['count'] ) && $instance['count'] ) ? $instance['count'] : 10;
50
$post_type = ( isset( $instance['post_type'] ) && $instance['post_type'] ) ? $instance['post_type'] : 'post';
51
+ $is_modified = ( isset( $instance['orderby'] ) && $instance['orderby'] == 'modified' );
52
$orderby = ( isset( $instance['orderby'] ) ) ? $instance['orderby'] : 'date';
53
54
+ if ( $instance['format'] ) {
55
+ $this->_taxonomy_init( $post_type ); }
56
57
$p_args = array(
58
+ 'post_type' => $post_type,
59
'posts_per_page' => $count,
60
+ 'orderby' => $orderby,
61
+ 'paged' => 1,
62
);
63
64
if ( isset( $instance['terms'] ) && $instance['terms'] ) {
65
+ $taxonomies = get_taxonomies( array() );
66
$p_args['tax_query'] = array(
67
'relation' => 'OR',
68
);
69
+ $terms_array = explode( ',', $instance['terms'] );
70
foreach ( $taxonomies as $taxonomy ) {
71
$p_args['tax_query'][] = array(
72
'taxonomy' => $taxonomy,
73
+ 'field' => 'id',
74
+ 'terms' => $terms_array,
75
);
76
}
77
}
81
if ( $post_loop->have_posts() ) :
82
if ( ! $instance['format'] ) {
83
echo '<div class="postList postList_miniThumb">';
84
+ while ( $post_loop->have_posts() ) :
85
+ $post_loop->the_post();
86
+ $this->display_pattern_0( $is_modified );
87
endwhile;
88
echo '</div>';
89
} else {
90
echo '<ul class="postList">';
91
+ while ( $post_loop->have_posts() ) :
92
+ $post_loop->the_post();
93
+ $this->display_pattern_1( $is_modified );
94
endwhile;
95
echo '</ul>';
96
}
109
} // widget($args, $instance)
110
111
112
+ function display_pattern_0( $is_modified = false ) {
113
?>
114
<!-- [ .postList は近日削除されます ] -->
115
<div class="postList postList_item" id="post-<?php the_ID(); ?>">
116
<?php if ( has_post_thumbnail() ) : ?>
117
+ <div class="postList_thumbnail">
118
<a href="<?php the_permalink(); ?>">
119
<?php
120
$thumbnail_size = 'thumbnail';
121
the_post_thumbnail( apply_filters( 'vk_post_list_widget_thumbnail', esc_attr( $thumbnail_size ) ) );
122
?>
123
</a>
124
+ </div><!-- [ /.postList_thumbnail ] -->
125
<?php endif; ?>
126
+ <div class="postList_body">
127
<?php
128
do_action( 'vk_post_list_widget_media_body_prepend' );
129
+ $media_body_output = '<div class="postList_title entry-title"><a href="' . esc_url( get_the_permalink() ) . '">' . esc_html( get_the_title() ) . '</a></div>';
130
+ if ( $is_modified ) {
131
+ $media_body_output .= '<div class="modified postList_date postList_meta_items">' . esc_html( get_the_modified_date() ) . '</div>';
132
+ } else {
133
+ $media_body_output .= '<div class="published postList_date postList_meta_items">' . esc_html( get_the_date() ) . '</div>';
134
+ }
135
echo apply_filters( 'vk_post_list_widget_media_body', $media_body_output );
136
do_action( 'vk_post_list_widget_media_body_append' );
137
?>
138
+ </div><!-- [ /.postList_body ] -->
139
+ </div>
140
+ <?php
141
}
142
143
+ function display_pattern_1( $is_modified = false ) {
144
?>
145
<li id="post-<?php the_ID(); ?>">
146
153
.modified
154
*/
155
$li_items_output = '';
156
+ if ( $is_modified ) {
157
+ $li_items_output .= '<span class="modified postList_date postList_meta_items">' . esc_html( get_the_modified_date() ) . '</span>';
158
+ } else {
159
+ $li_items_output = '<span class="published postList_date postList_meta_items">' . esc_html( get_the_date() ) . '</span>';
160
+ }
161
+ $li_items_output .= '<span class="postList_terms postList_meta_items">' . $this->taxonomy_list( get_the_id(), '', '', '' ) . '</span>';
162
+ $li_items_output .= '<span class="postList_title entry-title"><a href="' . esc_url( get_the_permalink() ) . '">' . esc_html( get_the_title() ) . '</a></span>';
163
echo apply_filters( 'vk_post_list_widget_li_items', $li_items_output );
164
do_action( 'vk_post_list_widget_li_append' );
165
?>
166
+ </li>
167
+ <?php
168
}
169
170
function _taxonomy_init( $post_type ) {
171
+ if ( $post_type == 'post' ) {
172
+ return; }
173
$this->taxonomies = get_object_taxonomies( $post_type );
174
}
175
176
function taxonomy_list( $post_id = 0, $before = ' ', $sep = ',', $after = '' ) {
177
+ if ( ! $post_id ) {
178
+ $post_id = get_the_ID(); }
179
180
$taxo_catelist = array();
181
182
foreach ( $this->taxonomies as $taxonomy ) {
183
+ $terms = get_the_term_list( $post_id, $taxonomy, $before, $sep, $after );
184
+ if ( $terms ) {
185
+ $taxo_catelist[] = $terms; }
186
}
187
188
+ if ( count( $taxo_catelist ) ) {
189
+ return join( $taxo_catelist, $sep ); }
190
return '';
191
}
192
212
但し、これがある事で過去にnotice が出た経緯があるようなので、要調査
213
※20行目付近にも同様の記述あり
214
*/
215
+ $instance = static::default_options( $instance );
216
?>
217
<br />
218
+ <?php //タイトル ?>
219
+ <label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Title:' ); ?></label><br/>
220
<input type="text" id="<?php echo $this->get_field_id( 'label' ); ?>-title" name="<?php echo $this->get_field_name( 'label' ); ?>" value="<?php echo esc_attr( $instance['label'] ); ?>" />
221
+ <br /><br />
222
223
<?php echo _e( 'Display Format', 'vkExUnit' ); ?>:<br/>
224
+ <label><input type="radio" name="<?php echo $this->get_field_name( 'format' ); ?>" value="0"
225
+ <?php
226
+ if ( ! $instance['format'] ) {
227
+ echo 'checked'; }
228
+ ?>
229
+ /><?php echo __( 'Thumbnail', 'vkExUnit' ) . '/' . __( 'Title', 'vkExUnit' ) . '/' . __( 'Date', 'vkExUnit' ); ?></label><br/>
230
+ <label><input type="radio" name="<?php echo $this->get_field_name( 'format' ); ?>" value="1"
231
+ <?php
232
+ if ( $instance['format'] == 1 ) {
233
+ echo 'checked'; }
234
+ ?>
235
+ /><?php echo __( 'Date', 'vkExUnit' ) . '/' . __( 'Category', 'vkExUnit' ) . '/' . __( 'Title', 'vkExUnit' ); ?></label>
236
+ <br/><br/>
237
238
<?php echo _e( 'Order by', 'vkExUnit' ); ?>:<br/>
239
+ <label style="padding-bottom: 0.5em"><input type="radio" name="<?php echo $this->get_field_name( 'orderby' ); ?>" value="date"
240
+ <?php
241
+ if ( $instance['orderby'] != 'modified' ) {
242
+ echo 'checked'; }
243
+ ?>
244
+ /><?php _e( 'Publish date', 'vkExUnit' ); ?></label><br/>
245
+ <label><input type="radio" name="<?php echo $this->get_field_name( 'orderby' ); ?>" value="modified"
246
+ <?php
247
+ if ( $instance['orderby'] == 'modified' ) {
248
+ echo 'checked'; }
249
+ ?>
250
+ /><?php _e( 'Modified date', 'vkExUnit' ); ?></label>
251
+ <br/><br/>
252
253
<?php //表示件数 ?>
254
+ <label for="<?php echo $this->get_field_id( 'count' ); ?>"><?php _e( 'Display count', 'vkExUnit' ); ?>:</label><br/>
255
<input type="text" id="<?php echo $this->get_field_id( 'count' ); ?>" name="<?php echo $this->get_field_name( 'count' ); ?>" value="<?php echo esc_attr( $instance['count'] ); ?>" />
256
+ <br /><br />
257
258
<?php //投稿タイプ ?>
259
+ <label for="<?php echo $this->get_field_id( 'post_type' ); ?>"><?php _e( 'Slug for the custom type you want to display', 'vkExUnit' ); ?>:</label><br />
260
+ <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'] ); ?>" />
261
+ <br/><br/>
262
263
<?php // Terms ?>
264
+ <label for="<?php echo $this->get_field_id( 'terms' ); ?>"><?php _e( 'taxonomy ID', 'vkExUnit' ); ?>:</label><br />
265
+ <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 />
266
+ <?php
267
+ _e( 'if you need filtering by term, add the term ID separate by ",".', 'vkExUnit' );
268
echo '<br/>';
269
_e( 'if empty this area, I will do not filtering.', 'vkExUnit' );
270
?>
271
<br/><br/>
272
273
<?php // Read more ?>
274
+ <label for="<?php echo $this->get_field_id( 'more_url' ); ?>"><?php _e( 'Destination URL:', 'vkExUnit' ); ?></label><br/>
275
<input type="text" id="<?php echo $this->get_field_id( 'more_url' ); ?>" name="<?php echo $this->get_field_name( 'more_url' ); ?>" value="<?php echo esc_attr( $instance['more_url'] ); ?>" />
276
<br /><br />
277
+ <label for="<?php echo $this->get_field_id( 'more_text' ); ?>"><?php _e( 'Notation text:', 'vkExUnit' ); ?></label><br/>
278
<input type="text" placeholder="最新記事一覧 ≫" id="<?php echo $this->get_field_id( 'more_text' ); ?>" name="<?php echo $this->get_field_name( 'more_text' ); ?>" value="<?php echo esc_attr( $instance['more_text'] ); ?>" />
279
<br /><br />
280
281
<?php
282
+ }
283
284
function update( $new_instance, $old_instance ) {
285
+ $instance = $old_instance;
286
+ $instance['format'] = $new_instance['format'];
287
+ $instance['count'] = $new_instance['count'];
288
+ $instance['label'] = $new_instance['label'];
289
+ $instance['orderby'] = in_array( $new_instance['orderby'], array( 'date', 'modified' ) ) ? $new_instance['orderby'] : 'date';
290
+ $instance['post_type'] = ! empty( $new_instance['post_type'] ) ? strip_tags( $new_instance['post_type'] ) : 'post';
291
+ $instance['terms'] = preg_replace( '/([^0-9,]+)/', '', $new_instance['terms'] );
292
+ $instance['more_url'] = $new_instance['more_url'];
293
+ $instance['more_text'] = $new_instance['more_text'];
294
return $instance;
295
}
296
}
297
298
+ add_action( 'widgets_init', 'vkExUnit_widget_register_post_list' );
299
+ function vkExUnit_widget_register_post_list() {
300
+ return register_widget( 'WP_Widget_vkExUnit_post_list' );
301
}
plugins/other_widget/widget-page.php CHANGED
@@ -6,7 +6,7 @@
6
class WP_Widget_vkExUnit_widget_page extends WP_Widget {
7
8
function __construct() {
9
- $widget_name = vkExUnit_get_short_name() . '_' . __( 'page content to widget', 'vkExUnit' );
10
11
parent::__construct(
12
'pudge',
6
class WP_Widget_vkExUnit_widget_page extends WP_Widget {
7
8
function __construct() {
9
+ $widget_name = veu_get_short_name() . ' ' . __( 'page content to widget', 'vkExUnit' );
10
11
parent::__construct(
12
'pudge',
plugins/other_widget/widget-pr-blocks.php CHANGED
@@ -14,7 +14,7 @@ class WP_Widget_vkExUnit_PR_Blocks extends WP_Widget {
14
/*-------------------------------------------*/
15
16
function __construct() {
17
- $widget_name = vkExUnit_get_short_name() . '_' . __( 'PR Blocks', 'vkExUnit' );
18
19
parent::__construct(
20
'WP_Widget_vkExUnit_PR_Blocks',
14
/*-------------------------------------------*/
15
16
function __construct() {
17
+ $widget_name = veu_get_short_name() . ' ' . __( 'PR Blocks', 'vkExUnit' );
18
19
parent::__construct(
20
'WP_Widget_vkExUnit_PR_Blocks',
plugins/other_widget/widget-profile.php CHANGED
@@ -6,7 +6,7 @@
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',
6
class WP_Widget_vkExUnit_profile extends WP_Widget {
7
8
function __construct() {
9
+ $widget_name = veu_get_short_name() . ' ' . __( 'Profile', 'vkExUnit' );
10
11
parent::__construct(
12
'WP_Widget_vkExUnit_profile',
plugins/other_widget/widget-side-child-page-list.php CHANGED
@@ -1,15 +1,15 @@
1
<?php
2
3
- add_action('widgets_init', 'vkExUnit_widget_register_childpages');
4
- function vkExUnit_widget_register_childpages(){
5
- return register_widget("WP_Widget_vkExUnit_ChildPageList");
6
}
7
8
9
class WP_Widget_vkExUnit_ChildPageList extends WP_Widget {
10
11
function __construct() {
12
- $widget_name = vkExUnit_get_short_name() . '_' . __( 'child pages list', 'vkExUnit' );
13
14
parent::__construct(
15
'vkExUnit_childPageList',
@@ -18,43 +18,44 @@ class WP_Widget_vkExUnit_ChildPageList extends WP_Widget {
18
);
19
}
20
21
- function widget($args, $instance) {
22
23
global $post;
24
- if (is_page()) {
25
- if($post->ancestors){
26
- foreach($post->ancestors as $post_anc_id){
27
- $post_id = $post_anc_id;
28
- }
29
- } else {
30
- $post_id = $post->ID;
31
}
32
- if ($post_id) {
33
- $children = wp_list_pages("title_li=&child_of=".$post_id."&echo=0");
34
- if ($children) {
35
- echo $args['before_widget'];
36
- echo '<div class="veu_childPages widget_link_list">';
37
- echo $args['before_title'];
38
- // echo '<a href="' . get_the_permalink($post_id) . '">';
39
- echo get_the_title($post_id);
40
- // echo '</a>';
41
- echo $args['after_title'];
42
?>
43
<ul class="localNavi">
44
<?php echo $children; ?>
45
</ul>
46
</div>
47
<?php echo $args['after_widget']; ?>
48
- <?php }
49
}
50
} // is_page
51
52
}
53
54
- function form($instance){
55
}
56
57
- function update($new_instance,$old_instance){
58
return $new_instance;
59
}
60
1
<?php
2
3
+ add_action( 'widgets_init', 'vkExUnit_widget_register_childpages' );
4
+ function vkExUnit_widget_register_childpages() {
5
+ return register_widget( 'WP_Widget_vkExUnit_ChildPageList' );
6
}
7
8
9
class WP_Widget_vkExUnit_ChildPageList extends WP_Widget {
10
11
function __construct() {
12
+ $widget_name = veu_get_short_name() . ' ' . __( 'child pages list', 'vkExUnit' );
13
14
parent::__construct(
15
'vkExUnit_childPageList',
18
);
19
}
20
21
+ function widget( $args, $instance ) {
22
23
global $post;
24
+ if ( is_page() ) {
25
+ if ( $post->ancestors ) {
26
+ foreach ( $post->ancestors as $post_anc_id ) {
27
+ $post_id = $post_anc_id;
28
}
29
+ } else {
30
+ $post_id = $post->ID;
31
+ }
32
+ if ( $post_id ) {
33
+ $children = wp_list_pages( 'title_li=&child_of=' . $post_id . '&echo=0' );
34
+ if ( $children ) {
35
+ echo $args['before_widget'];
36
+ echo '<div class="veu_childPages widget_link_list">';
37
+ echo $args['before_title'];
38
+ // echo '<a href="' . get_the_permalink($post_id) . '">';
39
+ echo get_the_title( $post_id );
40
+ // echo '</a>';
41
+ echo $args['after_title'];
42
?>
43
<ul class="localNavi">
44
<?php echo $children; ?>
45
</ul>
46
</div>
47
<?php echo $args['after_widget']; ?>
48
+ <?php
49
}
50
+ }
51
} // is_page
52
53
}
54
55
+ function form( $instance ) {
56
}
57
58
+ function update( $new_instance, $old_instance ) {
59
return $new_instance;
60
}
61
plugins/other_widget/widget-taxonomies.php CHANGED
@@ -3,11 +3,11 @@
3
/*-------------------------------------------*/
4
/* Taxonomy list widget
5
/*-------------------------------------------*/
6
- class WP_Widget_VK_taxonomy_list extends WP_Widget
7
- {
8
// ウィジェット定義
9
function __construct() {
10
- $widget_name = vkExUnit_get_short_name().'_'. __( 'Categories/Custom taxonomies list', 'vkExUnit' );
11
12
parent::__construct(
13
'WP_Widget_VK_taxonomy_list',
@@ -17,96 +17,106 @@ class WP_Widget_VK_taxonomy_list extends WP_Widget
17
}
18
19
20
- function widget( $args, $instance )
21
- {
22
$instance = static::get_defaults( $instance );
23
- if ( !isset($instance['tax_name'])) $instance['tax_name'] = 'category';
24
- if ( !isset($instance['label'])) $instance['label'] = __('Category', 'vkExUnit');
25
$arg = array(
26
- 'echo' => 1,
27
- 'style' => 'list',
28
- 'show_count' => false,
29
- 'show_option_all' => false,
30
- 'hide_empty' => $instance['hide_empty'],
31
- 'hierarchical' => true,
32
- 'title_li' => '',
33
- );
34
35
$arg['taxonomy'] = $instance['tax_name'];
36
37
?>
38
<?php echo $args['before_widget']; ?>
39
- <div class="sideWidget widget_taxonomies widget_nav_menu">
40
<?php echo $args['before_title'] . $instance['label'] . $args['after_title']; ?>
41
- <ul class="localNavi">
42
<?php wp_list_categories( $arg ); ?>
43
- </ul>
44
- </div>
45
<?php echo $args['after_widget']; ?>
46
<?php
47
}
48
49
50
- public static function get_defaults($instance=array())
51
- {
52
$defaults = array(
53
- 'tax_name' => 'category',
54
- 'label' => __( 'Category', 'vkExUnit' ),
55
- 'hide' => __( 'Category', 'vkExUnit' ),
56
- 'title' => 'Category',
57
- 'hide_empty' => false,
58
- '_builtin' => false,
59
);
60
return wp_parse_args( (array) $instance, $defaults );
61
}
62
63
64
- function form( $instance )
65
- {
66
$instance = static::get_defaults( $instance );
67
- $taxs = get_taxonomies( array( 'public' => true ),'objects' );
68
?>
69
- <p>
70
<label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Label to display', 'vkExUnit' ); ?></label>
71
<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/>
72
<input type="hidden" name="<?php echo $this->get_field_name( 'hide' ); ?>" ><br/>
73
74
- <label for="<?php echo $this->get_field_id( 'tax_name' ); ?>"><?php _e( 'Display page', 'vkExUnit' ) ?></label>
75
<select name="<?php echo $this->get_field_name( 'tax_name' ); ?>" >
76
77
- <?php foreach ( $taxs as $tax ) { ?>
78
- <option value="<?php echo $tax->name; ?>" <?php if ( $instance['tax_name'] == $tax->name ) { echo 'selected="selected"'; } ?> ><?php echo $tax->labels->name; ?></option>
79
<?php } ?>
80
- </select><br/><br/>
81
-
82
- <input type="checkbox" id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" value="true" <?php if ($instance['hide_empty']) echo 'checked'; ?> />
83
- <label for="<?php echo $this->get_field_id( 'hide_empty' ); ?>"><?php _e('Do not display terms without posts', 'vkExUnit'); ?></label>
84
</p>
85
86
- <script type="text/javascript">
87
- jQuery(document).ready(function($){
88
- var post_labels = new Array();
89
<?php
90
foreach ( $taxs as $tax ) {
91
if ( isset( $tax->labels->name ) ) {
92
- echo 'post_labels["'.$tax->name.'"] = "'.$tax->labels->name.'";';
93
}
94
}
95
- echo 'post_labels["blog"] = "'. __( 'Blog', 'vkExUnit' ) . '";'."\n";
96
?>
97
var posttype = jQuery("[name=\"<?php echo $this->get_field_name( 'tax_name' ); ?>\"]");
98
var lablfeld = jQuery("[name=\"<?php echo $this->get_field_name( 'label' ); ?>\"]");
99
- posttype.change(function(){
100
- lablfeld.val(post_labels[posttype.val()]+" <?php _e( 'Archives', 'vkExUnit' ) ?>");
101
- });
102
- });
103
- </script>
104
<?php
105
}
106
107
108
- function update( $new_instance, $old_instance )
109
- {
110
$instance = $old_instance;
111
112
$instance['tax_name'] = $new_instance['tax_name'];
@@ -116,14 +126,14 @@ class WP_Widget_VK_taxonomy_list extends WP_Widget
116
}
117
$instance['label'] = esc_html( $new_instance['label'] );
118
119
- $instance['hide_empty'] = (isset($new_instance['hide_empty']) && $new_instance['hide_empty'] == 'true');
120
121
return $instance;
122
}
123
} // class WP_Widget_top_list_info
124
125
126
- add_action('widgets_init', 'vkExUnit_widget_register_taxonomy_list');
127
- function vkExUnit_widget_register_taxonomy_list(){
128
- return register_widget("WP_Widget_VK_taxonomy_list");
129
}
3
/*-------------------------------------------*/
4
/* Taxonomy list widget
5
/*-------------------------------------------*/
6
+ class WP_Widget_VK_taxonomy_list extends WP_Widget {
7
+
8
// ウィジェット定義
9
function __construct() {
10
+ $widget_name = veu_get_short_name() . ' ' . __( 'Categories/Custom taxonomies list', 'vkExUnit' );
11
12
parent::__construct(
13
'WP_Widget_VK_taxonomy_list',
17
}
18
19
20
+ function widget( $args, $instance ) {
21
$instance = static::get_defaults( $instance );
22
+ if ( ! isset( $instance['tax_name'] ) ) {
23
+ $instance['tax_name'] = 'category';
24
+ }
25
+ if ( ! isset( $instance['label'] ) ) {
26
+ $instance['label'] = __( 'Category', 'vkExUnit' );
27
+ }
28
$arg = array(
29
+ 'echo' => 1,
30
+ 'style' => 'list',
31
+ 'show_count' => false,
32
+ 'show_option_all' => false,
33
+ 'hide_empty' => $instance['hide_empty'],
34
+ 'hierarchical' => true,
35
+ 'title_li' => '',
36
+ );
37
38
$arg['taxonomy'] = $instance['tax_name'];
39
40
?>
41
<?php echo $args['before_widget']; ?>
42
+ <div class="sideWidget widget_taxonomies widget_nav_menu">
43
<?php echo $args['before_title'] . $instance['label'] . $args['after_title']; ?>
44
+ <ul class="localNavi">
45
<?php wp_list_categories( $arg ); ?>
46
+ </ul>
47
+ </div>
48
<?php echo $args['after_widget']; ?>
49
<?php
50
}
51
52
53
+ public static function get_defaults( $instance = array() ) {
54
$defaults = array(
55
+ 'tax_name' => 'category',
56
+ 'label' => __( 'Category', 'vkExUnit' ),
57
+ 'hide' => __( 'Category', 'vkExUnit' ),
58
+ 'title' => 'Category',
59
+ 'hide_empty' => false,
60
+ '_builtin' => false,
61
);
62
return wp_parse_args( (array) $instance, $defaults );
63
}
64
65
66
+ function form( $instance ) {
67
$instance = static::get_defaults( $instance );
68
+ $taxs = get_taxonomies( array( 'public' => true ), 'objects' );
69
?>
70
+ <p>
71
<label for="<?php echo $this->get_field_id( 'label' ); ?>"><?php _e( 'Label to display', 'vkExUnit' ); ?></label>
72
<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/>
73
<input type="hidden" name="<?php echo $this->get_field_name( 'hide' ); ?>" ><br/>
74
75
+ <label for="<?php echo $this->get_field_id( 'tax_name' ); ?>"><?php _e( 'Display page', 'vkExUnit' ); ?></label>
76
<select name="<?php echo $this->get_field_name( 'tax_name' ); ?>" >
77
78
+ <?php foreach ( $taxs as $tax ) { ?>
79
+ <option value="<?php echo $tax->name; ?>"
80
+ <?php
81
+ if ( $instance['tax_name'] == $tax->name ) {
82
+ echo 'selected="selected"'; }
83
+ ?>
84
+ ><?php echo $tax->labels->name; ?></option>
85
<?php } ?>
86
+ </select><br/><br/>
87
+
88
+ <input type="checkbox" id="<?php echo $this->get_field_id( 'hide_empty' ); ?>" name="<?php echo $this->get_field_name( 'hide_empty' ); ?>" value="true"
89
+ <?php
90
+ if ( $instance['hide_empty'] ) {
91
+ echo 'checked';}
92
+ ?>
93
+ />
94
+ <label for="<?php echo $this->get_field_id( 'hide_empty' ); ?>"><?php _e( 'Do not display terms without posts', 'vkExUnit' ); ?></label>
95
</p>
96
97
+ <script type="text/javascript">
98
+ jQuery(document).ready(function($){
99
+ var post_labels = new Array();
100
<?php
101
foreach ( $taxs as $tax ) {
102
if ( isset( $tax->labels->name ) ) {
103
+ echo 'post_labels["' . $tax->name . '"] = "' . $tax->labels->name . '";';
104
}
105
}
106
+ echo 'post_labels["blog"] = "' . __( 'Blog', 'vkExUnit' ) . '";' . "\n";
107
?>
108
var posttype = jQuery("[name=\"<?php echo $this->get_field_name( 'tax_name' ); ?>\"]");
109
var lablfeld = jQuery("[name=\"<?php echo $this->get_field_name( 'label' ); ?>\"]");
110
+ posttype.change(function(){
111
+ lablfeld.val(post_labels[posttype.val()]+" <?php _e( 'Archives', 'vkExUnit' ); ?>");
112
+ });
113
+ });
114
+ </script>
115
<?php
116
}
117
118
119
+ function update( $new_instance, $old_instance ) {
120
$instance = $old_instance;
121
122
$instance['tax_name'] = $new_instance['tax_name'];
126
}
127
$instance['label'] = esc_html( $new_instance['label'] );
128
129
+ $instance['hide_empty'] = ( isset( $new_instance['hide_empty'] ) && $new_instance['hide_empty'] == 'true' );
130
131
return $instance;
132
}
133
} // class WP_Widget_top_list_info
134
135
136
+ add_action( 'widgets_init', 'vkExUnit_widget_register_taxonomy_list' );
137
+ function vkExUnit_widget_register_taxonomy_list() {
138
+ return register_widget( 'WP_Widget_VK_taxonomy_list' );
139
}
plugins/sns/widget-fb-page-plugin.php CHANGED
@@ -5,7 +5,7 @@
5
class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
6
7
function __construct() {
8
- $widget_name = vkExUnit_get_short_name(). '_' . 'FB Page Plugin';
9
10
parent::__construct(
11
'vkExUnit_fbPagePlugin',
@@ -24,11 +24,11 @@ class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
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">
@@ -49,13 +49,13 @@ class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
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'];
55
- $instance['height'] = $new_instance['height'];
56
- $instance['showFaces'] = $new_instance['showFaces'];
57
- $instance['hideCover'] = $new_instance['hideCover'];
58
- $instance['showPosts'] = $new_instance['showPosts'];
59
60
return $instance;
61
}
@@ -64,9 +64,9 @@ class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
64
function form( $instance ) {
65
66
$defaults = array(
67
- 'label' => 'Facebook',
68
- 'page_url' => '',
69
- 'height' => 600,
70
'showFaces' => 'false',
71
'hideCover' => 'false',
72
'showPosts' => 'true',
@@ -76,37 +76,39 @@ class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
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', function() {
111
- return register_widget( 'WP_Widget_vkExUnit_fbPagePlugin' );
112
- } );
5
class WP_Widget_vkExUnit_fbPagePlugin extends WP_Widget {
6
7
function __construct() {
8
+ $widget_name = veu_get_short_name() . ' ' . 'FB Page Plugin';
9
10
parent::__construct(
11
'vkExUnit_fbPagePlugin',
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">
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'];
55
+ $instance['height'] = $new_instance['height'];
56
+ $instance['showFaces'] = $new_instance['showFaces'];
57
+ $instance['hideCover'] = $new_instance['hideCover'];
58
+ $instance['showPosts'] = $new_instance['showPosts'];
59
60
return $instance;
61
}
64
function form( $instance ) {
65
66
$defaults = array(
67
+ 'label' => 'Facebook',
68
+ 'page_url' => '',
69
+ 'height' => 600,
70
'showFaces' => 'false',
71
'hideCover' => 'false',
72
'showPosts' => 'true',
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(
111
+ 'widgets_init', function() {
112
+ return register_widget( 'WP_Widget_vkExUnit_fbPagePlugin' );
113
+ }
114
+ );
plugins/sns/widget-twitter.php CHANGED
@@ -6,7 +6,7 @@ class VK_Twitter_Widget extends WP_Widget {
6
* ウィジェット名などを設定
7
*/
8
public function __construct() {
9
- $widget_name = vkExUnit_get_short_name() . '_' . __( 'Twitter', 'vkExUnit' );
10
parent::__construct(
11
'vk_twitter_widget', // Base ID
12
$widget_name, // Name
@@ -120,8 +120,12 @@ class VK_Twitter_Widget extends WP_Widget {
120
<?php // link color ?>
121
<p class="color_picker_wrap">
122
<label for="<?php echo $this->get_field_id( 'link_color' ); ?>"><?php _e( 'Link color:', 'vkExUnit' ); ?></label><br>
123
- <input type="text" id="<?php echo $this->get_field_id( 'link_color' ); ?>" class="color_picker admin-custom-input" name="<?php echo $this->get_field_name( 'link_color' ); ?>" value="<?php if ( $instance['link_color'] ) {
124
- echo esc_attr( $instance['link_color'] );} ?>" />
125
</p>
126
127
<?php
6
* ウィジェット名などを設定
7
*/
8
public function __construct() {
9
+ $widget_name = veu_get_short_name() . ' ' . __( 'Twitter', 'vkExUnit' );
10
parent::__construct(
11
'vk_twitter_widget', // Base ID
12
$widget_name, // Name
120
<?php // link color ?>
121
<p class="color_picker_wrap">
122
<label for="<?php echo $this->get_field_id( 'link_color' ); ?>"><?php _e( 'Link color:', 'vkExUnit' ); ?></label><br>
123
+ <input type="text" id="<?php echo $this->get_field_id( 'link_color' ); ?>" class="color_picker admin-custom-input" name="<?php echo $this->get_field_name( 'link_color' ); ?>" value="
124
+ <?php
125
+ if ( $instance['link_color'] ) {
126
+ echo esc_attr( $instance['link_color'] ); }
127
+ ?>
128
+ " />
129
</p>
130
131
<?php
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.4
6
Tested up to: 4.9.8
7
- Stable tag: 6.6.5
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
@@ -73,6 +73,10 @@ e.g.
73
74
== Changelog ==
75
76
= 6.6.3 =
77
* [ Profile Widget ][ bug fix ] Font Awesome 5 RSS icon bug fix
78
* [ PAGETOP BTN ] Change init name
4
Tags: Google Analytics, New posts, Related Posts, sitemap, sns, twitter card, Facebook Page Plugin, OG tags,
5
Requires at least: 4.4
6
Tested up to: 4.9.8
7
+ Stable tag: 6.6.6
8
License: GPLv2 or later
9
License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
73
74
== Changelog ==
75
76
+ = 6.6.6 =
77
+ * [ Button Widget ][ Add Function ] Reflect the widget label
78
+ * [ Banner Widget ][ Add Function ] Reflect the widget label
79
+
80
= 6.6.3 =
81
* [ Profile Widget ][ bug fix ] Font Awesome 5 RSS icon bug fix
82
* [ PAGETOP BTN ] Change init name
vkExUnit.php CHANGED
@@ -3,7 +3,7 @@
3
* Plugin Name: VK All in One Expansion Unit
4
* Plugin URI: https://ex-unit.nagoya
5
* Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
6
- * Version: 6.6.5
7
* Author: Vektor,Inc.
8
* Text Domain: vkExUnit
9
* Domain Path: /languages
3
* Plugin Name: VK All in One Expansion Unit
4
* Plugin URI: https://ex-unit.nagoya
5
* Description: This plug-in is an integrated plug-in with a variety of features that make it powerful your web site. Many features can be stopped individually. Example Facebook Page Plugin,Social Bookmarks,Print OG Tags,Print Twitter Card Tags,Print Google Analytics tag,New post widget,Insert Related Posts and more!
6
+ * Version: 6.6.6
7
* Author: Vektor,Inc.
8
* Text Domain: vkExUnit
9
* Domain Path: /languages