Repository navigation
Expand file tree
/
Copy pathsimple-location.php
More file actions
executable file
·693 lines (637 loc) · 23.3 KB
/
Copy pathsimple-location.php
File metadata and controls
executable file
·693 lines (637 loc) · 23.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
<?php
/**
* Plugin Name: Simple Location
* Plugin URI: https://wordpress.org/plugins/simple-location/
* Description: Adds Location to WordPress
* Version: 6.6.0
* Requires at least: 6.2
* Requires PHP: 7.4
* Requires CP: 2.7
* Author: David Shanske
* Author URI: https://david.shanske.com
* License: GPLv2 or later
* License URI: http://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: simple-location
* Domain Path: /languages
*
* @package Simple_Location
*/
defined( 'ABSPATH' ) || exit;
add_action( 'plugins_loaded', array( 'Simple_Location_Plugin', 'init' ) );
// Activation and Deactivation Hooks.
register_activation_hook( __FILE__, array( 'Simple_Location_Plugin', 'activate' ) );
register_deactivation_hook( __FILE__, array( 'Simple_Location_Plugin', 'deactivate' ) );
add_action( 'upgrader_process_complete', array( 'Simple_Location_Plugin', 'upgrader_process_complete' ), 10, 2 );
if ( ! defined( 'SLOC_PER_PAGE' ) ) {
define( 'SLOC_PER_PAGE', 100 );
}
/**
* Simple Location Base Class.
*
* Loads plugin.
*
* @since 1.0.0
*/
class Simple_Location_Plugin {
/**
* Version number
*
* @since 1.0.0
* @var string
*/
public static $version;
/**
* Plugin Path
*
* @since 1.0.0
* @var string
*/
public static $path;
/**
* Plugin Activation Function.
*
* Triggered on Plugin Activation to add rewrite rules.
*
* @since 1.0.0
* @since 6.1.0 Adds the GeoJSON feed's rules.
*/
public static function activate() {
require_once plugin_dir_path( __FILE__ ) . 'includes/class-geo-base.php';
require_once plugin_dir_path( __FILE__ ) . 'includes/class-sloc-geojson.php';
Geo_Base::rewrite();
add_feed( Sloc_GeoJSON::FEED, array( 'Sloc_GeoJSON', 'feed' ) );
flush_rewrite_rules();
}
/**
* Plugin Deactivation Function.
*
* Triggered on Plugin Deactivation to flush rewrite rules.
*
* @since 1.0.0
* @since 6.0.0 Also unschedules the data cleanup; it is scheduled again if it hasn't finished.
*/
public static function deactivate() {
flush_rewrite_rules();
wp_clear_scheduled_hook( 'sloc_data_cleanup' );
}
/**
* Upgrade Trigger.
* Triggered on Plugin Upgrade to Flush Rewrite Rules
*
* @param WP_Upgrader $upgrade_object WP_Upgrader object.
* @param array $options Array of bulk item update data.
*/
public static function upgrader_process_complete( $upgrade_object, $options ) {
$current_plugin_path_name = plugin_basename( __FILE__ );
if ( ( 'update' === $options['action'] ) && ( 'plugin' === $options['type'] ) ) {
foreach ( $options['plugins'] as $each_plugin ) {
if ( $each_plugin === $current_plugin_path_name ) {
flush_rewrite_rules();
}
}
}
}
/**
* Load files.
*
* Checks for the existence of and loads files.
* @param array $files An array of filenames.
* @param string $dir The directory the files can be found in, relative to the current directory.
*
* @since 4.0.0
*/
public static function load( $files, $dir = 'includes/' ) {
$dir = trailingslashit( $dir );
if ( empty( $files ) ) {
return;
}
$path = plugin_dir_path( __FILE__ ) . $dir;
foreach ( $files as $file ) {
if ( file_exists( $path . $file ) ) {
require_once $path . $file;
} else {
/* translators: %s: File path. */
self::loader_error( __METHOD__, sprintf( __( 'Cannot find %s.', 'simple-location' ), $path . $file ) );
}
}
}
/**
* Reports a file the loader can't use, with wp_trigger_error().
*
* On WordPress before 6.4, wp_trigger_error() comes from the polyfill in compat-functions.php,
* which is the file being reported if it is missing; in that case nothing is reported.
*
* @since 6.0.0
*
* @param string $function_name The function that found the problem.
* @param string $message The message.
*/
private static function loader_error( $function_name, $message ) {
if ( function_exists( 'wp_trigger_error' ) ) {
wp_trigger_error( $function_name, $message );
}
}
/**
* Filename to Classname Function.
*
* @param string $filename File name, such as class-weather-provider-foo.php.
* @return string|false Class name, such as Weather_Provider_Foo, or false if there is no such class.
*
* @since 4.6.0
*/
public static function filename_to_classname( $filename ) {
$class = str_replace( 'class-', '', $filename );
$class = str_replace( '.php', '', $class );
$class = ucwords( $class, '-' );
$class = str_replace( '-', '_', $class );
if ( class_exists( $class ) ) {
return $class;
}
return false;
}
/**
* Load and register files.
*
* Checks for the existence of and loads files, then registers them as providers.
* @param array $files An array of filenames.
* @param string $dir The directory the files can be found in, relative to the current directory.
*
* @since 4.6.0
*/
public static function register_providers( $files, $dir = 'includes/' ) {
$dir = trailingslashit( $dir );
if ( empty( $files ) ) {
return;
}
$path = plugin_dir_path( __FILE__ ) . $dir;
foreach ( $files as $file ) {
if ( file_exists( $path . $file ) ) {
require_once $path . $file;
if ( str_contains( $file, 'provider' ) ) {
$class = self::filename_to_classname( $file );
if ( $class ) {
register_sloc_provider( new $class() );
} else {
/* translators: %s: File path. */
self::loader_error( __METHOD__, sprintf( __( 'Cannot register a provider from %s: no class matches the file name.', 'simple-location' ), $path . $file ) );
}
}
} else {
/* translators: %s: File path. */
self::loader_error( __METHOD__, sprintf( __( 'Cannot find %s.', 'simple-location' ), $path . $file ) );
}
}
}
/**
* Load text domain for translations.
*
* WordPress 4.6 and later, and ClassicPress, load the plugin's translations when they're
* first needed, and the plugin bundles none of its own, so this is no longer needed.
*
* @since 5.0.24
* @deprecated 6.0.0 Translations load automatically.
*/
public static function load_textdomain() {
_deprecated_function( __METHOD__, '6.0.0' );
}
/**
* Plugin Initializaton Function.
*
* Meant to be attached to plugins_loaded hook.
*
* @since 1.0.0
*/
public static function init() {
self::$version = get_file_data( __FILE__, array( 'Version' => 'Version' ) )['Version'];
self::$path = plugin_dir_path( __FILE__ );
// Load stylesheets.
add_action( 'wp_enqueue_scripts', array( static::class, 'style_load' ) );
// Settings Link.
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( static::class, 'settings_link' ) );
// Add Privacy Policy.
add_action( 'admin_init', array( static::class, 'privacy_declaration' ) );
// Core Load Files.
$core = array(
'compat-functions.php', // Polyfills; loaded first so every other file can use them.
'functions.php', // Global Functions.
'class-geo-base.php', // Register Geo Base Functions that Modify Core Functionality
'class-geo-data.php', // Register Geo Metadata Functions.
'trait-weather-info.php', // Weather Information Such as Icons.
'class-weather-data.php', // Register Weather Metadata Functions.
'class-sloc-weather-archive.php', // Weather views of archives.
'trait-geolocation-trait.php', // Geolocation Trait.
'class-sloc-address-format.php', // Per-country address conventions.
'class-sloc-address-finisher.php', // The site's country choices and names in its language, for every address.
'trait-sloc-osm-address.php', // Nominatim-style OpenStreetMap address parsing.
'trait-sloc-osm-geo.php', // The same, for geo providers.
'trait-sloc-osm-venue.php', // The same, for venue providers.
'data-functions.php', // Global Data Functions to retrieve and store data.
'class-sloc-media-metadata.php', // Media Metadata Functions.
'class-post-venue.php', // Venue CPT.
'class-sloc-merge.php', // Merging duplicate venues.
'class-sloc-venue-status.php', // Venues that have closed.
'class-sloc-provider-test.php', // Test buttons on the API Keys page.
'class-location-taxonomy.php', // Venue Taxonomy.
'class-sloc-provider.php', // Base Provider Class.
'class-map-provider.php', // Map Provider Class.
'class-sloc-map-cache.php', // Map images served from the site.
'class-sloc-track.php', // Tracks, as encoded polylines.
'class-sloc-map-shortcode.php', // The [sloc_map] shortcode.
'class-geo-provider.php', // Geo Provider Class.
'class-elevation-provider.php', // Elevation Provider Class.
'class-venue-provider.php', // Venue Provider Class.
'class-weather-provider.php', // Weather Provider Class.
'class-location-provider.php', // Location Provider Class.
'class-location-provider-account.php', // Location Providers for a user's own location history service.
'class-rest-geo.php', // REST endpoint for Geo.
'class-sloc-provider-chain.php', // Providers tried in order.
'class-sloc-plus-code.php', // Plus Codes.
'class-sloc-geojson.php', // GeoJSON feeds.
'class-sloc-provider-errors.php', // Provider errors for administrators.
'class-loc-config.php', // Configuration and Settings Page.
'class-sloc-track-tool.php', // Tools > Location Track.
'class-sloc-location-repair.php', // Repairs location data saved by earlier versions.
'class-sloc-location-repair-tool.php', // Tools > Location Repair, and wp location repair.
'class-sloc-weather-fill.php', // Readings filled in from Open-Meteo, and Tools > Weather Fill.
'class-timezone-result.php',
'class-astronomical-calculator.php', // Calculates sunrise sunset etc.
'class-location-plugins.php',
'class-loc-timezone.php',
'class-sloc-data-index.php', // Sorted indexes of the bundled data files.
'class-sloc-geo-grid.php', // Offline lookup in grids of areas.
'class-sloc-offline-geo.php', // Offline country, place and timezone lookup.
'class-airport-location.php',
);
// Load Core Files.
self::load( $core );
// Load Widgets.
$widgets = array(
'class-sloc-weather-widget.php', // Weather Widget.
'class-sloc-station-widget.php', // Weather Station Widget.
'class-sloc-airport-widget.php', // Airport Weather Widget.
'class-sloc-lastseen-widget.php', // Last Location Seen Widget.
);
self::load( $widgets, 'includes/widgets/' );
add_action( 'widgets_init', array( static::class, 'widgets_init' ) );
$libraries = array(
'class-sloc-polyline.php', // Polyline Encoding Library.
);
self::load( $libraries, 'lib/' );
// Load API Traits. These are common code for the providers that offer different types of data.
$traits = array(
'trait-sloc-api-google.php', // Google Maps API Traits.
'trait-sloc-api-here.php', // HERE API Traits.
'trait-sloc-api-locationiq.php', // LocationIQ API Traits.
'trait-sloc-api-mapquest.php', // MapQuest API Traits.
'trait-sloc-api-openroute.php', // OpenRoute API Traits.
'trait-sloc-api-geoapify.php', // GeoApify API Traits.
'trait-sloc-api-geonames.php', // GeoNames API Traits.
'trait-sloc-api-mapbox.php', // MapBox API Traits.
'trait-sloc-api-tomtom.php', // TomTom API Traits.
'trait-sloc-api-stadia.php', // Stadia Maps API Traits.
'trait-sloc-api-nominatim.php', // Nominatim API Traits.
);
self::load( $traits, 'includes/apis/' );
// Load Location Providers.
$providers = array(
'class-location-provider-dummy.php', // Dummy Location Provider.
'class-location-provider-airport.php', // Airport Location Provider.
'class-location-provider-address.php', // Address Lookup Location Provider.
'class-location-provider-compass.php', // Compass https://github.com/aaronpk/Compass Location Provder.
'class-location-provider-dawarich.php', // Dawarich.
'class-location-provider-geopulse.php', // GeoPulse.
);
self::register_providers( $providers, 'includes/location/' );
// Load Weather Providers.
$providers = array(
'class-weather-provider-openweathermap.php', // Open Weather Map.
'class-weather-provider-nwsus.php', // National Weather Service (US).
'class-weather-provider-weatherstack.php', // weatherstack.com.
'class-weather-provider-weatherbit.php', // weatherbit.com.
'class-weather-provider-here.php', // HERE.
'class-weather-provider-aeris.php', // Aeris Weather.
'class-weather-provider-visualcrossing.php', // Visual Crossing.
'class-weather-provider-meteostat.php', // Meteostat.
'class-weather-provider-pirateweather.php', // Pirate Weather.
'class-weather-provider-openmeteo.php', // Open-Meteo.
'class-weather-provider-metno.php', // MET Norway.
'class-weather-provider-eccc.php', // Environment Canada.
'class-weather-provider-station.php', // Custom Station Weather Provider.
'class-weather-provider-weewx.php', // WeeWX, with weewx-current-json.
);
self::register_providers( $providers, 'includes/weather/' );
// Load Map Providers.
$providers = array(
'class-map-provider-mapbox.php', // MapBox.
'class-map-provider-google.php', // Google.
'class-map-provider-mapquest.php', // MapQuest.
'class-map-provider-here.php', // HERE.
'class-map-provider-locationiq.php', // LocationIQ.
'class-map-provider-geoapify.php', // Geoapify.
'class-map-provider-tomtom.php', // Tom Tom.
'class-map-provider-stadia.php', // Stadia Maps.
'class-map-provider-tileserver.php', // TileServer GL, self-hosted.
'class-map-provider-staticmap.php', // Custom Provider.
);
self::register_providers( $providers, 'includes/map/' );
// Load Geo Providers.
$providers = array(
'class-geo-provider-nominatim.php', // Nominatim.
'class-geo-provider-photon.php', // Photon.
'class-geo-provider-traccar-geocoder.php', // Traccar Geocoder.
'class-geo-provider-offline.php', // Offline, from the bundled data.
'class-geo-provider-pelias.php', // Pelias.
'class-geo-provider-mapquest.php', // MapQuest.
'class-geo-provider-google.php', // Google.
'class-geo-provider-geoapify.php', // Geoapify.
'class-geo-provider-here.php', // HERE.
'class-geo-provider-locationiq.php', // LocationIQ.
'class-geo-provider-geonames.php', // Geonames.
'class-geo-provider-openroute.php', // OpenRoute.
);
self::register_providers( $providers, 'includes/geo/' );
// Load Elevation Providers.
$providers = array(
'class-elevation-provider-geonames.php', // Geonames.
'class-elevation-provider-google.php', // Google.
'class-elevation-provider-openroute.php', // OpenRoute.
'class-elevation-provider-opentopodata.php', // Open Topo Data.
);
self::register_providers( $providers, 'includes/elevation/' );
// Load Venue Providers.
$providers = array(
'class-venue-provider-nominatim.php', // Nominatim.
'class-venue-provider-google.php', // Google.
'class-venue-provider-locationiq.php',
'class-venue-provider-overpass.php', // OpenStreetMap Overpass.
'class-venue-provider-geoapify.php', // Geoapify.
'class-venue-provider-here.php', // HERE.
'class-venue-provider-tomtom.php', // TomTom.
'class-venue-provider-pelias.php', // Pelias.
'class-venue-provider-stadia.php', // Stadia Maps, a Pelias server.
'class-venue-provider-foursquare.php', // Foursquare.
'class-venue-provider-thereabouts.php', // Thereabouts, your own server.
);
self::register_providers( $providers, 'includes/venue/' );
}
/**
* Widgets Initializaton Function.
*
* Registers Widgets.
*
* @since 1.0.0
*/
public static function widgets_init() {
register_widget( 'Sloc_Weather_Widget' );
register_widget( 'Sloc_Station_Widget' );
register_widget( 'Sloc_Airport_Widget' );
register_widget( 'Sloc_Lastseen_Widget' );
}
/** Adds link to Plugin Page for Options Page.
*
* @param array $links Array of Existing Links.
* @return array Modified Links.
*/
public static function settings_link( $links ) {
$settings_link = '<a href="admin.php?page=simloc">' . __( 'Settings', 'simple-location' ) . '</a>';
$links[] = $settings_link;
return $links;
}
/**
* Registers the front-end stylesheet, and enqueues it on pages that show location, weather or maps.
*
* Output that turns up anyway, such as from a theme's template, enqueues it with enqueue_styles(), and it is then
* printed in the footer.
*
* @since 1.0.0
* @since 6.2.0 Enqueued only on pages that need it; see needs_styles().
*/
public static function style_load() {
wp_register_style( 'simple-location', plugin_dir_url( __FILE__ ) . 'css/location.min.css', array(), self::$version );
if ( self::needs_styles() ) {
wp_enqueue_style( 'simple-location' );
}
}
/**
* Enqueues the front-end stylesheet, from code that prints location, weather or maps. Hooked nowhere.
*
* @since 6.2.0
*/
public static function enqueue_styles() {
if ( is_admin() || ! wp_style_is( 'simple-location', 'registered' ) ) {
return;
}
wp_enqueue_style( 'simple-location' );
}
/**
* Whether the current page shows the plugin's location, weather or maps, so the stylesheet goes in the head.
*
* True for the plugin's archive views (map, temperature, rain, snow and weather), for pages with one of the
* plugin's widgets, and for pages whose posts have a location or weather.
*
* @since 6.2.0
*
* @return bool
*/
public static function needs_styles() {
global $wp_query, $wp_widget_factory;
$needs = false;
if ( $wp_query instanceof WP_Query && ( '' !== Sloc_Weather_Archive::get_view() || array_key_exists( 'map', $wp_query->query_vars ) ) ) {
$needs = true;
}
if ( ! $needs && $wp_widget_factory instanceof WP_Widget_Factory ) {
foreach ( array( 'Sloc_Weather_Widget', 'Sloc_Station_Widget', 'Sloc_Lastseen_Widget', 'Sloc_Airport_Widget' ) as $class ) {
if ( isset( $wp_widget_factory->widgets[ $class ] ) && is_active_widget( false, false, $wp_widget_factory->widgets[ $class ]->id_base, true ) ) {
$needs = true;
break;
}
}
}
if ( ! $needs && $wp_query instanceof WP_Query && ! empty( $wp_query->posts ) ) {
// The query has loaded the posts' meta, so this doesn't query the database again.
foreach ( $wp_query->posts as $post ) {
$id = is_object( $post ) ? $post->ID : (int) $post;
foreach ( array( 'geo_latitude', 'geo_address', 'weather_temperature', 'weather_code' ) as $key ) {
if ( '' !== get_post_meta( $id, $key, true ) ) {
$needs = true;
break 2;
}
}
}
}
/**
* Filters whether the front-end stylesheet is enqueued in the head of the current page.
*
* Return true to load it on every page, as before 6.2.0, such as for a theme that shows locations in ways the
* plugin can't detect. Output from the plugin's functions enqueues it anyway, printed in the footer.
*
* @since 6.2.0
*
* @param bool $needs Whether the page shows location, weather or maps.
*/
return (bool) apply_filters( 'sloc_enqueue_styles', $needs );
}
/**
* Privacy Declaration.
*
* Adds a privacy policy declaration to the WordPress Privacy system.
*
* @since 1.0.0
*/
public static function privacy_declaration() {
if ( function_exists( 'wp_add_privacy_policy_content' ) ) {
$content = __(
'Location and weather data is optionally stored for all posts, attachments, and comments. Location data is extracted from uploaded images along with other metadata. This
data can be removed prior to uploading if tyou do not wish this to be stored. There are options to display this information or hide it.',
'simple-location'
);
wp_add_privacy_policy_content(
'Simple Location',
wp_kses_post( wpautop( $content, false ) )
);
}
}
/**
* Generic Filter Set of HTML paramaters for KSES
*
* @since 6.0.0 Allows the markup the plugin's own location and map output uses: `target` on links, `style`
* on spans (filtered by safecss_filter_attr()), `loading` on images, and `data` elements.
* @since 6.3.0 Allows the SVG shapes, masks and clip paths of the Meteocons icons.
*
* @return array Array of HTML elements.
*/
public static function kses_clean() {
// Presentation attributes the weather icons' shapes use.
$shape = array_fill_keys( array( 'id', 'fill', 'fill-rule', 'clip-rule', 'clip-path', 'mask', 'stroke', 'stroke-width', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-dasharray', 'transform' ), array() );
return array(
'a' => array(
'class' => array(),
'href' => array(),
'name' => array(),
'target' => array(),
),
'data' => array(
'class' => array(),
'value' => array(),
),
'abbr' => array(),
'b' => array(),
'br' => array(),
'code' => array(),
'ins' => array(),
'del' => array(),
'em' => array(),
'i' => array(),
'q' => array(),
'strike' => array(),
'strong' => array(),
'time' => array(
'datetime' => array(),
),
'blockquote' => array(),
'pre' => array(),
'p' => array(
'class' => array(),
'id' => array(),
),
'h1' => array(
'class' => array(),
),
'h2' => array(
'class' => array(),
),
'h3' => array(
'class' => array(),
),
'h4' => array(
'class' => array(),
),
'h5' => array(
'class' => array(),
),
'h6' => array(
'class' => array(),
),
'ul' => array(
'class' => array(),
'id' => array(),
'title' => array(),
'aria-label' => array(),
'aria-hidden' => array(),
),
'li' => array(
'class' => array(),
'id' => array(),
'title' => array(),
'aria-label' => array(),
'aria-hidden' => array(),
),
'ol' => array(),
'span' => array(
'class' => array(),
'id' => array(),
'style' => array(),
'title' => array(),
'aria-label' => array(),
'aria-hidden' => array(),
'data-prefix' => array(),
'data-icon' => array(),
),
'section' => array(
'class' => array(),
'id' => array(),
),
'img' => array(
'src' => array(),
'class' => array(),
'id' => array(),
'alt' => array(),
'title' => array(),
'width' => array(),
'height' => array(),
'srcset' => array(),
'loading' => array(),
),
'figure' => array(),
'figcaption' => array(),
'picture' => array(
'srcset' => array(),
'type' => array(),
),
'source' => array(
'srcset' => array(),
'media' => array(),
'type' => array(),
),
'svg' => array(
'version' => array(),
'viewbox' => array(),
'id' => array(),
'x' => array(),
'y' => array(),
'xmlns' => array(),
'xmlns:xlink' => array(),
'xml:space' => array(),
'style' => array(),
'aria-hidden' => array(),
'focusable' => array(),
'class' => array(),
'role' => array(),
'height' => array(),
'width' => array(),
'fill' => array(),
),
'div' => array(
'class' => array(),
'id' => array(),
),
'g' => $shape,
'path' => array_merge( $shape, array( 'd' => array() ) ),
'circle' => array_merge( $shape, array_fill_keys( array( 'cx', 'cy', 'r' ), array() ) ),
'rect' => array_merge( $shape, array_fill_keys( array( 'x', 'y', 'width', 'height', 'rx', 'ry' ), array() ) ),
'defs' => array(),
'clippath' => array( 'id' => array() ),
'mask' => array_fill_keys( array( 'id', 'mask-type', 'maskunits', 'x', 'y', 'width', 'height' ), array() ),
);
}
}