File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ class Admin {
13
13
'client_id ' => '' ,
14
14
'client_secret ' => '' ,
15
15
'callback_url ' => '' ,
16
+ 'shop_url ' => '' ,
16
17
);
17
18
18
19
public function admin_head () {
Original file line number Diff line number Diff line change @@ -44,6 +44,14 @@ public static function register_setting_fields() {
44
44
$ section
45
45
);
46
46
47
+ add_settings_field (
48
+ 'shop_url '
49
+ ,'ショップURL ' ,
50
+ array ( View::class, 'field_shop_url ' ),
51
+ $ key ,
52
+ $ section
53
+ );
54
+
47
55
add_settings_field (
48
56
'use_default_css '
49
57
,'プラグインCSSを使用する ' ,
@@ -270,6 +278,17 @@ function copy_callback_url() {
270
278
<?php
271
279
}
272
280
281
+ public static function field_shop_url () { ?>
282
+ <input
283
+ type="text"
284
+ id="shop_url"
285
+ name="<?php echo Admin::OPTIONS_KEY ?> [shop_url]"
286
+ class="regular-text"
287
+ value="<?php echo esc_attr ( Admin::option ( 'shop_url ' ) ) ?> "
288
+ />
289
+ <?php
290
+ }
291
+
273
292
public static function field_use_default_css () { ?>
274
293
<input
275
294
type="checkbox"
Original file line number Diff line number Diff line change @@ -121,6 +121,10 @@ public function item_list( $items ) {
121
121
122
122
//set globals
123
123
$ GLOBALS [ 'base_items ' ] = $ items ;
124
+
125
+ foreach ( $ items as $ index => $ item ) {
126
+ $ items [$ index ]->shop_url = untrailingslashit ( Admin::option ('shop_url ' ) );
127
+ }
124
128
125
129
ob_start ();
126
130
if ( is_file ( get_stylesheet_directory () . '/base_items.php ' ) ) {
You can’t perform that action at this time.
0 commit comments