質問編集履歴

1

内容の追加

2018/12/04 07:46

投稿

YuriY
YuriY

スコア33

test CHANGED
File without changes
test CHANGED
@@ -121,3 +121,71 @@
121
121
  ```
122
122
 
123
123
  何かお分かりになる方がいらっしゃったらご助言よろしくお願いいたします。
124
+
125
+
126
+
127
+
128
+
129
+ ショートコードのパラメータに
130
+
131
+ custom_args="" というのがあって
132
+
133
+ 受け取り側で
134
+
135
+
136
+
137
+ 分解してarg[]に変換する処理をしているようでした。
138
+
139
+ なので、custom_args="suppress_filters:false;"を追加してみましたが
140
+
141
+
142
+
143
+ ```
144
+
145
+
146
+
147
+ // Custom Args
148
+
149
+ var_dump($custom_args);
150
+
151
+
152
+
153
+ if(!empty($custom_args)){
154
+
155
+ $custom_args_array = explode(";",$custom_args); // Split the $custom_args at ','
156
+
157
+ foreach($custom_args_array as $argument){ // Loop each $argument
158
+
159
+
160
+
161
+ $argument = preg_replace('/\s+/', '', $argument); // Remove all whitespace
162
+
163
+ $argument = explode(":",$argument); // Split the $argument at ':'
164
+
165
+ $argument_arr = explode(",", $argument[1]); // explode $argument[1] at ','
166
+
167
+ if(sizeof($argument_arr) > 1){
168
+
169
+ $args[$argument[0]] = $argument_arr;
170
+
171
+ }else{
172
+
173
+ $args[$argument[0]] = $argument[1];
174
+
175
+ }
176
+
177
+ }
178
+
179
+ }
180
+
181
+ ```
182
+
183
+
184
+
185
+ ブラウザ側のデバッガをみると
186
+
187
+ SyntaxError: Unexpected token s in JSON at position 0
188
+
189
+
190
+
191
+ シンタックスエラーが出ています。