| @@ -143,5 +143,247 @@ | ||
| 143 | 143 | |
| 144 | 144 | public static function check_user_capability(){ |
| 145 | 145 | return current_user_can( 'manage_options' ) && is_user_logged_in(); |
| 146 | 146 | } |
| 147 | + | |
| 148 | + public static function ays_poll_allowed_html() { | |
| 149 | + $additionalAllowedTags = wp_kses_allowed_html('post'); | |
| 150 | + return array_merge( | |
| 151 | + $additionalAllowedTags, | |
| 152 | + array( | |
| 153 | + 'div' => array( | |
| 154 | + 'class' => true, | |
| 155 | + 'id' => true, | |
| 156 | + 'style' => true, | |
| 157 | + 'data-*' => true, | |
| 158 | + 'aria-selected' => true, | |
| 159 | + ), | |
| 160 | + 'svg' => array( | |
| 161 | + 'class' => true, | |
| 162 | + 'width' => true, | |
| 163 | + 'height' => true, | |
| 164 | + 'viewBox' => true, | |
| 165 | + 'viewbox' => true, | |
| 166 | + 'xmlns' => true, | |
| 167 | + 'fill' => true, | |
| 168 | + ), | |
| 169 | + 'path' => array( | |
| 170 | + 'class' => true, | |
| 171 | + 'd' => true, | |
| 172 | + 'fill' => true, | |
| 173 | + 'fill-rule' => true, | |
| 174 | + 'clip-rule' => true, | |
| 175 | + 'stroke-width' => true, | |
| 176 | + 'stroke-linecap' => true, | |
| 177 | + ), | |
| 178 | + 'circle' => array( | |
| 179 | + 'style' => true, | |
| 180 | + 'id' => true, | |
| 181 | + 'class' => true, | |
| 182 | + 'r' => true, | |
| 183 | + 'cx' => true, | |
| 184 | + 'cy' => true, | |
| 185 | + ), | |
| 186 | + 'rect' => array( | |
| 187 | + 'class' => true, | |
| 188 | + 'x' => true, | |
| 189 | + 'y' => true, | |
| 190 | + 'width' => true, | |
| 191 | + 'height' => true, | |
| 192 | + 'rx' => true, | |
| 193 | + 'fill' => true, | |
| 194 | + 'stroke' => true, | |
| 195 | + 'style' => true, | |
| 196 | + 'transform' => true, | |
| 197 | + ), | |
| 198 | + 'defs' => array( | |
| 199 | + 'class' => true, | |
| 200 | + 'width' => true, | |
| 201 | + 'height' => true, | |
| 202 | + 'fill' => true, | |
| 203 | + 'style' => true, | |
| 204 | + ), | |
| 205 | + 'pattern' => array( | |
| 206 | + 'class' => true, | |
| 207 | + 'id' => true, | |
| 208 | + 'width' => true, | |
| 209 | + 'height' => true, | |
| 210 | + 'patternContentUnits' => true, | |
| 211 | + 'patterncontentunits' => true, | |
| 212 | + 'style' => true, | |
| 213 | + ), | |
| 214 | + 'use' => array( | |
| 215 | + 'class' => true, | |
| 216 | + 'id' => true, | |
| 217 | + 'xlink' => true, | |
| 218 | + 'xlink:href' => true, | |
| 219 | + 'transform' => true, | |
| 220 | + 'style' => true, | |
| 221 | + ), | |
| 222 | + 'image' => array( | |
| 223 | + 'class' => true, | |
| 224 | + 'id' => true, | |
| 225 | + 'xlink' => true, | |
| 226 | + 'xlink:href' => true, | |
| 227 | + 'width' => true, | |
| 228 | + 'height' => true, | |
| 229 | + 'style' => true, | |
| 230 | + ), | |
| 231 | + 'video' => array( | |
| 232 | + 'class' => true, | |
| 233 | + 'id' => true, | |
| 234 | + 'controls' => true, | |
| 235 | + 'style' => true, | |
| 236 | + ), | |
| 237 | + 'source' => array( | |
| 238 | + 'class' => true, | |
| 239 | + 'id' => true, | |
| 240 | + 'src' => true, | |
| 241 | + 'style' => true, | |
| 242 | + ), | |
| 243 | + 'form' => array( | |
| 244 | + 'name' => true, | |
| 245 | + 'id' => true, | |
| 246 | + 'action' => true, | |
| 247 | + 'method' => true, | |
| 248 | + 'data-*' => true, | |
| 249 | + 'style' => true, | |
| 250 | + ), | |
| 251 | + 'input' => array( | |
| 252 | + 'id' => true, | |
| 253 | + 'name' => true, | |
| 254 | + 'class' => true, | |
| 255 | + 'type' => true, | |
| 256 | + 'value' => true, | |
| 257 | + 'size' => true, | |
| 258 | + 'required' => true, | |
| 259 | + 'readonly' => true, | |
| 260 | + 'data-*' => true, | |
| 261 | + 'style' => true, | |
| 262 | + ), | |
| 263 | + 'select' => array( | |
| 264 | + 'id' => true, | |
| 265 | + 'name' => true, | |
| 266 | + 'class' => true, | |
| 267 | + 'type' => true, | |
| 268 | + 'value' => true, | |
| 269 | + 'size' => true, | |
| 270 | + 'required' => true, | |
| 271 | + 'readonly' => true, | |
| 272 | + 'data-*' => true, | |
| 273 | + 'style' => true, | |
| 274 | + ), | |
| 275 | + 'option' => array( | |
| 276 | + 'id' => true, | |
| 277 | + 'class' => true, | |
| 278 | + 'type' => true, | |
| 279 | + 'value' => true, | |
| 280 | + 'size' => true, | |
| 281 | + 'required' => true, | |
| 282 | + 'readonly' => true, | |
| 283 | + 'data-*' => true, | |
| 284 | + 'style' => true, | |
| 285 | + ), | |
| 286 | + 'progress' => array( | |
| 287 | + 'id' => true, | |
| 288 | + 'class' => true, | |
| 289 | + 'max' => true, | |
| 290 | + 'value' => true, | |
| 291 | + 'data-*' => true, | |
| 292 | + 'style' => true, | |
| 293 | + ), | |
| 294 | + 'img' => array( | |
| 295 | + 'id' => true, | |
| 296 | + 'class' => true, | |
| 297 | + 'loading' => true, | |
| 298 | + 'decoding' => true, | |
| 299 | + 'src' => true, | |
| 300 | + 'sizes' => true, | |
| 301 | + 'srcset' => true, | |
| 302 | + 'width' => true, | |
| 303 | + 'height' => true, | |
| 304 | + ), | |
| 305 | + 'a' => array( | |
| 306 | + 'aria-selected' => true, | |
| 307 | + 'data-*' => true, | |
| 308 | + 'style' => true, | |
| 309 | + 'target' => true, | |
| 310 | + ), | |
| 311 | + ), | |
| 312 | + $additionalAllowedTags | |
| 313 | + ); | |
| 314 | + } | |
| 315 | + | |
| 316 | + public static function ays_poll_custom_allowed_html() { | |
| 317 | + $additionalAllowedTags = self::ays_poll_allowed_html(); | |
| 318 | + return array_merge( | |
| 319 | + $additionalAllowedTags, | |
| 320 | + array( | |
| 321 | + 'iframe' => array( | |
| 322 | + 'class' => true, | |
| 323 | + 'id' => true, | |
| 324 | + 'width' => true, | |
| 325 | + 'height' => true, | |
| 326 | + 'src' => true, | |
| 327 | + 'title' => true, | |
| 328 | + 'frameborder' => true, | |
| 329 | + 'allow' => true, | |
| 330 | + 'allowfullscreen' => true, | |
| 331 | + 'loading' => true, | |
| 332 | + 'referrerpolicy' => true, | |
| 333 | + 'style' => true, | |
| 334 | + ), | |
| 335 | + 'audio' => array( | |
| 336 | + 'class' => true, | |
| 337 | + 'id' => true, | |
| 338 | + 'controls' => true, | |
| 339 | + 'autoplay' => true, | |
| 340 | + 'loop' => true, | |
| 341 | + 'muted' => true, | |
| 342 | + 'preload' => true, | |
| 343 | + 'src' => true, | |
| 344 | + 'style' => true, | |
| 345 | + ), | |
| 346 | + 'source' => array( | |
| 347 | + 'src' => true, | |
| 348 | + 'type' => true, | |
| 349 | + ), | |
| 350 | + 'track' => array( | |
| 351 | + 'kind' => true, | |
| 352 | + 'src' => true, | |
| 353 | + 'srclang' => true, | |
| 354 | + 'label' => true, | |
| 355 | + 'default' => true, | |
| 356 | + ), | |
| 357 | + 'video' => array( | |
| 358 | + 'class' => true, | |
| 359 | + 'id' => true, | |
| 360 | + 'width' => true, | |
| 361 | + 'height' => true, | |
| 362 | + 'controls' => true, | |
| 363 | + 'autoplay' => true, | |
| 364 | + 'loop' => true, | |
| 365 | + 'muted' => true, | |
| 366 | + 'poster' => true, | |
| 367 | + 'preload' => true, | |
| 368 | + 'src' => true, | |
| 369 | + 'style' => true, | |
| 370 | + ), | |
| 371 | + 'picture' => array( | |
| 372 | + 'class' => true, | |
| 373 | + 'id' => true, | |
| 374 | + ), | |
| 375 | + 'figure' => array( | |
| 376 | + 'class' => true, | |
| 377 | + 'id' => true, | |
| 378 | + 'style' => true, | |
| 379 | + ), | |
| 380 | + 'figcaption' => array( | |
| 381 | + 'class' => true, | |
| 382 | + 'id' => true, | |
| 383 | + 'style' => true, | |
| 384 | + ), | |
| 385 | + ), | |
| 386 | + $additionalAllowedTags | |
| 387 | + ); | |
| 388 | + } | |
| 147 | 389 | } |