Changeset 3810578
- Timestamp:
- 11/19/2026 03:23:05 AM (less than one hour ago)
- Location:
- indieweb-post-kinds
- Files:
-
- 4 added
- 56 edited
- 1 copied
-
tags/4.0.2 (copied) (copied from indieweb-post-kinds/trunk )
-
tags/4.0.2/.gitattributes (modified) (1 diff)
-
tags/4.0.2/develop.txt (modified) (4 diffs)
-
tags/4.0.2/includes/class-kind-fields.php (modified) (20 diffs)
-
tags/4.0.2/includes/class-kind-media-metadata.php (modified) (1 diff)
-
tags/4.0.2/includes/class-kind-taxonomy.php (modified) (5 diffs)
-
tags/4.0.2/includes/class-post-kind.php (modified) (3 diffs)
-
tags/4.0.2/includes/register-kinds.php (modified) (45 diffs)
-
tags/4.0.2/includes/time-functions.php (modified) (1 diff)
-
tags/4.0.2/indieweb-post-kinds.php (modified) (1 diff)
-
tags/4.0.2/languages/indieweb-post-kinds.pot (modified) (16 diffs)
-
tags/4.0.2/lib/parse-this/includes/class-base.php (modified) (3 diffs)
-
tags/4.0.2/lib/parse-this/includes/class-discovery.php (modified) (1 diff)
-
tags/4.0.2/lib/parse-this/includes/class-html.php (modified) (8 diffs)
-
tags/4.0.2/lib/parse-this/includes/class-jsonld.php (modified) (18 diffs)
-
tags/4.0.2/lib/parse-this/includes/class-mf2.php (modified) (12 diffs)
-
tags/4.0.2/lib/parse-this/includes/class-restapi.php (modified) (2 diffs)
-
tags/4.0.2/lib/parse-this/includes/class-rss.php (modified) (2 diffs)
-
tags/4.0.2/lib/parse-this/includes/functions.php (modified) (1 diff)
-
tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/DOMTreeBuilder.php (modified) (3 diffs)
-
tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/Scanner.php (modified) (3 diffs)
-
tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/Tokenizer.php (modified) (1 diff)
-
tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/UTF8Utils.php (modified) (4 diffs)
-
tags/4.0.2/lib/parse-this/lib/html5/HTML5/Serializer/OutputRules.php (modified) (2 diffs)
-
tags/4.0.2/lib/parse-this/lib/html5/HTML5/Serializer/Traverser.php (modified) (1 diff)
-
tags/4.0.2/lib/parse-this/lib/html5/SECURITY.md (added)
-
tags/4.0.2/lib/parse-this/lib/mf2/CHANGELOG.md (added)
-
tags/4.0.2/lib/parse-this/lib/mf2/Parser.php (modified) (34 diffs)
-
tags/4.0.2/lib/parse-this/parse-this.php (modified) (2 diffs)
-
tags/4.0.2/lib/parse-this/readme.txt (modified) (4 diffs)
-
tags/4.0.2/readme.txt (modified) (2 diffs)
-
trunk/.gitattributes (modified) (1 diff)
-
trunk/develop.txt (modified) (4 diffs)
-
trunk/includes/class-kind-fields.php (modified) (20 diffs)
-
trunk/includes/class-kind-media-metadata.php (modified) (1 diff)
-
trunk/includes/class-kind-taxonomy.php (modified) (5 diffs)
-
trunk/includes/class-post-kind.php (modified) (3 diffs)
-
trunk/includes/register-kinds.php (modified) (45 diffs)
-
trunk/includes/time-functions.php (modified) (1 diff)
-
trunk/indieweb-post-kinds.php (modified) (1 diff)
-
trunk/languages/indieweb-post-kinds.pot (modified) (16 diffs)
-
trunk/lib/parse-this/includes/class-base.php (modified) (3 diffs)
-
trunk/lib/parse-this/includes/class-discovery.php (modified) (1 diff)
-
trunk/lib/parse-this/includes/class-html.php (modified) (8 diffs)
-
trunk/lib/parse-this/includes/class-jsonld.php (modified) (18 diffs)
-
trunk/lib/parse-this/includes/class-mf2.php (modified) (12 diffs)
-
trunk/lib/parse-this/includes/class-restapi.php (modified) (2 diffs)
-
trunk/lib/parse-this/includes/class-rss.php (modified) (2 diffs)
-
trunk/lib/parse-this/includes/functions.php (modified) (1 diff)
-
trunk/lib/parse-this/lib/html5/HTML5/Parser/DOMTreeBuilder.php (modified) (3 diffs)
-
trunk/lib/parse-this/lib/html5/HTML5/Parser/Scanner.php (modified) (3 diffs)
-
trunk/lib/parse-this/lib/html5/HTML5/Parser/Tokenizer.php (modified) (1 diff)
-
trunk/lib/parse-this/lib/html5/HTML5/Parser/UTF8Utils.php (modified) (4 diffs)
-
trunk/lib/parse-this/lib/html5/HTML5/Serializer/OutputRules.php (modified) (2 diffs)
-
trunk/lib/parse-this/lib/html5/HTML5/Serializer/Traverser.php (modified) (1 diff)
-
trunk/lib/parse-this/lib/html5/SECURITY.md (added)
-
trunk/lib/parse-this/lib/mf2/CHANGELOG.md (added)
-
trunk/lib/parse-this/lib/mf2/Parser.php (modified) (34 diffs)
-
trunk/lib/parse-this/parse-this.php (modified) (2 diffs)
-
trunk/lib/parse-this/readme.txt (modified) (4 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
indieweb-post-kinds/tags/4.0.2/.gitattributes
r3738687 r3810578 5 5 /tests export-ignore 6 6 /bin export-ignore 7 /build export-ignore 7 8 /node_modules export-ignore 8 9 /sass export-ignore -
indieweb-post-kinds/tags/4.0.2/develop.txt
r3771941 r3810578 1 Developer notes for Post Kinds 4.0. 1. Every function, method and hook listed here has a docblock in the code with its full parameters and return values.1 Developer notes for Post Kinds 4.0.2. Every function, method and hook listed here has a docblock in the code with its full parameters and return values. 2 2 3 3 == Template functions == … … 24 24 `register_post_kind( $slug, $args )` - Registers a kind. Call it on `init`. `includes/register-kinds.php` registers the built-in kinds the same way, and Kind_Taxonomy::register_post_kind() documents every argument. 25 25 `set_post_kind_visibility( $slug, $show = true )` - Shows or hides a kind in Settings, including the kinds reserved for future use. 26 27 A kind's `properties` argument is its field schema: the microformats properties an editor offers for it, keyed by property, as Kind_Fields documents. Fields are optional unless they set `'required' => true`; a kind that responds to something should make its citation required. A `name` field means the kind has a title. Kind_Fields provides the shared field sets the built-in kinds use: `cite_field()` (with overrides to relabel, remove or add citation fields), `title_field()`, `rating_field()`, `rsvp_field()`, `read_status_field()` and `time_fields()`. `Kind_Fields::sanitize()` and `Kind_Fields::missing()` sanitize submitted values and list the required fields that are empty. 26 28 27 29 == Time functions == … … 122 124 * Since 4.0.0, the global functions `display_formatted_datetime()`, `divide_datetime()`, `build_datetime()`, `get_datetime_offset()`, `divide_interval()` and `build_interval()`. Use the Kind_Time methods of the same names. They will be removed in 5.0.0. 123 125 * Since 4.0.0, the `MF2_Post` class. Use Kind_Post. It will be removed in a future major version. 126 * Since 4.0.2, the `title` argument of `register_post_kind()`. Add a `name` field to the kind's properties instead, such as `Kind_Fields::title_field()`. `'title' => true` still adds one, and `Post_Kind::$title` reflects whether the properties have a name field. 124 127 125 128 == Styling icons == … … 132 135 133 136 To change a view, copy it into a `kind_views` folder in your theme and edit the copy. If a child theme has a `kind_views` folder, it is used instead of the parent theme's; the two aren't combined. For each post, the plugin looks for `kind-{slug}.php` in your theme and then in the plugin, and only then for `kind.php` in the same order. So a theme `kind.php` replaces only the kinds that have no view of their own. The `kind_view_paths` filter changes which folders are searched before the plugin's. 137 138 When a post is embedded on another site (WordPress post embeds), a theme can style each kind with an `embed-{post_type}-{slug}.php` template, such as `embed-post-like.php`. Before 4.0.2 the template was named after the kind's translated name (`embed-post-Like.php`); that name still works, after the slug. 134 139 135 140 Copies don't receive updates. After upgrading, compare them with the plugin's views. Since 4.0.0, views escape everything they print, and the `Kind_View` helpers return escaped markup. -
indieweb-post-kinds/tags/4.0.2/includes/class-kind-fields.php
r3738687 r3810578 12 12 * Generates form fields for the posting UI from a kind's property schema. 13 13 * 14 * Supported field types and their options: 14 * The schemas are editor-agnostic: the same field definitions (exposed by 15 * the post-kinds/1.0/fields REST route) can drive the Classic Editor, a block 16 * editor UI or another editor. The field_*() methods render them as HTML for 17 * the Classic Editor. 18 * 19 * A field definition has a 'type' and a 'label'; other keys depend on the type. 20 * Supported types, one for each field_*() method: 21 * - text, textarea, url 22 * - number: `step` (default 1). 23 * - select: `options`, an associative array of value => label. 24 * - list: values separated by semicolons. 15 25 * - datetime 16 * - duration 17 * - author: a name, URL and photo by default. 18 * - select: `options` is an associative array of value => label. 19 * - url 20 * - text 21 * - list 22 * - textarea 23 * - number 24 * - cite: an h-cite object. 26 * - duration: `pieces`, which of Y, M, D, H, I (minutes) and S to show. Default H, I and S. 27 * - author: a name, URL and photo. 28 * - cite, venue: nested fields in `properties`. 29 * 30 * Any other type is treated as text. Any field can have `required` set to 31 * true; fields are optional otherwise. See missing(). 25 32 * 26 33 * @since 3.3.4 … … 31 38 * Returns a list of time zones with translated labels. 32 39 * 33 * @since 3.3.4 40 * Only time zones the host's time zone database knows are listed. 41 * 42 * @since 3.3.4 43 * @since 4.0.2 Uses current identifiers, and leaves out unknown ones. 34 44 * 35 45 * @return string[] Labels, keyed by time zone identifier. 36 46 */ 37 47 public static function timezone_list() { 38 returnarray(48 $zones = array( 39 49 'Pacific/Niue' => __( '(GMT-11:00) Niue', 'indieweb-post-kinds' ), 40 50 'Pacific/Pago_Pago' => __( '(GMT-11:00) Pago Pago', 'indieweb-post-kinds' ), … … 109 119 'America/Cayenne' => __( '(GMT-03:00) Cayenne', 'indieweb-post-kinds' ), 110 120 'America/Fortaleza' => __( '(GMT-03:00) Fortaleza', 'indieweb-post-kinds' ), 111 'America/ Godthab' => __( '(GMT-03:00) Godthab', 'indieweb-post-kinds' ),121 'America/Nuuk' => __( '(GMT-02:00) Nuuk', 'indieweb-post-kinds' ), 112 122 'America/Maceio' => __( '(GMT-03:00) Maceio', 'indieweb-post-kinds' ), 113 123 'America/Miquelon' => __( '(GMT-03:00) Miquelon', 'indieweb-post-kinds' ), … … 182 192 'Europe/Istanbul' => __( '(GMT+02:00) Istanbul', 'indieweb-post-kinds' ), 183 193 'Europe/Kaliningrad' => __( '(GMT+02:00) Moscow-01 - Kaliningrad', 'indieweb-post-kinds' ), 184 'Europe/K iev' => __( '(GMT+02:00) Kiev', 'indieweb-post-kinds' ),194 'Europe/Kyiv' => __( '(GMT+02:00) Kyiv', 'indieweb-post-kinds' ), 185 195 'Europe/Riga' => __( '(GMT+02:00) Riga', 'indieweb-post-kinds' ), 186 196 'Europe/Sofia' => __( '(GMT+02:00) Sofia', 'indieweb-post-kinds' ), … … 215 225 'Indian/Kerguelen' => __( '(GMT+05:00) Kerguelen', 'indieweb-post-kinds' ), 216 226 'Indian/Maldives' => __( '(GMT+05:00) Maldives', 'indieweb-post-kinds' ), 217 'Asia/ Calcutta'=> __( '(GMT+05:30) India Standard Time', 'indieweb-post-kinds' ),227 'Asia/Kolkata' => __( '(GMT+05:30) India Standard Time', 'indieweb-post-kinds' ), 218 228 'Asia/Colombo' => __( '(GMT+05:30) Colombo', 'indieweb-post-kinds' ), 219 'Asia/Kat mandu' => __( '(GMT+05:45) Katmandu', 'indieweb-post-kinds' ),229 'Asia/Kathmandu' => __( '(GMT+05:45) Kathmandu', 'indieweb-post-kinds' ), 220 230 'Antarctica/Vostok' => __( '(GMT+06:00) Vostok', 'indieweb-post-kinds' ), 221 231 'Asia/Almaty' => __( '(GMT+06:00) Almaty', 'indieweb-post-kinds' ), … … 225 235 'Asia/Thimphu' => __( '(GMT+06:00) Thimphu', 'indieweb-post-kinds' ), 226 236 'Indian/Chagos' => __( '(GMT+06:00) Chagos', 'indieweb-post-kinds' ), 227 'Asia/ Rangoon' => __( '(GMT+06:30) Rangoon', 'indieweb-post-kinds' ),237 'Asia/Yangon' => __( '(GMT+06:30) Yangon', 'indieweb-post-kinds' ), 228 238 'Indian/Cocos' => __( '(GMT+06:30) Cocos', 'indieweb-post-kinds' ), 229 239 'Antarctica/Davis' => __( '(GMT+07:00) Davis', 'indieweb-post-kinds' ), … … 232 242 'Asia/Jakarta' => __( '(GMT+07:00) Jakarta', 'indieweb-post-kinds' ), 233 243 'Asia/Krasnoyarsk' => __( '(GMT+07:00) Moscow+04 - Krasnoyarsk', 'indieweb-post-kinds' ), 234 'Asia/Saigon' => __( '(GMT+07:00) Hanoi', 'indieweb-post-kinds' ),235 244 'Asia/Ho_Chi_Minh' => __( '(GMT+07:00) Ho Chi Minh', 'indieweb-post-kinds' ), 236 245 'Indian/Christmas' => __( '(GMT+07:00) Christmas', 'indieweb-post-kinds' ), 237 246 'Antarctica/Casey' => __( '(GMT+08:00) Casey', 'indieweb-post-kinds' ), 238 247 'Asia/Brunei' => __( '(GMT+08:00) Brunei', 'indieweb-post-kinds' ), 239 'Asia/Choibalsan' => __( '(GMT+08:00) Choibalsan', 'indieweb-post-kinds' ),240 248 'Asia/Hong_Kong' => __( '(GMT+08:00) Hong Kong', 'indieweb-post-kinds' ), 241 249 'Asia/Irkutsk' => __( '(GMT+08:00) Moscow+05 - Irkutsk', 'indieweb-post-kinds' ), … … 284 292 'Pacific/Wallis' => __( '(GMT+12:00) Wallis', 'indieweb-post-kinds' ), 285 293 'Pacific/Apia' => __( '(GMT+14:00) Apia', 'indieweb-post-kinds' ), 286 'Pacific/ Enderbury' => __( '(GMT+13:00) Enderbury', 'indieweb-post-kinds' ),294 'Pacific/Kanton' => __( '(GMT+13:00) Kanton', 'indieweb-post-kinds' ), 287 295 'Pacific/Fakaofo' => __( '(GMT+13:00) Fakaofo', 'indieweb-post-kinds' ), 288 296 'Pacific/Tongatapu' => __( '(GMT+13:00) Tongatapu', 'indieweb-post-kinds' ), 289 297 'Pacific/Kiritimati' => __( '(GMT+14:00) Kiritimati', 'indieweb-post-kinds' ), 290 298 ); 299 300 // Identifiers the host's time zone database doesn't know, such as names added after it was built, are left out. 301 $known = array(); 302 foreach ( array_keys( $zones ) as $zone ) { 303 try { 304 new DateTimeZone( $zone ); 305 $known[ $zone ] = true; 306 } catch ( Exception $e ) { 307 continue; 308 } 309 } 310 return array_intersect_key( $zones, $known ); 291 311 } 292 312 … … 295 315 * 296 316 * @since 3.3.4 317 * @since 4.0.2 Uses get_gmt_offsets(). 297 318 * 298 319 * @return string[] Offsets such as '-05:00'. 299 320 */ 300 321 public static function get_offset_list() { 301 $o = wp_cache_get( 'kind_offset_list' ); 302 if ( false !== $o ) { 303 return $o; 304 } 305 $o = array(); 306 $t_zones = timezone_identifiers_list(); 307 foreach ( $t_zones as $a ) { 308 $datetime = new DateTime( 'now', new DateTimeZone( $a ) ); 309 $o[] = Kind_Time::get_datetime_offset( $datetime ); 310 } 311 $o = array_unique( $o ); 312 asort( $o ); 313 wp_cache_set( 'kind_offset_list', $o, '', DAY_IN_SECONDS ); 314 return $o; 322 return get_gmt_offsets(); 323 } 324 325 /** 326 * Returns an id attribute for a field name, such as mf2_in-reply-to-name for mf2_in-reply-to[name]. 327 * 328 * @since 4.0.2 329 * 330 * @param string $name Field name. 331 * @return string 332 */ 333 private static function field_id( $name ) { 334 return trim( preg_replace( '/[^A-Za-z0-9_-]+/', '-', $name ), '-' ); 335 } 336 337 /** 338 * Returns the opening label for a field. 339 * 340 * @since 4.0.2 341 * 342 * @param array $args Field arguments, as returned by validate(). 343 * @param string $for Optional. The id the label is for. Default the field's id. 344 * @return string 345 */ 346 private static function label( $args, $for = null ) { 347 return sprintf( 348 '<label for="%1$s" class="%2$s">%3$s', 349 esc_attr( $for ?? $args['id'] ), 350 esc_attr( self::classes( $args ) ), 351 esc_html( $args['label'] ) 352 ); 353 } 354 355 /** 356 * Returns a field's classes, with kind-field-required added for a required field. 357 * 358 * @since 4.0.2 359 * 360 * @param array $args Field arguments, as returned by validate(). 361 * @param string $extra Optional. Classes to add first. Default empty. 362 * @return string 363 */ 364 private static function classes( $args, $extra = '' ) { 365 $classes = array( $extra, $args['class'], empty( $args['required'] ) ? '' : 'kind-field-required' ); 366 return implode( ' ', array_filter( array_map( 'trim', $classes ), 'strlen' ) ); 367 } 368 369 /** 370 * Returns the aria-required attribute for a required field, or an empty string. 371 * 372 * The HTML required attribute isn't used: it would stop a draft from being 373 * saved while the field is empty. 374 * 375 * @since 4.0.2 376 * 377 * @param array $args Field arguments, as returned by validate(). 378 * @return string 379 */ 380 private static function aria_required( $args ) { 381 return empty( $args['required'] ) ? '' : ' aria-required="true"'; 315 382 } 316 383 … … 318 385 * Renders date, time and offset inputs. 319 386 * 320 * @since 3.3.4 321 * 322 * @param array $args Field arguments, as returned by validate(): 'name', 'label' and 'class'. 323 * @param DateTime|string|false $datetime Date, or a date string. Default now. 387 * The parts are named {name}[date], {name}[time] and {name}[offset]. 388 * 389 * @since 3.3.4 390 * @since 4.0.2 The inputs are empty when there is no date, instead of showing now. 391 * 392 * @param array $args Field arguments, as returned by validate(). 393 * @param DateTimeInterface|string|false $datetime Date, or a date string. 324 394 * @return string The inputs. 325 395 */ 326 396 public static function field_datetime( $args, $datetime ) { 327 if ( is_string( $datetime ) ) { 328 $datetime = new DateTime( $datetime, wp_timezone() ); 329 } 330 if ( ! $datetime ) { 331 $datetime = new DateTime( 'now', wp_timezone() ); 397 $time = Kind_Time::divide_datetime( $datetime ); 398 if ( ! $time ) { 399 $time = array( 'offset' => Kind_Time::get_datetime_offset() ); 332 400 } 333 401 $return = array(); 334 $time = Kind_Time::divide_datetime( $datetime ); 335 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 336 $return[] = sprintf( '<input type="date" name="mf2_%1$s_date" id="mf2_%1$s_date" value="%2$s"/>', $args['name'], ( $time['date'] ?? '' ) ); 337 $return[] = sprintf( '<input type="time" name="mf2_%1$s_time" id="mf2_%1$s_time" step="1" value="%2$s"/>', $args['name'], ( $time['time'] ?? '' ) ); 338 $return[] = sprintf( '<select name="%1s_offset" id="%1$s_offset">', $args['name'] ); 402 $return[] = self::label( $args, $args['id'] . '-date' ); 403 $return[] = sprintf( '<input type="date" name="%1$s[date]" id="%2$s-date" value="%3$s"%4$s />', esc_attr( $args['name'] ), esc_attr( $args['id'] ), esc_attr( $time['date'] ?? '' ), self::aria_required( $args ) ); 404 $return[] = sprintf( '<input type="time" name="%1$s[time]" id="%2$s-time" step="1" value="%3$s" />', esc_attr( $args['name'] ), esc_attr( $args['id'] ), esc_attr( $time['time'] ?? '' ) ); 405 $return[] = sprintf( '<select name="%1$s[offset]" id="%2$s-offset">', esc_attr( $args['name'] ), esc_attr( $args['id'] ) ); 339 406 foreach ( self::get_offset_list() as $offset ) { 340 $return[] = sprintf( '<option value="%1$s"%2$s>%3$s</option>', $offset, selected( $offset, $time['offset'], false ), sprintf( 'GMT%1$s',$offset ) );407 $return[] = sprintf( '<option value="%1$s"%2$s>%3$s</option>', esc_attr( $offset ), selected( $offset, $time['offset'] ?? '', false ), esc_html( 'GMT' . $offset ) ); 341 408 } 342 409 $return[] = '</select></label>'; … … 345 412 346 413 /** 347 * Renders duration inputs. 348 * 349 * @since 3.3.4 350 * 351 * @param array $args Field arguments, as returned by validate(), including 'pieces'. 352 * @param DateInterval|string $interval Duration, or an ISO 8601 duration. Default 0. 414 * Renders duration inputs, one for each of $args['pieces']. 415 * 416 * The parts are named {name}[Y], {name}[M], {name}[D], {name}[H], {name}[I] and {name}[S]. 417 * 418 * @since 3.3.4 419 * 420 * @param array $args Field arguments, as returned by validate(), including 'pieces'. 421 * @param DateInterval|string|false $interval Duration, or an ISO 8601 duration. 353 422 * @return string The inputs. 354 423 */ 355 424 public static function field_duration( $args, $interval ) { 356 if ( is_string( $interval ) ) { 357 $interval = new DateInterval( $interval ); 358 } 359 if ( ! $interval ) { 360 $interval = new DateInterval( 'PT0S' ); 361 } 425 $duration = Kind_Time::divide_interval( kind_safe_interval( $interval ) ); 426 $pieces = array( 427 'Y' => array( 1000, __( 'Years', 'indieweb-post-kinds' ) ), 428 'M' => array( 11, __( 'Months', 'indieweb-post-kinds' ) ), 429 'D' => array( 31, __( 'Days', 'indieweb-post-kinds' ) ), 430 'H' => array( 23, __( 'Hours', 'indieweb-post-kinds' ) ), 431 'I' => array( 59, __( 'Minutes', 'indieweb-post-kinds' ) ), 432 'S' => array( 59, __( 'Seconds', 'indieweb-post-kinds' ) ), 433 ); 434 $first = reset( $args['pieces'] ); 362 435 $return = array(); 363 $duration = Kind_Time::divide_interval( $interval ); 364 $max = array( 365 'Y' => 1000, 366 'M' => 11, 367 'D' => 31, 368 'H' => 23, 369 'I' => 59, 370 'S' => 60, 371 ); 372 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 436 $return[] = self::label( $args, $args['id'] . '-' . $first ); 373 437 foreach ( $args['pieces'] as $piece ) { 374 $return[] = sprintf( '<input type="number" name="mf2_%2$s_%1$s" id="mf2_%3$s_%1$s" value="%4$s" step="1" max="%5$s" />', $piece, $args['name'], $args['id'], ( $duration['year'] ?? '' ), $max[ $piece ] ); 438 $return[] = sprintf( 439 '<input type="number" name="%1$s[%2$s]" id="%3$s-%2$s" value="%4$s" min="0" max="%5$d" step="1" aria-label="%6$s" />', 440 esc_attr( $args['name'] ), 441 esc_attr( $piece ), 442 esc_attr( $args['id'] ), 443 esc_attr( $duration[ $piece ] ? (string) $duration[ $piece ] : '' ), 444 $pieces[ $piece ][0], 445 esc_attr( $pieces[ $piece ][1] ) 446 ); 375 447 } 376 448 $return[] = '</label>'; … … 379 451 380 452 /** 381 * Renders author name, URL and photo inputs. 382 * 383 * @since 3.3.4 384 * 385 * @param array $args Field arguments, as returned by validate(). 386 * @param array|false $author Values, with 'name', 'url' and 'photo' keys. 387 * @return string The inputs. 388 */ 389 public static function field_author( $args, $author ) { 390 if ( ! $author ) { 391 $author = array(); 392 } 393 $props = array( 453 * Returns the default fields of an author: name, URL and photo. 454 * 455 * @since 4.0.2 456 * 457 * @return array Field definitions, keyed by property. 458 */ 459 public static function author_properties() { 460 return array( 394 461 'name' => array( 395 462 'type' => 'text', … … 405 472 ), 406 473 ); 407 // Ensure all props are set for values. 408 foreach ( array_keys( $props ) as $prop ) { 409 if ( ! array_key_exists( $prop, $author ) ) { 410 $author[ $prop ] = ''; 411 } 412 } 413 return self::render( $props, $author ); 414 } 415 416 417 /** 418 * Renders a select. The options are in $args['options']. 474 } 475 476 /** 477 * Returns the fields of a citation, for a kind's schema. 478 * 479 * The fields are name, url, author, summary, publication, published, 480 * updated, category (tags) and featured. Overrides change them by key: 481 * false removes a field, an array is merged into its definition (to 482 * relabel it, for example), and a new key adds a field. 483 * 484 * @since 4.0.2 485 * 486 * @param array $overrides Optional. Changes to the fields, keyed by property. Default empty array. 487 * @return array Field definitions, keyed by property. 488 */ 489 public static function cite_properties( $overrides = array() ) { 490 $properties = array( 491 'name' => array( 492 'type' => 'text', 493 'label' => __( 'Name', 'indieweb-post-kinds' ), 494 ), 495 'url' => array( 496 'type' => 'url', 497 'label' => __( 'URL', 'indieweb-post-kinds' ), 498 ), 499 'author' => array( 500 'type' => 'author', 501 'label' => __( 'Author', 'indieweb-post-kinds' ), 502 ), 503 'summary' => array( 504 'type' => 'textarea', 505 'label' => __( 'Summary', 'indieweb-post-kinds' ), 506 ), 507 'publication' => array( 508 'type' => 'text', 509 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 510 ), 511 'published' => array( 512 'type' => 'datetime', 513 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 514 ), 515 'updated' => array( 516 'type' => 'datetime', 517 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 518 ), 519 'category' => array( 520 'type' => 'list', 521 'label' => __( 'Tags', 'indieweb-post-kinds' ), 522 ), 523 'featured' => array( 524 'type' => 'url', 525 'label' => __( 'Featured Media', 'indieweb-post-kinds' ), 526 ), 527 ); 528 foreach ( (array) $overrides as $key => $override ) { 529 if ( false === $override ) { 530 unset( $properties[ $key ] ); 531 } elseif ( is_array( $override ) ) { 532 $properties[ $key ] = isset( $properties[ $key ] ) ? array_merge( $properties[ $key ], $override ) : $override; 533 } 534 } 535 return $properties; 536 } 537 538 /** 539 * Returns a citation field, for a kind's schema. 540 * 541 * @since 4.0.2 542 * 543 * @param string $label Label, such as 'In Reply To'. 544 * @param array $overrides Optional. Changes to the citation's fields; see cite_properties(). Default empty array. 545 * @param bool $required Optional. Whether the citation is required. Default true: a response needs something to respond to. 546 * @return array Field definition. 547 */ 548 public static function cite_field( $label, $overrides = array(), $required = true ) { 549 return array( 550 'type' => 'cite', 551 'label' => $label, 552 'required' => (bool) $required, 553 'properties' => self::cite_properties( $overrides ), 554 ); 555 } 556 557 /** 558 * Returns the title field, for kinds that show a title. 559 * 560 * @since 4.0.2 561 * 562 * @return array Field definition. 563 */ 564 public static function title_field() { 565 return array( 566 'type' => 'text', 567 'label' => __( 'Title', 'indieweb-post-kinds' ), 568 ); 569 } 570 571 /** 572 * Returns the optional rating field: a satisfaction rating from 1 to 5. 573 * 574 * @since 4.0.2 575 * 576 * @return array Field definition. 577 */ 578 public static function rating_field() { 579 return array( 580 'type' => 'select', 581 'label' => __( 'Rating', 'indieweb-post-kinds' ), 582 'options' => array( 583 1 => __( 'Very Dissatisfied', 'indieweb-post-kinds' ), 584 2 => __( 'Dissatisfied', 'indieweb-post-kinds' ), 585 3 => __( 'Neutral', 'indieweb-post-kinds' ), 586 4 => __( 'Satisfied', 'indieweb-post-kinds' ), 587 5 => __( 'Very Satisfied', 'indieweb-post-kinds' ), 588 ), 589 ); 590 } 591 592 /** 593 * Returns the RSVP field. 594 * 595 * @since 4.0.2 596 * 597 * @param bool $required Optional. Whether it is required. Default true. 598 * @return array Field definition. 599 */ 600 public static function rsvp_field( $required = true ) { 601 return array( 602 'type' => 'select', 603 'label' => __( 'RSVP', 'indieweb-post-kinds' ), 604 'required' => (bool) $required, 605 'options' => array( 606 'yes' => __( 'Yes', 'indieweb-post-kinds' ), 607 'no' => __( 'No', 'indieweb-post-kinds' ), 608 'maybe' => __( 'Maybe', 'indieweb-post-kinds' ), 609 'interested' => __( 'Interested', 'indieweb-post-kinds' ), 610 'remote' => __( 'Remote', 'indieweb-post-kinds' ), 611 ), 612 ); 613 } 614 615 /** 616 * Returns the optional read status field: to-read, reading or finished. 617 * 618 * @since 4.0.2 619 * 620 * @return array Field definition. 621 */ 622 public static function read_status_field() { 623 return array( 624 'type' => 'select', 625 'label' => __( 'Read Status', 'indieweb-post-kinds' ), 626 'options' => array( 627 'to-read' => __( 'Want to Read', 'indieweb-post-kinds' ), 628 'reading' => __( 'Reading', 'indieweb-post-kinds' ), 629 'finished' => __( 'Finished Reading', 'indieweb-post-kinds' ), 630 ), 631 ); 632 } 633 634 /** 635 * Returns the optional time fields: start, end and duration. 636 * 637 * @since 4.0.2 638 * 639 * @return array Field definitions, keyed by property. 640 */ 641 public static function time_fields() { 642 return array( 643 'start' => array( 644 'type' => 'datetime', 645 'label' => __( 'Start Date', 'indieweb-post-kinds' ), 646 ), 647 'end' => array( 648 'type' => 'datetime', 649 'label' => __( 'End Date', 'indieweb-post-kinds' ), 650 ), 651 'duration' => array( 652 'type' => 'duration', 653 'label' => __( 'Duration', 'indieweb-post-kinds' ), 654 'pieces' => array( 'H', 'I', 'S' ), 655 ), 656 ); 657 } 658 659 /** 660 * Renders author name, URL and photo inputs, named {name}[name], {name}[url] and {name}[photo]. 661 * 662 * @since 3.3.4 663 * 664 * @param array $args Field arguments, as returned by validate(). 665 * @param array|string|false $author An author as jf2 or mf2, or a name or URL. For a list, the first. 666 * @return string The inputs. 667 */ 668 public static function field_author( $args, $author ) { 669 $authors = Kind_Post::normalize_authors( $author ? $author : array() ); 670 $author = $authors ? $authors[0] : array(); 671 return self::fieldset( $args, self::author_properties(), $author ); 672 } 673 674 /** 675 * Renders a select. The options are in $args['options'], value => label. 419 676 * 420 677 * @since 3.3.4 … … 425 682 */ 426 683 public static function field_select( $args, $selected ) { 427 $return = array();428 429 $return[] = sprintf( '< label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label']);430 $return[] = sprintf( '<select name="mf2_%1s" id="mf2_%1$s">', $args['name'] );684 $return = array(); 685 $return[] = self::label( $args ); 686 $return[] = sprintf( '<select name="%1$s" id="%2$s"%3$s>', esc_attr( $args['name'] ), esc_attr( $args['id'] ), self::aria_required( $args ) ); 687 $return[] = '<option value=""></option>'; 431 688 foreach ( $args['options'] as $key => $value ) { 432 $return[] = sprintf( '<option value="%1$s"%2$s>%3$s</option>', $key, selected( $key, $selected, false ), $value);689 $return[] = sprintf( '<option value="%1$s"%2$s>%3$s</option>', esc_attr( $key ), selected( (string) $key, (string) self::scalar( $selected ), false ), esc_html( $value ) ); 433 690 } 434 691 $return[] = '</select></label>'; 435 692 return implode( PHP_EOL, $return ); 693 } 694 695 /** 696 * Renders an input. 697 * 698 * @since 4.0.2 699 * 700 * @param array $args Field arguments, as returned by validate(). 701 * @param string $type Input type. 702 * @param mixed $value Value. 703 * @param string $extra Optional. Extra attributes, already escaped. Default empty. 704 * @return string The input. 705 */ 706 private static function input( $args, $type, $value, $extra = '' ) { 707 return implode( 708 PHP_EOL, 709 array( 710 self::label( $args ), 711 sprintf( '<input name="%1$s" id="%2$s" type="%3$s" value="%4$s"%5$s%6$s />', esc_attr( $args['name'] ), esc_attr( $args['id'] ), esc_attr( $type ), esc_attr( self::scalar( $value ) ), $extra, self::aria_required( $args ) ), 712 '</label>', 713 ) 714 ); 436 715 } 437 716 … … 446 725 */ 447 726 public static function field_url( $args, $url ) { 448 $return = array(); 449 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 450 $return[] = sprintf( '<input name="mf2_%1s" id="mf2_%1$s" type="url" value="%2$s">', $args['name'], $url ); 451 $return[] = '</label>'; 452 return implode( PHP_EOL, $return ); 727 return self::input( $args, 'url', $url ); 453 728 } 454 729 455 730 /** 456 731 * Renders a number input. The step is in $args['step']. 732 * 733 * @since 3.3.4 734 * 735 * @param array $args Field arguments, as returned by validate(). 736 * @param int|string $value Value. 737 * @return string The input. 738 */ 739 public static function field_number( $args, $value ) { 740 return self::input( $args, 'number', $value, sprintf( ' step="%s"', esc_attr( $args['step'] ) ) ); 741 } 742 743 /** 744 * Renders a text input. 457 745 * 458 746 * @since 3.3.4 … … 462 750 * @return string The input. 463 751 */ 464 public static function field_number( $args, $value ) { 465 $return = array(); 466 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 467 $return[] = sprintf( '<input name="mf2_%1s" id="mf2_%1$s" type="number" step="%2$s" value="%3$s">', $args['name'], $args['step'], $value ); 468 $return[] = '</label>'; 469 return implode( PHP_EOL, $return ); 470 } 471 472 /** 473 * Renders a text input. 474 * 475 * @since 3.3.4 476 * 477 * @param array $args Field arguments, as returned by validate(). 478 * @param string $value Value. 752 public static function field_text( $args, $value ) { 753 return self::input( $args, 'text', $value ); 754 } 755 756 /** 757 * Renders a textarea. 758 * 759 * @since 3.3.4 760 * 761 * @param array $args Field arguments, as returned by validate(). 762 * @param string|array $value Value. For jf2 HTML values, the text ('value') is used. 479 763 * @return string The input. 480 764 */ 481 public static function field_text( $args, $value ) {482 $return = array();483 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] );484 $return[] = sprintf( '<input name="mf2_%1s" id="mf2_%1$s" type="text" value="%2$s">', $args['name'], $value );485 $return[] = '</label>';486 return implode( PHP_EOL, $return );487 }488 489 /**490 * Renders a textarea.491 *492 * @since 3.3.4493 *494 * @param array $args Field arguments, as returned by validate().495 * @param string $value Value.496 * @return string The input.497 */498 765 public static function field_textarea( $args, $value ) { 499 $return = array(); 500 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 501 $return[] = sprintf( '<textarea name="mf2_%1s" id="mf2_%1$s">%2$s</textarea>', $args['name'], $value ); 502 $return[] = '</label>'; 503 return implode( PHP_EOL, $return ); 766 if ( is_array( $value ) && isset( $value['value'] ) ) { 767 $value = $value['value']; 768 } 769 return implode( 770 PHP_EOL, 771 array( 772 self::label( $args ), 773 sprintf( '<textarea name="%1$s" id="%2$s"%3$s>%4$s</textarea>', esc_attr( $args['name'] ), esc_attr( $args['id'] ), self::aria_required( $args ), esc_textarea( self::scalar( $value ) ) ), 774 '</label>', 775 ) 776 ); 504 777 } 505 778 … … 515 788 public static function field_list( $args, $value ) { 516 789 if ( is_array( $value ) ) { 517 $value = implode( ';', $value);790 $value = implode( ';', array_filter( $value, 'is_scalar' ) ); 518 791 } 519 792 return self::field_textarea( $args, $value ); … … 521 794 522 795 /** 523 * Renders the inputs for a venue's properties .524 * 525 * @since 3.3.4 526 * 527 * @param array $args Field arguments, as returned by validate(), including 'properties'.528 * @param array $value Values, keyed by property.796 * Renders the inputs for a venue's properties, in $args['properties']. 797 * 798 * @since 3.3.4 799 * 800 * @param array $args Field arguments, as returned by validate(), including 'properties'. 801 * @param array|string $value Values as jf2 or mf2, keyed by property. 529 802 * @return string The inputs. 530 803 */ 531 804 public static function field_venue( $args, $value ) { 532 return self:: render($args['properties'], $value );533 } 534 535 /** 536 * Renders the inputs for a citation's properties .537 * 538 * @since 3.3.4 539 * 540 * @param array $args Field arguments, as returned by validate(), including 'properties'.541 * @param array $value Values, keyed by property.805 return self::fieldset( $args, $args['properties'], $value ); 806 } 807 808 /** 809 * Renders the inputs for a citation's properties, in $args['properties']. 810 * 811 * @since 3.3.4 812 * 813 * @param array $args Field arguments, as returned by validate(), including 'properties'. 814 * @param array|string $value Values as jf2 or mf2, keyed by property. A URL is read as the citation's URL. 542 815 * @return string The inputs. 543 816 */ 544 817 public static function field_cite( $args, $value ) { 545 return self::render( $args['properties'], $value ); 818 return self::fieldset( $args, $args['properties'], $value ); 819 } 820 821 /** 822 * Renders nested fields in a fieldset, with the field's label as its legend. 823 * 824 * @since 4.0.2 825 * 826 * @param array $args Field arguments, as returned by validate(). 827 * @param array $properties Field definitions of the nested fields. 828 * @param array|string $value Values as jf2 or mf2, keyed by property. 829 * @return string The fieldset. 830 */ 831 private static function fieldset( $args, $properties, $value ) { 832 if ( is_string( $value ) ) { 833 $value = wp_http_validate_url( $value ) ? array( 'url' => $value ) : array( 'name' => $value ); 834 } 835 if ( is_array( $value ) && wp_is_numeric_array( $value ) ) { 836 $value = reset( $value ); 837 } 838 if ( is_array( $value ) && isset( $value['properties'] ) && function_exists( '\\ParseThis\\mf2_to_jf2' ) ) { 839 $value = \ParseThis\mf2_to_jf2( $value ); 840 } 841 return sprintf( 842 '<fieldset id="%1$s" class="%2$s"><legend>%3$s</legend>%4$s</fieldset>', 843 esc_attr( $args['id'] ), 844 esc_attr( self::classes( $args, 'kind-field-' . $args['type'] ) ), 845 esc_html( $args['label'] ), 846 self::render( $properties, is_array( $value ) ? $value : array(), $args['name'] ) 847 ); 848 } 849 850 /** 851 * Returns a value as a string for a single input. Lists use their first value. 852 * 853 * @since 4.0.2 854 * 855 * @param mixed $value Value. 856 * @return string 857 */ 858 private static function scalar( $value ) { 859 while ( is_array( $value ) && ! empty( $value ) && wp_is_numeric_array( $value ) ) { 860 $value = reset( $value ); 861 } 862 return is_scalar( $value ) ? (string) $value : ''; 546 863 } 547 864 … … 581 898 * Checks a field definition and fills in defaults. 582 899 * 583 * @since 3.3.4 900 * A field needs a type, and a name or a label; each defaults to the other. 901 * A type with no renderer is treated as text. Cite and venue fields need 902 * 'properties', and select fields 'options'. 903 * 904 * @since 3.3.4 905 * @since 4.0.2 A label is no longer required, and unsupported types become text. 584 906 * 585 907 * @param array $element Field definition. … … 587 909 */ 588 910 private static function validate( $element ) { 589 // Everything must have a type. 590 if ( ! self::get( 'type', $element ) ) { 911 if ( ! is_array( $element ) || ! self::get( 'type', $element ) ) { 591 912 return false; 592 913 } 593 // Everything must have a label.594 if ( ! self::get( 'label', $element ) ) {595 return false;596 }597 // If no name property then the label property copies over.598 914 if ( ! self::get( 'name', $element ) ) { 915 if ( ! self::get( 'label', $element ) ) { 916 return false; 917 } 599 918 $element['name'] = sanitize_title( $element['label'] ); 600 919 } 601 // If no label property then the name property copies over.602 920 if ( ! self::get( 'label', $element ) ) { 603 921 $element['label'] = $element['name']; 604 922 } 605 // If no class property then the class property is set to empty. 923 if ( ! self::get( 'id', $element ) ) { 924 $element['id'] = self::field_id( $element['name'] ); 925 } 606 926 if ( ! self::get( 'class', $element ) ) { 607 927 $element['class'] = ''; 608 928 } 609 // Class can be an array.610 929 if ( is_array( $element['class'] ) ) { 611 930 $element['class'] = implode( ' ', $element['class'] ); 612 931 } 613 $type = self::get( 'type', $element ); 614 // Any non supported type should be considered to be text. 615 if ( ! self::supported_type( $type ) ) { 616 $type = 'text'; 617 } 618 // Type Specific Conditions. 932 $element['required'] = ! empty( $element['required'] ); 933 if ( ! self::supported_type( $element['type'] ) ) { 934 $element['type'] = 'text'; 935 } 936 switch ( $element['type'] ) { 937 case 'cite': 938 case 'venue': 939 if ( ! is_array( self::get( 'properties', $element ) ) ) { 940 return false; 941 } 942 break; 943 case 'number': 944 if ( ! array_key_exists( 'step', $element ) ) { 945 $element['step'] = 1; 946 } 947 break; 948 case 'select': 949 if ( ! is_array( self::get( 'options', $element ) ) ) { 950 return false; 951 } 952 break; 953 case 'duration': 954 $pieces = is_array( self::get( 'pieces', $element ) ) ? $element['pieces'] : array( 'H', 'I', 'S' ); 955 $element['pieces'] = array_values( array_intersect( array( 'Y', 'M', 'D', 'H', 'I', 'S' ), $pieces ) ); 956 if ( empty( $element['pieces'] ) ) { 957 $element['pieces'] = array( 'H', 'I', 'S' ); 958 } 959 break; 960 } 961 return $element; 962 } 963 964 /** 965 * Whether a field type is supported: whether there is a field_{type}() renderer for it. 966 * 967 * @since 3.3.4 968 * @since 4.0.2 Derived from the field_*() methods. 969 * 970 * @param string $type Field type. 971 * @return bool 972 */ 973 public static function supported_type( $type ) { 974 return is_string( $type ) && 1 === preg_match( '/^[a-z]+$/', $type ) && method_exists( static::class, 'field_' . $type ); 975 } 976 977 /** 978 * Renders form fields from a field schema. 979 * 980 * Fields are named mf2_{property}. Nested fields (an author, citation or 981 * venue) and the parts of a date or duration are named with sub-keys, such 982 * as mf2_in-reply-to[author][name], so form data arrives structured. 983 * Invalid field definitions are skipped. 984 * 985 * @since 3.3.4 986 * @since 4.0.2 Added the $parent parameter; fields are named with sub-keys and escaped. 987 * 988 * @param array $schema Field definitions, keyed by property. 989 * @param array $values Optional. Values as jf2, keyed by property. Default empty array. 990 * @param string $parent Optional. Name of the field these are nested in. Default empty, for top-level fields. 991 * @return string The fields. 992 */ 993 public static function render( $schema, $values = array(), $parent = '' ) { 994 $return = array(); 995 foreach ( (array) $schema as $key => $args ) { 996 if ( ! is_array( $args ) ) { 997 continue; 998 } 999 $key = sanitize_key( $key ); 1000 $args['name'] = '' === $parent ? 'mf2_' . $key : $parent . '[' . $key . ']'; 1001 unset( $args['id'] ); 1002 // A field without a label is labelled with its property, not its field name. 1003 if ( ! self::get( 'label', $args ) ) { 1004 $args['label'] = $key; 1005 } 1006 $args = self::validate( $args ); 1007 if ( ! $args ) { 1008 continue; 1009 } 1010 $return[] = call_user_func( array( static::class, 'field_' . $args['type'] ), $args, self::get( $key, $values ) ); 1011 } 1012 return implode( '<br />', $return ); 1013 } 1014 1015 /** 1016 * Extracts microformats properties from submitted form data. 1017 * 1018 * Reads the fields named mf2_{property}. Nested values arrive as arrays 1019 * (mf2_in-reply-to[name]); the older {property}_{part} form 1020 * (mf2_start_date) is read too. Date parts (date, time, offset) become an 1021 * ISO 8601 date, and duration parts (Y, M, D, H, I, S) an ISO 8601 1022 * duration. Empty values are dropped. 1023 * 1024 * With a schema, the values are also sanitized by field type and only the 1025 * schema's properties are kept; see sanitize(). Without one, values are 1026 * only reassembled, not sanitized. 1027 * 1028 * @since 3.3.4 1029 * @since 4.0.2 Rewritten; added the $schema parameter. 1030 * 1031 * @param array $data Form data, unslashed, such as wp_unslash( $_POST ). 1032 * @param array|null $schema Optional. Field definitions, keyed by property. Default null. 1033 * @return array The properties as jf2-style values, keyed by property. 1034 */ 1035 public static function rebuild_data( $data, $schema = null ) { 1036 $raw = array(); 1037 foreach ( (array) $data as $key => $value ) { 1038 if ( ! is_string( $key ) || ! self::str_prefix( $key, 'mf2_' ) ) { 1039 continue; 1040 } 1041 $key = substr( $key, 4 ); 1042 // Property names use hyphens, so an underscore marks a part: start_date. 1043 $pieces = explode( '_', $key, 2 ); 1044 if ( 2 === count( $pieces ) && '' !== $pieces[0] && '' !== $pieces[1] ) { 1045 if ( ! isset( $raw[ $pieces[0] ] ) || ! is_array( $raw[ $pieces[0] ] ) ) { 1046 $raw[ $pieces[0] ] = array(); 1047 } 1048 $raw[ $pieces[0] ][ $pieces[1] ] = $value; 1049 continue; 1050 } 1051 if ( isset( $raw[ $key ] ) && is_array( $raw[ $key ] ) && is_array( $value ) ) { 1052 $value = array_merge( $raw[ $key ], $value ); 1053 } 1054 $raw[ $key ] = $value; 1055 } 1056 if ( is_array( $schema ) ) { 1057 return self::sanitize( $schema, $raw ); 1058 } 1059 return self::assemble( $raw ); 1060 } 1061 1062 /** 1063 * Reassembles date and duration parts in nested values and drops empty values. 1064 * 1065 * @since 4.0.2 1066 * 1067 * @param array $values Values. 1068 * @return array 1069 */ 1070 private static function assemble( $values ) { 1071 foreach ( $values as $key => $value ) { 1072 if ( is_array( $value ) ) { 1073 if ( self::is_datetime_parts( $value ) ) { 1074 $value = self::datetime_from_parts( $value ); 1075 } elseif ( self::is_duration_parts( $value ) ) { 1076 $value = self::duration_from_parts( $value ); 1077 } else { 1078 $value = self::assemble( $value ); 1079 } 1080 } elseif ( is_string( $value ) ) { 1081 $value = trim( $value ); 1082 } 1083 if ( self::is_empty( $value ) ) { 1084 unset( $values[ $key ] ); 1085 } else { 1086 $values[ $key ] = $value; 1087 } 1088 } 1089 return $values; 1090 } 1091 1092 /** 1093 * Sanitizes values by the type of their field definitions. 1094 * 1095 * This is the shared validation for every editor: form data rebuilt by 1096 * rebuild_data(), or values sent by a block editor or another client. 1097 * Only properties in the schema are kept, and empty or invalid values are 1098 * dropped. By type: 1099 * - text, textarea: sanitize_text_field() and sanitize_textarea_field(). 1100 * - url: sanitize_url(); unsafe URLs are dropped. 1101 * - number: a number; anything else is dropped. 1102 * - select: one of the option values. 1103 * - list: a list of text, from an array or a semicolon-separated string. 1104 * - datetime: an ISO 8601 date, from a date string or date, time and offset parts. 1105 * - duration: an ISO 8601 duration, from a duration string or Y, M, D, H, I and S parts. 1106 * - author: name, url and photo. 1107 * - cite, venue: their nested properties. A string is read as the URL (or name). 1108 * Values that are lists of the type are sanitized item by item. 1109 * 1110 * @since 4.0.2 1111 * 1112 * @param array $schema Field definitions, keyed by property. 1113 * @param array $values Values, keyed by property. 1114 * @return array The sanitized values, keyed by property. 1115 */ 1116 public static function sanitize( $schema, $values ) { 1117 $return = array(); 1118 if ( ! is_array( $schema ) || ! is_array( $values ) ) { 1119 return $return; 1120 } 1121 foreach ( $schema as $key => $args ) { 1122 if ( ! is_array( $args ) || ! array_key_exists( $key, $values ) ) { 1123 continue; 1124 } 1125 $args['name'] = $key; 1126 if ( ! self::get( 'label', $args ) ) { 1127 $args['label'] = $key; 1128 } 1129 $args = self::validate( $args ); 1130 if ( ! $args ) { 1131 continue; 1132 } 1133 $value = self::sanitize_field( $args, $values[ $key ] ); 1134 if ( ! self::is_empty( $value ) ) { 1135 $return[ $key ] = $value; 1136 } 1137 } 1138 return $return; 1139 } 1140 1141 /** 1142 * Sanitizes one value by its field definition. 1143 * 1144 * @since 4.0.2 1145 * 1146 * @param array $args Field definition, as returned by validate(). 1147 * @param mixed $value Value. 1148 * @return mixed The sanitized value, or null if it is empty or invalid. 1149 */ 1150 private static function sanitize_field( $args, $value ) { 1151 $type = $args['type']; 1152 // A list of values of this type, such as several URLs. Lists, dates and durations have their own shapes. 1153 if ( is_array( $value ) && wp_is_numeric_array( $value ) && ! in_array( $type, array( 'list', 'datetime', 'duration' ), true ) ) { 1154 $items = array(); 1155 foreach ( $value as $item ) { 1156 $item = self::sanitize_field( $args, $item ); 1157 if ( ! self::is_empty( $item ) ) { 1158 $items[] = $item; 1159 } 1160 } 1161 if ( empty( $items ) ) { 1162 return null; 1163 } 1164 return 1 === count( $items ) ? $items[0] : $items; 1165 } 619 1166 switch ( $type ) { 620 1167 case 'cite': 621 1168 case 'venue': 622 if ( ! array_key_exists( 'properties', $element ) ) { 623 return false; 624 } 625 break; 1169 case 'author': 1170 $properties = 'author' === $type ? self::author_properties() : $args['properties']; 1171 if ( is_string( $value ) ) { 1172 $value = trim( $value ); 1173 $url = '' !== $value && wp_http_validate_url( $value ) ? sanitize_url( $value ) : ''; 1174 if ( $url ) { 1175 return array_key_exists( 'url', $properties ) ? array( 'url' => $url ) : null; 1176 } 1177 return array_key_exists( 'name', $properties ) ? self::sanitize( $properties, array( 'name' => $value ) ) : null; 1178 } 1179 if ( is_array( $value ) && isset( $value['properties'] ) && function_exists( '\\ParseThis\\mf2_to_jf2' ) ) { 1180 $value = \ParseThis\mf2_to_jf2( $value ); 1181 } 1182 return is_array( $value ) ? self::sanitize( $properties, $value ) : null; 1183 case 'datetime': 1184 if ( is_array( $value ) && self::is_datetime_parts( $value ) ) { 1185 return self::datetime_from_parts( self::text_parts( $value ) ); 1186 } 1187 $datetime = is_string( $value ) ? kind_safe_datetime( trim( $value ) ) : kind_safe_datetime( $value ); 1188 return $datetime ? $datetime->format( DATE_W3C ) : null; 1189 case 'duration': 1190 if ( is_array( $value ) && self::is_duration_parts( $value ) ) { 1191 return self::duration_from_parts( $value ); 1192 } 1193 $interval = kind_safe_interval( is_string( $value ) ? trim( $value ) : $value ); 1194 $interval = $interval ? date_interval_to_iso8601( $interval ) : ''; 1195 return 'P' === $interval ? null : $interval; 1196 case 'list': 1197 if ( is_string( $value ) ) { 1198 $value = explode( ';', $value ); 1199 } 1200 if ( ! is_array( $value ) ) { 1201 return null; 1202 } 1203 $items = array_values( array_filter( array_map( 'sanitize_text_field', array_filter( $value, 'is_scalar' ) ), 'strlen' ) ); 1204 return $items ? $items : null; 626 1205 case 'number': 627 if ( ! array_key_exists( 'step', $element ) ) { 628 $element['step'] = 1; // Defaults to Even Numbers. 629 } 630 break; 1206 return is_numeric( $value ) ? $value + 0 : null; 631 1207 case 'select': 632 if ( ! array_key_exists( 'options', $element ) ) {633 return false;634 }635 break;636 case 'duration':637 if ( array_key_exists( 'pieces', $element ) ) {638 // Ensure only valid options.639 $ element['pieces'] = array_intersect( array( 'Y', 'M', 'D', 'H', 'I', 'S' ), $element['pieces'] );640 } else {641 // By default only show hours, minutes, seconds.642 $element['pieces'] = array( 'H', 'I', 'S' );643 }644 break;645 }646 return $element;647 } 648 649 /** 650 * Whether a field type is supported.651 * 652 * @since 3.3.4653 * 654 * @param string $type Field type.1208 $value = is_scalar( $value ) ? (string) $value : ''; 1209 return '' !== $value && array_key_exists( $value, $args['options'] ) ? $value : null; 1210 case 'url': 1211 $value = is_string( $value ) ? sanitize_url( trim( $value ) ) : ''; 1212 return '' === $value ? null : $value; 1213 case 'textarea': 1214 if ( is_array( $value ) && isset( $value['value'] ) ) { 1215 $value = $value['value']; 1216 } 1217 $value = is_scalar( $value ) ? sanitize_textarea_field( (string) $value ) : ''; 1218 return '' === trim( $value ) ? null : $value; 1219 default: 1220 $value = is_scalar( $value ) ? sanitize_text_field( (string) $value ) : ''; 1221 return '' === $value ? null : $value; 1222 } 1223 } 1224 1225 /** 1226 * Whether an array holds date parts: only date, time and offset keys. 1227 * 1228 * @since 4.0.2 1229 * 1230 * @param array $value Value. 655 1231 * @return bool 656 1232 */ 657 public static function supported_type( $type ) { 658 return in_array( $type, array( 'cite', 'venue', 'coordinate', 'author', 'datetime', 'duration', 'text', 'url', 'textarea', 'list', 'section' ), true ); 659 } 660 661 662 /** 663 * Returns the properties stored in mf2_ prefixed post meta, without the prefix. 664 * 665 * Reads the current post; the $post argument is not used. 666 * 667 * @since 3.3.4 668 * 669 * @param int|WP_Post $post Not used. 670 * @return array|false The properties, or false if there is no current post. 671 */ 672 private function get_mf2meta( $post ) { 673 $post = get_post(); 674 if ( ! $post ) { 675 return false; 676 } 677 $meta = get_post_meta( $post->ID ); 678 if ( ! $meta ) { 679 return array(); 680 } 681 foreach ( $meta as $key => $value ) { 682 if ( ! self::str_prefix( $key, 'mf2_' ) ) { 683 unset( $meta[ $key ] ); 684 } else { 685 unset( $meta[ $key ] ); 686 $key = str_replace( 'mf2_', '', $key ); 687 // Do not save microput prefixed instructions. 688 if ( self::str_prefix( $key, 'mp-' ) ) { 689 continue; 690 } 691 $value = array_map( 'maybe_unserialize', $value ); 692 if ( 1 === count( $value ) ) { 693 $value = array_shift( $value ); 694 } 695 if ( is_string( $value ) ) { 696 $meta[ $key ] = array( $value ); 697 } else { 698 $meta[ $key ] = $value; 699 } 700 } 701 } 702 return array_filter( $meta ); 703 } 704 705 /** 706 * Renders a form from a field schema. 707 * 708 * @since 3.3.4 709 * 710 * @param array $schema Field definitions, keyed by property. 711 * @param array $values Optional. Values, keyed by property. Default empty array. 712 * @return string The form. 713 */ 714 public static function render( $schema, $values = array() ) { 715 $return = array(); 1233 private static function is_datetime_parts( $value ) { 1234 return ! empty( $value ) && ! array_diff( array_keys( $value ), array( 'date', 'time', 'offset' ) ) && ( isset( $value['date'] ) || isset( $value['time'] ) ); 1235 } 1236 1237 /** 1238 * Whether an array holds duration parts: only Y, M, D, H, I and S keys. 1239 * 1240 * @since 4.0.2 1241 * 1242 * @param array $value Value. 1243 * @return bool 1244 */ 1245 private static function is_duration_parts( $value ) { 1246 return ! empty( $value ) && ! array_diff( array_keys( $value ), array( 'Y', 'M', 'D', 'H', 'I', 'S' ) ); 1247 } 1248 1249 /** 1250 * Sanitizes date parts as text. 1251 * 1252 * @since 4.0.2 1253 * 1254 * @param array $parts Date parts. 1255 * @return array 1256 */ 1257 private static function text_parts( $parts ) { 1258 return array_map( 1259 function ( $part ) { 1260 return is_scalar( $part ) ? sanitize_text_field( (string) $part ) : ''; 1261 }, 1262 $parts 1263 ); 1264 } 1265 1266 /** 1267 * Builds an ISO 8601 date from date, time and offset parts. 1268 * 1269 * A date without a time is midnight; a time without a date is not a date. 1270 * Without an offset, the site's time zone is used. 1271 * 1272 * @since 4.0.2 1273 * 1274 * @param array $parts Date parts. 1275 * @return string|null The date, or null if there is none. 1276 */ 1277 private static function datetime_from_parts( $parts ) { 1278 $date = isset( $parts['date'] ) && is_string( $parts['date'] ) ? trim( $parts['date'] ) : ''; 1279 $time = isset( $parts['time'] ) && is_string( $parts['time'] ) ? trim( $parts['time'] ) : ''; 1280 if ( '' === $date ) { 1281 return null; 1282 } 1283 $offset = isset( $parts['offset'] ) && is_string( $parts['offset'] ) ? trim( $parts['offset'] ) : null; 1284 $datetime = Kind_Time::build_datetime( $date, '' === $time ? '00:00:00' : $time, $offset ); 1285 return $datetime ? $datetime->format( DATE_W3C ) : null; 1286 } 1287 1288 /** 1289 * Builds an ISO 8601 duration from Y, M, D, H, I (minutes) and S parts. 1290 * 1291 * @since 4.0.2 1292 * 1293 * @param array $parts Duration parts. 1294 * @return string|null The duration, or null if every part is empty or zero. 1295 */ 1296 private static function duration_from_parts( $parts ) { 1297 $parts = array_map( 1298 function ( $part ) { 1299 return is_numeric( $part ) ? absint( $part ) : 0; 1300 }, 1301 $parts 1302 ); 1303 $spec = Kind_Time::build_interval( $parts ); 1304 return '' === $spec ? null : $spec; 1305 } 1306 1307 /** 1308 * Returns the required fields that have no value. 1309 * 1310 * Pass values as returned by sanitize(), so invalid values count as 1311 * missing. A required cite, venue or author is filled in when it has at 1312 * least one property, such as a URL or a name. Required fields nested in 1313 * a cite or venue are checked only when it has a value. 1314 * 1315 * @since 4.0.2 1316 * 1317 * @param array $schema Field definitions, keyed by property. 1318 * @param array $values Values, keyed by property. 1319 * @param string $parent Optional. Path of the field these are nested in. Default empty. 1320 * @return string[] Paths of the missing fields, such as 'in-reply-to' or 'in-reply-to.url'. 1321 */ 1322 public static function missing( $schema, $values, $parent = '' ) { 1323 $missing = array(); 1324 if ( ! is_array( $schema ) ) { 1325 return $missing; 1326 } 1327 $values = is_array( $values ) ? $values : array(); 716 1328 foreach ( $schema as $key => $args ) { 717 $args['name'] = sanitize_title( $key ); 718 $args = self::validate( $args ); 1329 if ( ! is_array( $args ) ) { 1330 continue; 1331 } 1332 $args['name'] = $key; 1333 if ( ! self::get( 'label', $args ) ) { 1334 $args['label'] = $key; 1335 } 1336 $args = self::validate( $args ); 719 1337 if ( ! $args ) { 720 break; 721 } 722 $type = self::get( 'type', $args ); 723 if ( $type ) { 724 $return[] = call_user_func( array( get_called_class(), 'field_' . $type ), $args, self::get( $key, $values ) ); 725 } 726 } 727 return implode( '<br />', $return ); 728 } 729 730 /** 731 * Extracts microformats properties from submitted form data. 732 * 733 * Properties are prefixed by mf2_. After that, an underscore marks the 734 * pieces of a property that need to be put back together. 735 * 736 * @since 3.3.4 737 * 738 * @param array $data Form data, such as $_POST. 739 * @return array The properties. 740 */ 741 public static function rebuild_data( $data ) { 742 $raw = array(); 743 foreach ( $data as $key => $value ) { 744 if ( self::str_prefix( $key, 'mf2_' ) ) { 745 $key = str_replace( 'mf2_', '', $key ); 746 $raw[ $key ] = $value; 747 } 748 } 749 foreach ( $raw as $key => $value ) { 750 $pieces = explode( '_', $key ); 751 if ( 2 === count( $pieces ) ) { 752 if ( ! array_key_exists( $pieces[0], $raw ) ) { 753 $raw[ $pieces[0] ] = array(); 754 } 755 $raw[ $pieces[0] ] = $pieces[1]; 756 unset( $raw[ $key ] ); 757 // If this has the elements of a duration. 758 if ( ! empty( array_intersect( array( 'Y', 'M', 'D', 'H', 'I', 'S' ), $raw[ $pieces[0] ] ) ) ) { 759 $interval = Kind_Time::build_interval( $raw[ $pieces[0] ] ); 760 $raw[ $pieces[0] ] = date_interval_to_iso8601( $interval ); 761 } 762 // If this has the elements of a datetime. 763 if ( ! empty( array_intersect( array( 'date', 'time', 'offset' ), $raw[ $pieces[0] ] ) ) ) { 764 $datetime = Kind_Time::build_datetime( $raw[ $pieces[0] ] ); 765 $raw[ $pieces[0] ] = $datetime->format( DATE_W3C ); 766 } 767 } 768 } 769 return array_filter( $raw ); 1338 continue; 1339 } 1340 $path = '' === $parent ? (string) $key : $parent . '.' . $key; 1341 $value = array_key_exists( $key, $values ) ? $values[ $key ] : null; 1342 if ( self::is_empty( $value ) ) { 1343 if ( $args['required'] ) { 1344 $missing[] = $path; 1345 } 1346 continue; 1347 } 1348 if ( in_array( $args['type'], array( 'cite', 'venue' ), true ) && is_array( $value ) ) { 1349 $items = wp_is_numeric_array( $value ) ? $value : array( $value ); 1350 foreach ( $items as $item ) { 1351 $missing = array_merge( $missing, self::missing( $args['properties'], $item, $path ) ); 1352 } 1353 } 1354 } 1355 return array_values( array_unique( $missing ) ); 1356 } 1357 1358 /** 1359 * Whether a value is empty: null, an empty or blank string, or an empty array. 1360 * 1361 * @since 4.0.2 1362 * 1363 * @param mixed $value Value. 1364 * @return bool 1365 */ 1366 private static function is_empty( $value ) { 1367 return null === $value || ( is_string( $value ) && '' === trim( $value ) ) || ( is_array( $value ) && empty( $value ) ); 770 1368 } 771 1369 } -
indieweb-post-kinds/tags/4.0.2/includes/class-kind-media-metadata.php
r3738687 r3810578 340 340 341 341 /** 342 * Sanitizes metadata extracted from media files. 343 * https://core.trac.wordpress.org/ticket/46800 344 * Currently only binary strings are sanitized with focus on preventing propagation of 345 * bad character encodings from causing database calls and API endpoints to fail. 342 * Converts text in metadata extracted from media files to UTF-8. 343 * 344 * Text that isn't valid UTF-8, such as ISO-8859-1 from older ID3 tags, is 345 * converted so it doesn't break database writes or the REST API 346 * (https://core.trac.wordpress.org/ticket/46800). Valid UTF-8 is left 347 * alone. Nested arrays, such as image_meta, are converted too. 346 348 * 347 349 * @since 3.3.0 348 * 349 * @param array $metadata An existing array with data.350 * 351 * @return array Returns array of sanitizedmetadata.350 * @since 4.0.2 Valid UTF-8 is no longer converted again, and nested arrays are handled. 351 * 352 * @param array $metadata Attachment metadata. 353 * @return array The metadata. 352 354 */ 353 355 public static function wp_sanitize_media_metadata( $metadata ) { 354 356 if ( ! is_array( $metadata ) ) { 355 return $metadata;357 return $metadata; 356 358 } 357 359 foreach ( $metadata as $name => $value ) { 358 if ( ! is_string( $value ) ) {359 continue;360 }361 360 if ( is_array( $value ) ) { 362 $value = wp_sanitize_media_metadata( $value ); 363 } elseif ( is_string( $value ) && preg_match( '~[^\x20-\x7E\t\r\n]~', $value ) > 0 ) { 364 $encoding = mb_detect_encoding( $value, 'ISO-8859-1, UCS-2' ); 365 $value = $encoding ? mb_convert_encoding( $value, 'UTF-8', $encoding ) : $value; 366 } 367 $metadata[ $name ] = $value; 361 $metadata[ $name ] = self::wp_sanitize_media_metadata( $value ); 362 } elseif ( is_string( $value ) && '' !== $value && '' === wp_check_invalid_utf8( $value ) ) { 363 // Not valid UTF-8: read it as ISO-8859-1, the encoding of ID3v1 tags. 364 if ( function_exists( 'mb_convert_encoding' ) ) { 365 $metadata[ $name ] = mb_convert_encoding( $value, 'UTF-8', 'ISO-8859-1' ); 366 } elseif ( function_exists( 'iconv' ) ) { 367 $converted = iconv( 'ISO-8859-1', 'UTF-8', $value ); 368 $metadata[ $name ] = false === $converted ? wp_check_invalid_utf8( $value, true ) : $converted; 369 } else { 370 $metadata[ $name ] = wp_check_invalid_utf8( $value, true ); 371 } 372 } 368 373 } 369 374 return $metadata; -
indieweb-post-kinds/tags/4.0.2/includes/class-kind-taxonomy.php
r3771941 r3810578 372 372 373 373 /** 374 * Filter template hierarchy to include our template files. 374 * Adds the post's kind to the embed template hierarchy. 375 * 376 * A post embedded on another site (WordPress post embeds) uses 377 * embed-{post_type}-{kind}.php from the theme if there is one, such as 378 * embed-post-like.php, before core's embed templates. 375 379 * 376 380 * @since 3.1.2 377 * 378 * @access public 379 * 380 * @param array $templates Array of template file names. 381 * @return mixed 381 * @since 4.0.2 Uses the kind's slug. The template named after the kind's 382 * translated name (embed-post-Like.php), used before, is still 383 * found, after it. 384 * 385 * @param string[] $templates Template file names. 386 * @return string[] 382 387 */ 383 388 public static function embed_template_hierarchy( $templates ) { 384 389 $object = get_queried_object(); 385 if ( ! empty( $object->post_type ) ) { 386 $post_kind = get_post_kind( $object ); 387 if ( $post_kind ) { 388 array_unshift( $templates, "embed-{$object->post_type}-{$post_kind}.php" ); 389 } 390 } 391 return $templates; 390 if ( empty( $object->post_type ) ) { 391 return $templates; 392 } 393 $slug = get_post_kind_slug( $object ); 394 if ( ! $slug ) { 395 return $templates; 396 } 397 $kind_templates = array( "embed-{$object->post_type}-{$slug}.php" ); 398 // Before 4.0.2 the template was named after the kind's translated singular name. 399 $name = get_post_kind( $object ); 400 if ( $name && $name !== $slug ) { 401 $kind_templates[] = "embed-{$object->post_type}-{$name}.php"; 402 } 403 return array_merge( $kind_templates, $templates ); 392 404 } 393 405 … … 1034 1046 1035 1047 /** 1036 * Fetch the current post kind terms from the current query. 1048 * Returns the terms the main query is for, such as the kinds of a kind archive. 1049 * 1050 * Terms are looked up by the field the query used: archives linked by ID 1051 * (?cat=5, ?tag_id=5) record term IDs, others slugs. Terms that don't 1052 * exist are left out. 1037 1053 * 1038 1054 * @since 3.0.3 1039 * 1040 * @access public 1041 * 1042 * @return array 1055 * @since 4.0.2 Uses the query's field, and returns only terms that exist. 1056 * 1057 * @return WP_Term[] The terms. 1043 1058 */ 1044 1059 public static function get_terms_from_query() { 1045 1060 global $wp_query; 1046 1061 $terms = array(); 1047 if ( ! empty( $wp_query->tax_query->queried_terms ) ) { 1048 $queried = wp_list_pluck( $wp_query->tax_query->queried_terms, 'terms' ); 1049 foreach ( $queried as $tax => $slugs ) { 1050 foreach ( $slugs as $slug ) { 1051 $terms[] = get_term_by( 'slug', $slug, $tax ); 1062 if ( empty( $wp_query->tax_query->queried_terms ) ) { 1063 return $terms; 1064 } 1065 foreach ( $wp_query->tax_query->queried_terms as $tax => $queried ) { 1066 if ( empty( $queried['terms'] ) || ! is_array( $queried['terms'] ) ) { 1067 continue; 1068 } 1069 $field = isset( $queried['field'] ) && in_array( $queried['field'], array( 'slug', 'name', 'term_id', 'term_taxonomy_id' ), true ) ? $queried['field'] : 'slug'; 1070 foreach ( $queried['terms'] as $value ) { 1071 $term = get_term_by( $field, $value, $tax ); 1072 if ( $term instanceof WP_Term ) { 1073 $terms[] = $term; 1052 1074 } 1053 1075 } … … 1069 1091 public static function kind_archive_prefix( $prefix ) { 1070 1092 if ( is_tax() || is_category() || is_tag() ) { 1071 $terms = self::get_terms_from_query(); 1072 $tax = get_taxonomy( reset( $terms )->taxonomy ); 1073 $plural = ( count( $terms ) === 1 ); 1074 return ( $plural ? $tax->labels->singular_name : $tax->labels->name ) . ':'; 1093 $terms = self::get_terms_from_query(); 1094 $tax = $terms ? get_taxonomy( $terms[0]->taxonomy ) : false; 1095 if ( ! $tax ) { 1096 return $prefix; 1097 } 1098 return ( 1 === count( $terms ) ? $tax->labels->singular_name : $tax->labels->name ) . ':'; 1075 1099 } 1076 1100 return $prefix; … … 1287 1311 * @type string $verb The verb or action, such as 'Liked'. Default the slug. 1288 1312 * @type string $property Microformats 2 property, such as 'like-of'. Default empty. 1289 * @type array $properties The fields for the kind. See Kind_Fields. 1313 * @type array $properties The fields for the kind, keyed by property. See Kind_Fields. A 1314 * 'name' field means the kind has a title. 1290 1315 * @type string $format Post format that maps to this kind. Default 'standard'. 1291 1316 * @type string $icon Icon name. Default the slug. … … 1293 1318 * @type string $description_url Link to more information. 1294 1319 * @type string $shortlink Shortlink code for the kind. 1295 * @type bool $title Whether the kind should have an explicit title. 1320 * @type bool $title Deprecated since 4.0.2: add a name field to the properties 1321 * instead (Kind_Fields::title_field()). True adds one. 1296 1322 * @type bool $show Whether to show the kind in Settings. Default false. 1297 1323 * } -
indieweb-post-kinds/tags/4.0.2/includes/class-post-kind.php
r3738687 r3810578 88 88 89 89 /** 90 * Whether the kind should have an explicit title. 91 * 92 * @since 3.1.0 90 * Whether the kind has a title: whether its properties include a name field. 91 * 92 * @since 3.1.0 93 * @deprecated 4.0.2 A kind has a title when its properties include 'name'. 94 * Read for compatibility; it reflects the properties. 93 95 * @var bool 94 96 */ … … 170 172 ); 171 173 $args = wp_parse_args( $args, $defaults ); 174 if ( ! is_array( $args['properties'] ?? null ) ) { 175 $args['properties'] = array(); 176 } 177 if ( array_key_exists( 'title', $args ) ) { 178 _deprecated_argument( 179 'register_post_kind', 180 '4.0.2', 181 esc_html__( 'The title argument is deprecated. A kind has a title when its properties include a name field, such as Kind_Fields::title_field().', 'indieweb-post-kinds' ) 182 ); 183 if ( $args['title'] && ! isset( $args['properties']['name'] ) ) { 184 $args['properties'] = array_merge( array( 'name' => Kind_Fields::title_field() ), $args['properties'] ); 185 } 186 unset( $args['title'] ); 187 } 172 188 foreach ( $args as $property_name => $property_value ) { 173 189 if ( 'extra' !== $property_name && property_exists( $this, $property_name ) ) { … … 177 193 } 178 194 } 195 $this->title = isset( $this->properties['name'] ); 179 196 } 180 197 -
indieweb-post-kinds/tags/4.0.2/includes/register-kinds.php
r3738687 r3810578 19 19 'verb' => ' ', 20 20 'property' => '', 21 'properties' => array(), 21 'properties' => array( 22 'name' => Kind_Fields::title_field(), 23 ), 22 24 'format' => '', 23 25 'description' => __( 'traditional long form content: a post with an explicit title and body', 'indieweb-post-kinds' ), 24 26 'description_url' => 'http://indieweb.org/article', 25 27 'shortlink' => 'b', 26 'title' => true,27 28 'show' => true, 28 29 ) … … 41 42 'description_url' => 'http://indieweb.org/note', 42 43 'shortlink' => 't', 43 'title' => false,44 44 'show' => false, 45 45 ) … … 54 54 'property' => 'in-reply-to', 55 55 'properties' => array( 56 'in-reply-to' => array( 57 'type' => 'cite', 58 'label' => __( 'In Reply To', 'indieweb-post-kinds' ), 59 'properties' => array( 60 'name' => array( 61 'type' => 'text', 62 'label' => __( 'Name', 'indieweb-post-kinds' ), 63 ), 64 'url' => array( 65 'type' => 'url', 66 'label' => __( 'URL', 'indieweb-post-kinds' ), 67 ), 68 'author' => array( 69 'type' => 'author', 70 'label' => __( 71 'Author', 72 'indieweb-post-kinds' 73 ), 74 ), 75 'summary' => array( 76 'type' => 'textarea', 77 'label' => __( 'Summary', 'indieweb-post-kinds' ), 78 ), 79 'publication' => array( 80 'type' => 'text', 81 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 82 ), 83 'published' => array( 84 'type' => 'datetime', 85 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 86 ), 87 'updated' => array( 88 'type' => 'datetime', 89 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 90 ), 91 'category' => array( 92 'type' => 'list', 93 'label' => __( 94 'Tags', 95 'indieweb-post-kinds' 96 ), 97 ), 98 'featured' => array( 99 'type' => 'url', 100 'label' => __( 101 'Featured Media', 102 'indieweb-post-kinds' 103 ), 104 ), 105 ), 106 ), 56 'in-reply-to' => Kind_Fields::cite_field( __( 'In Reply To', 'indieweb-post-kinds' ) ), 107 57 ), 108 58 'format' => 'link', … … 110 60 'description_url' => 'http://indieweb.org/reply', 111 61 'shortlink' => 't', 112 'title' => false,113 62 'show' => true, 114 63 ) … … 123 72 'property' => 'repost-of', 124 73 'properties' => array( 125 'repost-of' => array( 126 'type' => 'cite', 127 'label' => __( 'Repost', 'indieweb-post-kinds' ), 128 'properties' => array( 129 'name' => array( 130 'type' => 'text', 131 'label' => __( 'Name', 'indieweb-post-kinds' ), 132 ), 133 'url' => array( 134 'type' => 'url', 135 'label' => __( 'URL', 'indieweb-post-kinds' ), 136 ), 137 'author' => array( 138 'type' => 'author', 139 'label' => __( 140 'Author', 141 'indieweb-post-kinds' 142 ), 143 ), 144 'summary' => array( 145 'type' => 'textarea', 146 'label' => __( 'Summary', 'indieweb-post-kinds' ), 147 ), 148 'publication' => array( 149 'type' => 'text', 150 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 151 ), 152 'published' => array( 153 'type' => 'datetime', 154 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 155 ), 156 'updated' => array( 157 'type' => 'datetime', 158 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 159 ), 160 'category' => array( 161 'type' => 'list', 162 'label' => __( 163 'Tags', 164 'indieweb-post-kinds' 165 ), 166 ), 167 'featured' => array( 168 'type' => 'url', 169 'label' => __( 170 'Featured Media', 171 'indieweb-post-kinds' 172 ), 173 ), 174 ), 175 ), 74 'repost-of' => Kind_Fields::cite_field( __( 'Repost', 'indieweb-post-kinds' ) ), 176 75 ), 177 76 'format' => '', … … 179 78 'description_url' => 'http://indieweb.org/repost', 180 79 'shortlink' => 'b', 181 'title' => true,182 80 'show' => true, 183 81 ) … … 192 90 'property' => 'like-of', 193 91 'properties' => array( 194 'like-of' => array( 195 'type' => 'cite', 196 'label' => __( 'Like', 'indieweb-post-kinds' ), 197 'properties' => array( 198 'name' => array( 199 'type' => 'text', 200 'label' => __( 'Name', 'indieweb-post-kinds' ), 201 ), 202 'url' => array( 203 'type' => 'url', 204 'label' => __( 'URL', 'indieweb-post-kinds' ), 205 ), 206 'author' => array( 207 'type' => 'author', 208 'label' => __( 209 'Author', 210 'indieweb-post-kinds' 211 ), 212 ), 213 'summary' => array( 214 'type' => 'textarea', 215 'label' => __( 'Summary', 'indieweb-post-kinds' ), 216 ), 217 'publication' => array( 218 'type' => 'text', 219 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 220 ), 221 'published' => array( 222 'type' => 'datetime', 223 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 224 ), 225 'updated' => array( 226 'type' => 'datetime', 227 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 228 ), 229 'category' => array( 230 'type' => 'list', 231 'label' => __( 232 'Tags', 233 'indieweb-post-kinds' 234 ), 235 ), 236 'featured' => array( 237 'type' => 'url', 238 'label' => __( 239 'Featured Media', 240 'indieweb-post-kinds' 241 ), 242 ), 243 ), 244 ), 92 'like-of' => Kind_Fields::cite_field( __( 'Like', 'indieweb-post-kinds' ) ), 245 93 ), 246 94 'format' => 'link', … … 248 96 'description_url' => 'http://indieweb.org/like', 249 97 'shortlink' => 'f', 250 'title' => false,251 98 'show' => true, 252 99 ) … … 261 108 'property' => 'favorite-of', 262 109 'properties' => array( 263 'favorite-of' => array( 264 'type' => 'cite', 265 'label' => __( 'Favorited', 'indieweb-post-kinds' ), 266 'properties' => array( 267 'name' => array( 268 'type' => 'text', 269 'label' => __( 'Name', 'indieweb-post-kinds' ), 270 ), 271 'url' => array( 272 'type' => 'url', 273 'label' => __( 'URL', 'indieweb-post-kinds' ), 274 ), 275 'author' => array( 276 'type' => 'author', 277 'label' => __( 278 'Author', 279 'indieweb-post-kinds' 280 ), 281 ), 282 'summary' => array( 283 'type' => 'textarea', 284 'label' => __( 'Summary', 'indieweb-post-kinds' ), 285 ), 286 'publication' => array( 287 'type' => 'text', 288 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 289 ), 290 'published' => array( 291 'type' => 'datetime', 292 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 293 ), 294 'updated' => array( 295 'type' => 'datetime', 296 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 297 ), 298 'category' => array( 299 'type' => 'list', 300 'label' => __( 301 'Tags', 302 'indieweb-post-kinds' 303 ), 304 ), 305 'featured' => array( 306 'type' => 'url', 307 'label' => __( 308 'Featured Media', 309 'indieweb-post-kinds' 310 ), 311 ), 312 ), 313 ), 110 'favorite-of' => Kind_Fields::cite_field( __( 'Favorited', 'indieweb-post-kinds' ) ), 314 111 ), 315 112 'format' => 'link', … … 317 114 'description_url' => 'http://indieweb.org/favorite', 318 115 'shortlink' => 'f', 319 'title' => false,320 116 'show' => true, 321 117 ) … … 330 126 'property' => 'bookmark-of', 331 127 'properties' => array( 332 'bookmark-of' => array( 333 'type' => 'cite', 334 'label' => __( 'Bookmark', 'indieweb-post-kinds' ), 335 'properties' => array( 336 'name' => array( 337 'type' => 'text', 338 'label' => __( 'Name', 'indieweb-post-kinds' ), 339 ), 340 'url' => array( 341 'type' => 'url', 342 'label' => __( 'URL', 'indieweb-post-kinds' ), 343 ), 344 'author' => array( 345 'type' => 'author', 346 'label' => __( 347 'Author', 348 'indieweb-post-kinds' 349 ), 350 ), 351 'summary' => array( 352 'type' => 'textarea', 353 'label' => __( 'Summary', 'indieweb-post-kinds' ), 354 ), 355 'publication' => array( 356 'type' => 'text', 357 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 358 ), 359 'published' => array( 360 'type' => 'datetime', 361 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 362 ), 363 'updated' => array( 364 'type' => 'datetime', 365 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 366 ), 367 'category' => array( 368 'type' => 'list', 369 'label' => __( 370 'Tags', 371 'indieweb-post-kinds' 372 ), 373 ), 374 'featured' => array( 375 'type' => 'url', 376 'label' => __( 377 'Featured Media', 378 'indieweb-post-kinds' 379 ), 380 ), 381 ), 382 ), 128 'bookmark-of' => Kind_Fields::cite_field( __( 'Bookmark', 'indieweb-post-kinds' ) ), 383 129 ), 384 130 'format' => 'link', … … 386 132 'description_url' => 'http://indieweb.org/bookmark', 387 133 'shortlink' => 'h', 388 'title' => false,389 134 'show' => true, 390 135 ) … … 402 147 'description_url' => 'http://indieweb.org/photo', 403 148 'shortlink' => 'p', 404 'title' => false,405 149 'show' => true, 406 150 ) … … 418 162 'description_url' => 'http://indieweb.org/video', 419 163 'shortlink' => 'a', 420 'title' => false,421 164 'show' => true, 422 165 ) … … 434 177 'description_url' => 'http://indieweb.org/audio', 435 178 'shortlink' => 'a', 436 'title' => false,437 179 'show' => true, 438 180 ) … … 450 192 'description_url' => 'http://indieweb.org/tag', 451 193 'shortlink' => 'd', 452 'title' => false,453 194 'show' => false, 454 195 ) … … 463 204 'property' => 'in-reply-to', 464 205 'properties' => array( 465 'rsvp' => array( 466 'type' => 'select', 467 'options' => array( 468 'yes' => __( 'Yes', 'indieweb-post-kinds' ), 469 'no' => __( 'No', 'indieweb-post-kinds' ), 470 'maybe' => __( 'Maybe', 'indieweb-post-kinds' ), 471 'interested' => __( 'Interested', 'indieweb-post-kinds' ), 472 'remote' => __( 'Remote', 'indieweb-post-kinds' ), 473 ), 474 ), 475 'in-reply-to' => array( 476 'type' => 'cite', 477 'label' => __( 'Event Details', 'indieweb-post-kinds' ), 478 'properties' => array( 479 'name' => array( 480 'type' => 'text', 481 'label' => __( 'Name', 'indieweb-post-kinds' ), 482 ), 483 'url' => array( 484 'type' => 'url', 485 'label' => __( 'URL', 'indieweb-post-kinds' ), 486 ), 487 'summary' => array( 488 'type' => 'textarea', 489 'label' => __( 'Summary', 'indieweb-post-kinds' ), 490 ), 491 'publication' => array( 492 'type' => 'text', 493 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 494 ), 495 'start' => array( 206 'rsvp' => Kind_Fields::rsvp_field(), 207 'in-reply-to' => Kind_Fields::cite_field( 208 __( 'Event Details', 'indieweb-post-kinds' ), 209 array( 210 'author' => false, 211 'published' => false, 212 'updated' => false, 213 'start' => array( 496 214 'type' => 'datetime', 497 215 'label' => __( 'Start Date', 'indieweb-post-kinds' ), 498 216 ), 499 'end' => array(217 'end' => array( 500 218 'type' => 'datetime', 501 219 'label' => __( 'End Date', 'indieweb-post-kinds' ), 502 220 ), 503 'category' => array( 504 'type' => 'list', 505 'label' => __( 506 'Tags', 507 'indieweb-post-kinds' 508 ), 509 ), 510 'featured' => array( 511 'type' => 'url', 512 'label' => __( 513 'Featured Media', 514 'indieweb-post-kinds' 515 ), 516 ), 517 ), 221 ) 518 222 ), 519 223 ), … … 522 226 'description_url' => 'http://indieweb.org/rsvp', 523 227 'shortlink' => 't', 524 'title' => false,525 228 'show' => true, 526 229 ) … … 534 237 'verb' => __( 'Listened', 'indieweb-post-kinds' ), 535 238 'property' => 'listen-of', 536 'properties' => array( 537 'listen-of' => array( 538 'type' => 'cite', 539 'label' => __( 'Listen To', 'indieweb-post-kinds' ), 540 'properties' => array( 541 'name' => array( 542 'type' => 'text', 543 'label' => __( 'Name', 'indieweb-post-kinds' ), 544 ), 545 'url' => array( 546 'type' => 'url', 547 'label' => __( 'URL', 'indieweb-post-kinds' ), 548 ), 549 'author' => array( 550 'type' => 'author', 551 'label' => __( 552 'Artist', 553 'indieweb-post-kinds' 554 ), 555 ), 556 'summary' => array( 557 'type' => 'textarea', 558 'label' => __( 'Summary', 'indieweb-post-kinds' ), 559 ), 560 'publication' => array( 561 'type' => 'text', 562 'label' => __( 'Album', 'indieweb-post-kinds' ), 563 ), 564 'published' => array( 565 'type' => 'datetime', 566 'label' => __( 'Release Date', 'indieweb-post-kinds' ), 567 ), 568 'category' => array( 569 'type' => 'list', 570 'label' => __( 571 'Tags', 572 'indieweb-post-kinds' 573 ), 574 ), 575 'featured' => array( 576 'type' => 'url', 577 'label' => __( 578 'Album Art', 579 'indieweb-post-kinds' 580 ), 581 ), 239 'properties' => array_merge( 240 array( 241 'listen-of' => Kind_Fields::cite_field( 242 __( 'Listen To', 'indieweb-post-kinds' ), 243 array( 244 'author' => array( 'label' => __( 'Artist', 'indieweb-post-kinds' ) ), 245 'publication' => array( 'label' => __( 'Album', 'indieweb-post-kinds' ) ), 246 'published' => array( 'label' => __( 'Release Date', 'indieweb-post-kinds' ) ), 247 'updated' => false, 248 'featured' => array( 'label' => __( 'Album Art', 'indieweb-post-kinds' ) ), 249 ) 582 250 ), 251 'rating' => Kind_Fields::rating_field(), 583 252 ), 253 Kind_Fields::time_fields() 584 254 ), 585 255 'format' => 'audio', … … 587 257 'description_url' => 'http://indieweb.org/listen', 588 258 'shortlink' => 'x', 589 'title' => false,590 259 'show' => true, 591 260 ) … … 599 268 'verb' => __( 'Watched', 'indieweb-post-kinds' ), 600 269 'property' => 'watch-of', 601 'properties' => array( 602 'watch-of' => array( 603 'type' => 'cite', 604 'label' => __( 'Watching To', 'indieweb-post-kinds' ), 605 'properties' => array( 606 'name' => array( 607 'type' => 'text', 608 'label' => __( 'Name', 'indieweb-post-kinds' ), 609 ), 610 'url' => array( 611 'type' => 'url', 612 'label' => __( 'URL', 'indieweb-post-kinds' ), 613 ), 614 'author' => array( 615 'type' => 'author', 616 'label' => __( 617 'Artist', 618 'indieweb-post-kinds' 619 ), 620 ), 621 'summary' => array( 622 'type' => 'textarea', 623 'label' => __( 'Summary', 'indieweb-post-kinds' ), 624 ), 625 'publication' => array( 626 'type' => 'text', 627 'label' => __( 'Series', 'indieweb-post-kinds' ), 628 ), 629 'published' => array( 630 'type' => 'datetime', 631 'label' => __( 'Release Date', 'indieweb-post-kinds' ), 632 ), 633 'category' => array( 634 'type' => 'list', 635 'label' => __( 636 'Tags', 637 'indieweb-post-kinds' 638 ), 639 ), 640 'featured' => array( 641 'type' => 'url', 642 'label' => __( 643 'Poster', 644 'indieweb-post-kinds' 645 ), 646 ), 270 'properties' => array_merge( 271 array( 272 'watch-of' => Kind_Fields::cite_field( 273 __( 'Watching To', 'indieweb-post-kinds' ), 274 array( 275 'author' => array( 'label' => __( 'Artist', 'indieweb-post-kinds' ) ), 276 'publication' => array( 'label' => __( 'Series', 'indieweb-post-kinds' ) ), 277 'published' => array( 'label' => __( 'Release Date', 'indieweb-post-kinds' ) ), 278 'updated' => false, 279 'featured' => array( 'label' => __( 'Poster', 'indieweb-post-kinds' ) ), 280 ) 647 281 ), 282 'rating' => Kind_Fields::rating_field(), 648 283 ), 284 Kind_Fields::time_fields() 649 285 ), 650 286 'format' => 'video', … … 652 288 'description_url' => 'http://indieweb.org/watch', 653 289 'shortlink' => 'x', 654 'title' => false,655 290 'show' => true, 656 291 ) … … 664 299 'verb' => __( 'Checked into', 'indieweb-post-kinds' ), 665 300 'property' => 'checkin', 301 // A place reference, like a citation. Location details are left to Simple Location when it's active (#553). 666 302 'properties' => array( 667 303 'checkin' => array( 668 304 'type' => 'venue', 669 305 'label' => __( 'Checked In', 'indieweb-post-kinds' ), 670 'properties' => array( 671 'name' => array( 672 'type' => 'name', 673 'label' => __( 'Name', 'indieweb-post-kinds' ), 674 ), 675 'url' => array( 676 'type' => 'url', 677 'label' => __( 'URL', 'indieweb-post-kinds' ), 678 ), 679 'latitude' => array( 680 'type' => 'number', 681 'label' => __( 682 'Latitude', 683 'indieweb-post-kinds' 684 ), 685 'step' => 0.0000001, 686 ), 687 'longitude' => array( 688 'type' => 'number', 689 'label' => __( 690 'Longitude', 691 'indieweb-post-kinds' 692 ), 693 'step' => 0.0000001, 694 ), 695 'street-address' => array( 696 'type' => 'text', 697 'label' => __( 'Street Address', 'indieweb-post-kinds' ), 698 ), 699 'locality' => array( 700 'type' => 'text', 701 'label' => __( 'Locality', 'indieweb-post-kinds' ), 702 ), 703 'region' => array( 704 'type' => 'text', 705 'label' => __( 'Region', 'indieweb-post-kinds' ), 706 ), 707 'country-name' => array( 708 'type' => 'text', 709 'label' => __( 'Country Name', 'indieweb-post-kinds' ), 710 ), 711 'postal-code' => array( 712 'type' => 'text', 713 'label' => __( 'Postal Code', 'indieweb-post-kinds' ), 714 ), 715 ), 306 'required' => true, 307 'properties' => wp_array_slice_assoc( Kind_Fields::cite_properties(), array( 'name', 'url' ) ), 716 308 ), 717 309 ), … … 720 312 'description_url' => 'http://indieweb.org/checkin', 721 313 'shortlink' => 'g', 722 'title' => false,723 314 'show' => true, 724 315 ) … … 736 327 'description_url' => '', 737 328 'shortlink' => 'f', 738 'title' => false,739 329 'show' => false, 740 330 ) … … 748 338 'verb' => __( 'Played', 'indieweb-post-kinds' ), 749 339 'property' => 'play-of', 340 'properties' => array_merge( 341 array( 342 'play-of' => Kind_Fields::cite_field( __( 'Played', 'indieweb-post-kinds' ) ), 343 'rating' => Kind_Fields::rating_field(), 344 ), 345 Kind_Fields::time_fields() 346 ), 750 347 'format' => 'status', 751 348 'description' => __( 'playing a game', 'indieweb-post-kinds' ), 752 349 'description_url' => 'https://indieweb.org/game_play', 753 350 'shortlink' => 'x', 754 'title' => false,755 351 'show' => true, 756 352 ) … … 768 364 'description_url' => 'https://indieweb.org/weather', 769 365 'shortlink' => 'u', 770 'title' => false,771 366 'show' => false, 772 367 ) … … 784 379 'description_url' => 'https://indieweb.org/exercise', 785 380 'shortlink' => 'm', 786 'title' => false,787 381 'show' => false, 788 382 ) … … 800 394 'description_url' => 'https://indieweb.org/trip', 801 395 'shortlink' => 'e', 802 'title' => false,803 396 'show' => false, 804 397 ) … … 816 409 'description_url' => 'https://indieweb.org/trip', 817 410 'shortlink' => 'e', 818 'title' => false,819 411 'show' => false, 820 412 ) … … 829 421 'verb' => __( 'Ate', 'indieweb-post-kinds' ), 830 422 'property' => 'ate', 423 'properties' => array( 424 'ate' => Kind_Fields::cite_field( __( 'Ate', 'indieweb-post-kinds' ) ), 425 'rating' => Kind_Fields::rating_field(), 426 ), 831 427 'format' => 'status', 832 428 'description' => __( 'what you are eating, perhaps for a food diary', 'indieweb-post-kinds' ), 833 429 'description_url' => 'https://indieweb.org/food', 834 430 'shortlink' => 'u', 835 'title' => false,836 431 'show' => true, 837 432 ) … … 846 441 'verb' => __( 'Drank', 'indieweb-post-kinds' ), 847 442 'property' => 'drank', 443 'properties' => array( 444 'drank' => Kind_Fields::cite_field( __( 'Drank', 'indieweb-post-kinds' ) ), 445 'rating' => Kind_Fields::rating_field(), 446 ), 848 447 'format' => 'status', 849 448 'description' => __( 'what you are drinking, perhaps for a food dairy', 'indieweb-post-kinds' ), 850 449 'description_url' => 'https://indieweb.org/food', 851 450 'shortlink' => 'u', 852 'title' => false,853 451 'show' => true, 854 452 ) … … 867 465 'description_url' => 'https://indieweb.org/follow', 868 466 'shortlink' => 'f', 869 'title' => false,870 467 'show' => false, 871 468 ) … … 880 477 'verb' => __( 'Listened to', 'indieweb-post-kinds' ), 881 478 'property' => 'jam-of', 479 'properties' => array_merge( 480 array( 481 'jam-of' => Kind_Fields::cite_field( 482 __( 'Listened to', 'indieweb-post-kinds' ), 483 array( 484 'author' => array( 'label' => __( 'Artist', 'indieweb-post-kinds' ) ), 485 'publication' => array( 'label' => __( 'Album', 'indieweb-post-kinds' ) ), 486 'published' => array( 'label' => __( 'Release Date', 'indieweb-post-kinds' ) ), 487 'updated' => false, 488 'featured' => array( 'label' => __( 'Album Art', 'indieweb-post-kinds' ) ), 489 ) 490 ), 491 'rating' => Kind_Fields::rating_field(), 492 ), 493 Kind_Fields::time_fields() 494 ), 882 495 'format' => 'audio', 883 496 'description' => __( 'a particularly personally meaningful song (a listen with added emphasis)', 'indieweb-post-kinds' ), 884 497 'description_url' => 'https://indieweb.org/jam', 885 498 'shortlink' => 'f', 886 'title' => false,887 499 'show' => true, 888 500 ) … … 897 509 'verb' => __( 'Read', 'indieweb-post-kinds' ), 898 510 'property' => 'read-of', 511 'properties' => array_merge( 512 array( 513 'read-of' => Kind_Fields::cite_field( __( 'Read', 'indieweb-post-kinds' ) ), 514 'read-status' => Kind_Fields::read_status_field(), 515 'rating' => Kind_Fields::rating_field(), 516 ), 517 Kind_Fields::time_fields() 518 ), 899 519 'format' => 'status', 900 520 'description' => __( 'reading a book, magazine, newspaper, other physical document, or online post', 'indieweb-post-kinds' ), 901 521 'description_url' => 'https://indieweb.org/read', 902 522 'shortlink' => 'x', 903 'title' => false,904 523 'show' => true, 905 524 ) … … 914 533 'verb' => __( 'Quoted', 'indieweb-post-kinds' ), 915 534 'property' => 'quotation-of', 535 'properties' => array( 536 'quotation-of' => Kind_Fields::cite_field( __( 'Quoted', 'indieweb-post-kinds' ) ), 537 ), 916 538 'format' => 'quote', 917 539 'description' => __( 'quoted content', 'indieweb-post-kinds' ), 918 540 'description_url' => 'https://indieweb.org/quote', 919 541 'shortlink' => 't', 920 'title' => false,921 542 'show' => true, 922 543 ) … … 935 556 'description_url' => 'https://indieweb.org/mood', 936 557 'shortlink' => 't', 937 'title' => false,938 558 'show' => false, 939 559 ) … … 948 568 'verb' => __( 'Cooked', 'indieweb-post-kinds' ), 949 569 'property' => 'recipe', 570 'properties' => array( 571 'name' => Kind_Fields::title_field(), 572 ), 950 573 'format' => '', 951 574 'description' => __( 'list of ingredients and directions for making food or drink', 'indieweb-post-kinds' ), 952 575 'description_url' => 'https://indieweb.org/recipe', 953 576 'shortlink' => 'b', 954 'title' => true,955 577 'show' => false, 956 578 ) … … 965 587 'verb' => __( 'Filed an Issue', 'indieweb-post-kinds' ), 966 588 'property' => 'in-reply-to', 589 'properties' => array( 590 'name' => Kind_Fields::title_field(), 591 'in-reply-to' => Kind_Fields::cite_field( __( 'In Reply To', 'indieweb-post-kinds' ) ), 592 ), 967 593 'format' => '', 968 594 'description' => __( 'Issue is a special kind of article post that is a reply to typically some source code, though potentially anything at a source control repository.', 'indieweb-post-kinds' ), 969 595 'description_url' => 'https://indieweb.org/issue', 970 596 'shortlink' => 't', 971 'title' => true,972 597 'show' => true, 973 598 ) … … 986 611 'description_url' => 'https://indieweb.org/question', 987 612 'shortlink' => 'q', 988 'title' => false,989 613 'show' => false, 990 614 ) … … 1003 627 'description_url' => 'https://indieweb.org/sleep', 1004 628 'shortlink' => 'm', 1005 'title' => false,1006 629 'show' => false, 1007 630 ) … … 1016 639 'verb' => __( 'Planned', 'indieweb-post-kinds' ), 1017 640 'property' => 'event', 641 'properties' => array( 642 'name' => Kind_Fields::title_field(), 643 ), 1018 644 'format' => '', 1019 645 'description' => __( 'An event is a type of post that in addition to a post name (event title) has a start datetime (likely end datetime), and a location.', 'indieweb-post-kinds' ), 1020 646 'description_url' => 'https://indieweb.org/event', 1021 647 'shortlink' => 'e', 1022 'title' => true,1023 648 'show' => false, 1024 649 ) … … 1032 657 'verb' => __( 'Reviewed', 'indieweb-post-kinds' ), 1033 658 'property' => 'review-of', 659 'properties' => array( 660 'review-of' => Kind_Fields::cite_field( __( 'Reviewed', 'indieweb-post-kinds' ) ), 661 'rating' => Kind_Fields::rating_field(), 662 ), 1034 663 'format' => '', 1035 664 'description' => __( 'A review is a post evaluating a product or service, usually involving a written description, sometimes with summary numerical evaluations, also known as just a rating.', 'indieweb-post-kinds' ), 1036 665 'description_url' => 'https://indieweb.org/review', 1037 666 'shortlink' => 't', 1038 'title' => false,1039 667 'show' => true, 1040 668 ) … … 1053 681 'description_url' => 'http://indieweb.org/acquisition', 1054 682 'shortlink' => 'f', 1055 'title' => false,1056 683 'show' => false, 1057 684 ) … … 1065 692 'verb' => __( 'Crafted', 'indieweb-post-kinds' ), 1066 693 'property' => 'craft-of', 694 'properties' => array( 695 'craft-of' => Kind_Fields::cite_field( __( 'Crafted', 'indieweb-post-kinds' ) ), 696 ), 1067 697 'format' => 'status', 1068 698 'description' => __( 'Activities like knitting, crocheting, cross stitch, wood working, restoration, 3d printing...the activity of building something.', 'indieweb-post-kinds' ), 1069 699 'description_url' => 'https://indieweb.org/crafts', 1070 700 'shortlink' => 'x', 1071 'title' => false, 1072 'show' => true, 1073 ) 1074 ); 701 'show' => true, 702 ) 703 ); -
indieweb-post-kinds/tags/4.0.2/includes/time-functions.php
r3738687 r3810578 123 123 if ( ! function_exists( 'tz_timezone_to_seconds' ) ) { 124 124 /** 125 * Returns a time zone's UTC offset in seconds. 125 * Returns a time zone's current UTC offset in seconds. 126 * 127 * The offset of a named time zone depends on the date, because of daylight 128 * saving time, so it is the offset now. 126 129 * 127 130 * @since 3.2.2 128 * 129 * @param string $timezone Time zone name or offset string. 131 * @since 4.0.2 Works: it used to fail on every call. 132 * 133 * @param string $timezone Time zone name or offset string, such as 'America/New_York' or '-05:00'. 130 134 * @return int|false Offset in seconds, or false if the time zone is not valid. 131 135 */ 132 136 function tz_timezone_to_seconds( $timezone ) { 133 $tz = timezone_open( $timezone ); 134 if ( $tz ) { 135 return $tz->getOffset(); 136 } 137 return false; 137 if ( ! is_string( $timezone ) || '' === trim( $timezone ) ) { 138 return false; 139 } 140 try { 141 $tz = new DateTimeZone( trim( $timezone ) ); 142 } catch ( Exception $e ) { 143 return false; 144 } 145 return $tz->getOffset( new DateTime( 'now', $tz ) ); 138 146 } 139 147 } -
indieweb-post-kinds/tags/4.0.2/indieweb-post-kinds.php
r3771941 r3810578 8 8 * Plugin URI: https://wordpress.org/plugins/indieweb-post-kinds/ 9 9 * Description: Ever want to reply to someone else's post with a post on your own site? Or to "like" someone else's post, but with your own site? 10 * Version: 4.0. 110 * Version: 4.0.2 11 11 * Requires at least: 6.2 12 12 * Requires PHP: 7.4 -
indieweb-post-kinds/tags/4.0.2/languages/indieweb-post-kinds.pot
r3771941 r3810578 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Post Kinds 4.0. 1\n"5 "Project-Id-Version: Post Kinds 4.0.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieweb-post-kinds\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-1 0-29T01:48:12+00:00\n"12 "POT-Creation-Date: 2026-11-19T03:09:43+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 147 147 msgstr "" 148 148 149 #: includes/class-kind-fields.php: 39149 #: includes/class-kind-fields.php:49 150 150 msgid "(GMT-11:00) Niue" 151 151 msgstr "" 152 152 153 #: includes/class-kind-fields.php: 40153 #: includes/class-kind-fields.php:50 154 154 msgid "(GMT-11:00) Pago Pago" 155 155 msgstr "" 156 156 157 #: includes/class-kind-fields.php: 41157 #: includes/class-kind-fields.php:51 158 158 msgid "(GMT-10:00) Hawaii Time" 159 159 msgstr "" 160 160 161 #: includes/class-kind-fields.php: 42161 #: includes/class-kind-fields.php:52 162 162 msgid "(GMT-10:00) Rarotonga" 163 163 msgstr "" 164 164 165 #: includes/class-kind-fields.php: 43165 #: includes/class-kind-fields.php:53 166 166 msgid "(GMT-10:00) Tahiti" 167 167 msgstr "" 168 168 169 #: includes/class-kind-fields.php: 44169 #: includes/class-kind-fields.php:54 170 170 msgid "(GMT-09:30) Marquesas" 171 171 msgstr "" 172 172 173 #: includes/class-kind-fields.php: 45173 #: includes/class-kind-fields.php:55 174 174 msgid "(GMT-09:00) Alaska Time" 175 175 msgstr "" 176 176 177 #: includes/class-kind-fields.php: 46177 #: includes/class-kind-fields.php:56 178 178 msgid "(GMT-09:00) Gambier" 179 179 msgstr "" 180 180 181 #: includes/class-kind-fields.php: 47181 #: includes/class-kind-fields.php:57 182 182 msgid "(GMT-08:00) Pacific Time" 183 183 msgstr "" 184 184 185 #: includes/class-kind-fields.php: 48185 #: includes/class-kind-fields.php:58 186 186 msgid "(GMT-08:00) Pacific Time - Tijuana" 187 187 msgstr "" 188 188 189 #: includes/class-kind-fields.php: 49189 #: includes/class-kind-fields.php:59 190 190 msgid "(GMT-08:00) Pacific Time - Vancouver" 191 191 msgstr "" 192 192 193 #: includes/class-kind-fields.php: 50193 #: includes/class-kind-fields.php:60 194 194 msgid "(GMT-08:00) Pacific Time - Whitehorse" 195 195 msgstr "" 196 196 197 #: includes/class-kind-fields.php: 51197 #: includes/class-kind-fields.php:61 198 198 msgid "(GMT-08:00) Pitcairn" 199 199 msgstr "" 200 200 201 #: includes/class-kind-fields.php: 52201 #: includes/class-kind-fields.php:62 202 202 msgid "(GMT-07:00) Mountain Time - Dawson Creek" 203 203 msgstr "" 204 204 205 #: includes/class-kind-fields.php: 53205 #: includes/class-kind-fields.php:63 206 206 msgid "(GMT-07:00) Mountain Time" 207 207 msgstr "" 208 208 209 #: includes/class-kind-fields.php: 54209 #: includes/class-kind-fields.php:64 210 210 msgid "(GMT-07:00) Mountain Time - Edmonton" 211 211 msgstr "" 212 212 213 #: includes/class-kind-fields.php: 55213 #: includes/class-kind-fields.php:65 214 214 msgid "(GMT-07:00) Mountain Time - Hermosillo" 215 215 msgstr "" 216 216 217 #: includes/class-kind-fields.php: 56217 #: includes/class-kind-fields.php:66 218 218 msgid "(GMT-07:00) Mountain Time - Chihuahua, Mazatlan" 219 219 msgstr "" 220 220 221 #: includes/class-kind-fields.php: 57221 #: includes/class-kind-fields.php:67 222 222 msgid "(GMT-07:00) Mountain Time - Arizona" 223 223 msgstr "" 224 224 225 #: includes/class-kind-fields.php: 58225 #: includes/class-kind-fields.php:68 226 226 msgid "(GMT-07:00) Mountain Time - Yellowknife" 227 227 msgstr "" 228 228 229 #: includes/class-kind-fields.php: 59229 #: includes/class-kind-fields.php:69 230 230 msgid "(GMT-06:00) Belize" 231 231 msgstr "" 232 232 233 #: includes/class-kind-fields.php: 60233 #: includes/class-kind-fields.php:70 234 234 msgid "(GMT-06:00) Central Time" 235 235 msgstr "" 236 236 237 #: includes/class-kind-fields.php: 61237 #: includes/class-kind-fields.php:71 238 238 msgid "(GMT-06:00) Costa Rica" 239 239 msgstr "" 240 240 241 #: includes/class-kind-fields.php: 62241 #: includes/class-kind-fields.php:72 242 242 msgid "(GMT-06:00) El Salvador" 243 243 msgstr "" 244 244 245 #: includes/class-kind-fields.php: 63245 #: includes/class-kind-fields.php:73 246 246 msgid "(GMT-06:00) Guatemala" 247 247 msgstr "" 248 248 249 #: includes/class-kind-fields.php: 64249 #: includes/class-kind-fields.php:74 250 250 msgid "(GMT-06:00) Managua" 251 251 msgstr "" 252 252 253 #: includes/class-kind-fields.php: 65253 #: includes/class-kind-fields.php:75 254 254 msgid "(GMT-06:00) Central Time - Mexico City" 255 255 msgstr "" 256 256 257 #: includes/class-kind-fields.php: 66257 #: includes/class-kind-fields.php:76 258 258 msgid "(GMT-06:00) Central Time - Regina" 259 259 msgstr "" 260 260 261 #: includes/class-kind-fields.php: 67261 #: includes/class-kind-fields.php:77 262 262 msgid "(GMT-06:00) Central Time - Tegucigalpa" 263 263 msgstr "" 264 264 265 #: includes/class-kind-fields.php: 68265 #: includes/class-kind-fields.php:78 266 266 msgid "(GMT-06:00) Central Time - Winnipeg" 267 267 msgstr "" 268 268 269 #: includes/class-kind-fields.php: 69269 #: includes/class-kind-fields.php:79 270 270 msgid "(GMT-06:00) Galapagos" 271 271 msgstr "" 272 272 273 #: includes/class-kind-fields.php: 70273 #: includes/class-kind-fields.php:80 274 274 msgid "(GMT-05:00) Bogota" 275 275 msgstr "" 276 276 277 #: includes/class-kind-fields.php: 71277 #: includes/class-kind-fields.php:81 278 278 msgid "(GMT-05:00) America Cancun" 279 279 msgstr "" 280 280 281 #: includes/class-kind-fields.php: 72281 #: includes/class-kind-fields.php:82 282 282 msgid "(GMT-05:00) Cayman" 283 283 msgstr "" 284 284 285 #: includes/class-kind-fields.php: 73285 #: includes/class-kind-fields.php:83 286 286 msgid "(GMT-05:00) Guayaquil" 287 287 msgstr "" 288 288 289 #: includes/class-kind-fields.php: 74289 #: includes/class-kind-fields.php:84 290 290 msgid "(GMT-05:00) Havana" 291 291 msgstr "" 292 292 293 #: includes/class-kind-fields.php: 75293 #: includes/class-kind-fields.php:85 294 294 msgid "(GMT-05:00) Eastern Time - Iqaluit" 295 295 msgstr "" 296 296 297 #: includes/class-kind-fields.php: 76297 #: includes/class-kind-fields.php:86 298 298 msgid "(GMT-05:00) Jamaica" 299 299 msgstr "" 300 300 301 #: includes/class-kind-fields.php: 77301 #: includes/class-kind-fields.php:87 302 302 msgid "(GMT-05:00) Lima" 303 303 msgstr "" 304 304 305 #: includes/class-kind-fields.php: 78305 #: includes/class-kind-fields.php:88 306 306 msgid "(GMT-05:00) Nassau" 307 307 msgstr "" 308 308 309 #: includes/class-kind-fields.php: 79309 #: includes/class-kind-fields.php:89 310 310 msgid "(GMT-05:00) Eastern Time" 311 311 msgstr "" 312 312 313 #: includes/class-kind-fields.php: 80313 #: includes/class-kind-fields.php:90 314 314 msgid "(GMT-05:00) Panama" 315 315 msgstr "" 316 316 317 #: includes/class-kind-fields.php: 81317 #: includes/class-kind-fields.php:91 318 318 msgid "(GMT-05:00) Port-au-Prince" 319 319 msgstr "" 320 320 321 #: includes/class-kind-fields.php: 82321 #: includes/class-kind-fields.php:92 322 322 msgid "(GMT-05:00) Rio Branco" 323 323 msgstr "" 324 324 325 #: includes/class-kind-fields.php: 83325 #: includes/class-kind-fields.php:93 326 326 msgid "(GMT-05:00) Eastern Time - Toronto" 327 327 msgstr "" 328 328 329 #: includes/class-kind-fields.php: 84329 #: includes/class-kind-fields.php:94 330 330 msgid "(GMT-05:00) Easter Island" 331 331 msgstr "" 332 332 333 #: includes/class-kind-fields.php: 85333 #: includes/class-kind-fields.php:95 334 334 msgid "(GMT-04:30) Caracas" 335 335 msgstr "" 336 336 337 #: includes/class-kind-fields.php: 86337 #: includes/class-kind-fields.php:96 338 338 msgid "(GMT-03:00) Asuncion" 339 339 msgstr "" 340 340 341 #: includes/class-kind-fields.php: 87341 #: includes/class-kind-fields.php:97 342 342 msgid "(GMT-04:00) Barbados" 343 343 msgstr "" 344 344 345 #: includes/class-kind-fields.php: 88345 #: includes/class-kind-fields.php:98 346 346 msgid "(GMT-04:00) Boa Vista" 347 347 msgstr "" 348 348 349 #: includes/class-kind-fields.php: 89349 #: includes/class-kind-fields.php:99 350 350 msgid "(GMT-03:00) Campo Grande" 351 351 msgstr "" 352 352 353 #: includes/class-kind-fields.php: 90353 #: includes/class-kind-fields.php:100 354 354 msgid "(GMT-03:00) Cuiaba" 355 355 msgstr "" 356 356 357 #: includes/class-kind-fields.php: 91357 #: includes/class-kind-fields.php:101 358 358 msgid "(GMT-04:00) Curacao" 359 359 msgstr "" 360 360 361 #: includes/class-kind-fields.php: 92361 #: includes/class-kind-fields.php:102 362 362 msgid "(GMT-04:00) Grand Turk" 363 363 msgstr "" 364 364 365 #: includes/class-kind-fields.php: 93365 #: includes/class-kind-fields.php:103 366 366 msgid "(GMT-04:00) Guyana" 367 367 msgstr "" 368 368 369 #: includes/class-kind-fields.php: 94369 #: includes/class-kind-fields.php:104 370 370 msgid "(GMT-04:00) Atlantic Time - Halifax" 371 371 msgstr "" 372 372 373 #: includes/class-kind-fields.php: 95373 #: includes/class-kind-fields.php:105 374 374 msgid "(GMT-04:00) La Paz" 375 375 msgstr "" 376 376 377 #: includes/class-kind-fields.php: 96377 #: includes/class-kind-fields.php:106 378 378 msgid "(GMT-04:00) Manaus" 379 379 msgstr "" 380 380 381 #: includes/class-kind-fields.php: 97381 #: includes/class-kind-fields.php:107 382 382 msgid "(GMT-04:00) Martinique" 383 383 msgstr "" 384 384 385 #: includes/class-kind-fields.php: 98385 #: includes/class-kind-fields.php:108 386 386 msgid "(GMT-04:00) Port of Spain" 387 387 msgstr "" 388 388 389 #: includes/class-kind-fields.php: 99389 #: includes/class-kind-fields.php:109 390 390 msgid "(GMT-04:00) Porto Velho" 391 391 msgstr "" 392 392 393 #: includes/class-kind-fields.php:1 00393 #: includes/class-kind-fields.php:110 394 394 msgid "(GMT-04:00) Puerto Rico" 395 395 msgstr "" 396 396 397 #: includes/class-kind-fields.php:1 01397 #: includes/class-kind-fields.php:111 398 398 msgid "(GMT-04:00) Santo Domingo" 399 399 msgstr "" 400 400 401 #: includes/class-kind-fields.php:1 02401 #: includes/class-kind-fields.php:112 402 402 msgid "(GMT-04:00) Thule" 403 403 msgstr "" 404 404 405 #: includes/class-kind-fields.php:1 03405 #: includes/class-kind-fields.php:113 406 406 msgid "(GMT-04:00) Bermuda" 407 407 msgstr "" 408 408 409 #: includes/class-kind-fields.php:1 04409 #: includes/class-kind-fields.php:114 410 410 msgid "(GMT-03:30) Newfoundland Time - St. Johns" 411 411 msgstr "" 412 412 413 #: includes/class-kind-fields.php:1 05413 #: includes/class-kind-fields.php:115 414 414 msgid "(GMT-03:00) Araguaina" 415 415 msgstr "" 416 416 417 #: includes/class-kind-fields.php:1 06417 #: includes/class-kind-fields.php:116 418 418 msgid "(GMT-03:00) Buenos Aires" 419 419 msgstr "" 420 420 421 #: includes/class-kind-fields.php:1 07421 #: includes/class-kind-fields.php:117 422 422 msgid "(GMT-03:00) Salvador" 423 423 msgstr "" 424 424 425 #: includes/class-kind-fields.php:1 08425 #: includes/class-kind-fields.php:118 426 426 msgid "(GMT-03:00) Belem" 427 427 msgstr "" 428 428 429 #: includes/class-kind-fields.php:1 09429 #: includes/class-kind-fields.php:119 430 430 msgid "(GMT-03:00) Cayenne" 431 431 msgstr "" 432 432 433 #: includes/class-kind-fields.php:1 10433 #: includes/class-kind-fields.php:120 434 434 msgid "(GMT-03:00) Fortaleza" 435 435 msgstr "" 436 436 437 #: includes/class-kind-fields.php:1 11438 msgid "(GMT-0 3:00) Godthab"439 msgstr "" 440 441 #: includes/class-kind-fields.php:1 12437 #: includes/class-kind-fields.php:121 438 msgid "(GMT-02:00) Nuuk" 439 msgstr "" 440 441 #: includes/class-kind-fields.php:122 442 442 msgid "(GMT-03:00) Maceio" 443 443 msgstr "" 444 444 445 #: includes/class-kind-fields.php:1 13445 #: includes/class-kind-fields.php:123 446 446 msgid "(GMT-03:00) Miquelon" 447 447 msgstr "" 448 448 449 #: includes/class-kind-fields.php:1 14449 #: includes/class-kind-fields.php:124 450 450 msgid "(GMT-03:00) Montevideo" 451 451 msgstr "" 452 452 453 #: includes/class-kind-fields.php:1 15453 #: includes/class-kind-fields.php:125 454 454 msgid "(GMT-03:00) Paramaribo" 455 455 msgstr "" 456 456 457 #: includes/class-kind-fields.php:1 16457 #: includes/class-kind-fields.php:126 458 458 msgid "(GMT-03:00) Recife" 459 459 msgstr "" 460 460 461 #: includes/class-kind-fields.php:1 17461 #: includes/class-kind-fields.php:127 462 462 msgid "(GMT-03:00) Santiago" 463 463 msgstr "" 464 464 465 #: includes/class-kind-fields.php:1 18465 #: includes/class-kind-fields.php:128 466 466 msgid "(GMT-02:00) Sao Paulo" 467 467 msgstr "" 468 468 469 #: includes/class-kind-fields.php:1 19469 #: includes/class-kind-fields.php:129 470 470 msgid "(GMT-03:00) Palmer" 471 471 msgstr "" 472 472 473 #: includes/class-kind-fields.php:1 20473 #: includes/class-kind-fields.php:130 474 474 msgid "(GMT-03:00) Rothera" 475 475 msgstr "" 476 476 477 #: includes/class-kind-fields.php:1 21477 #: includes/class-kind-fields.php:131 478 478 msgid "(GMT-03:00) Stanley" 479 479 msgstr "" 480 480 481 #: includes/class-kind-fields.php:1 22481 #: includes/class-kind-fields.php:132 482 482 msgid "(GMT-02:00) Noronha" 483 483 msgstr "" 484 484 485 #: includes/class-kind-fields.php:1 23485 #: includes/class-kind-fields.php:133 486 486 msgid "(GMT-02:00) South Georgia" 487 487 msgstr "" 488 488 489 #: includes/class-kind-fields.php:1 24489 #: includes/class-kind-fields.php:134 490 490 msgid "(GMT-01:00) Scoresbysund" 491 491 msgstr "" 492 492 493 #: includes/class-kind-fields.php:1 25493 #: includes/class-kind-fields.php:135 494 494 msgid "(GMT-01:00) Azores" 495 495 msgstr "" 496 496 497 #: includes/class-kind-fields.php:1 26497 #: includes/class-kind-fields.php:136 498 498 msgid "(GMT-01:00) Cape Verde" 499 499 msgstr "" 500 500 501 #: includes/class-kind-fields.php:1 27501 #: includes/class-kind-fields.php:137 502 502 msgid "(GMT+00:00) Abidjan" 503 503 msgstr "" 504 504 505 #: includes/class-kind-fields.php:1 28505 #: includes/class-kind-fields.php:138 506 506 msgid "(GMT+00:00) Accra" 507 507 msgstr "" 508 508 509 #: includes/class-kind-fields.php:1 29509 #: includes/class-kind-fields.php:139 510 510 msgid "(GMT+00:00) Bissau" 511 511 msgstr "" 512 512 513 #: includes/class-kind-fields.php:1 30513 #: includes/class-kind-fields.php:140 514 514 msgid "(GMT+00:00) Casablanca" 515 515 msgstr "" 516 516 517 #: includes/class-kind-fields.php:1 31517 #: includes/class-kind-fields.php:141 518 518 msgid "(GMT+00:00) El Aaiun" 519 519 msgstr "" 520 520 521 #: includes/class-kind-fields.php:1 32521 #: includes/class-kind-fields.php:142 522 522 msgid "(GMT+00:00) Monrovia" 523 523 msgstr "" 524 524 525 #: includes/class-kind-fields.php:1 33525 #: includes/class-kind-fields.php:143 526 526 msgid "(GMT+00:00) Danmarkshavn" 527 527 msgstr "" 528 528 529 #: includes/class-kind-fields.php:1 34529 #: includes/class-kind-fields.php:144 530 530 msgid "(GMT+00:00) Canary Islands" 531 531 msgstr "" 532 532 533 #: includes/class-kind-fields.php:1 35533 #: includes/class-kind-fields.php:145 534 534 msgid "(GMT+00:00) Faeroe" 535 535 msgstr "" 536 536 537 #: includes/class-kind-fields.php:1 36537 #: includes/class-kind-fields.php:146 538 538 msgid "(GMT+00:00) Reykjavik" 539 539 msgstr "" 540 540 541 #: includes/class-kind-fields.php:1 37541 #: includes/class-kind-fields.php:147 542 542 msgid "(GMT+00:00) GMT (no daylight saving)" 543 543 msgstr "" 544 544 545 #: includes/class-kind-fields.php:1 38545 #: includes/class-kind-fields.php:148 546 546 msgid "(GMT+00:00) Dublin" 547 547 msgstr "" 548 548 549 #: includes/class-kind-fields.php:1 39549 #: includes/class-kind-fields.php:149 550 550 msgid "(GMT+00:00) Lisbon" 551 551 msgstr "" 552 552 553 #: includes/class-kind-fields.php:1 40553 #: includes/class-kind-fields.php:150 554 554 msgid "(GMT+00:00) London" 555 555 msgstr "" 556 556 557 #: includes/class-kind-fields.php:1 41557 #: includes/class-kind-fields.php:151 558 558 msgid "(GMT+01:00) Algiers" 559 559 msgstr "" 560 560 561 #: includes/class-kind-fields.php:1 42561 #: includes/class-kind-fields.php:152 562 562 msgid "(GMT+01:00) Ceuta" 563 563 msgstr "" 564 564 565 #: includes/class-kind-fields.php:1 43565 #: includes/class-kind-fields.php:153 566 566 msgid "(GMT+01:00) Lagos" 567 567 msgstr "" 568 568 569 #: includes/class-kind-fields.php:1 44569 #: includes/class-kind-fields.php:154 570 570 msgid "(GMT+01:00) Ndjamena" 571 571 msgstr "" 572 572 573 #: includes/class-kind-fields.php:1 45573 #: includes/class-kind-fields.php:155 574 574 msgid "(GMT+01:00) Tunis" 575 575 msgstr "" 576 576 577 #: includes/class-kind-fields.php:1 46577 #: includes/class-kind-fields.php:156 578 578 msgid "(GMT+02:00) Windhoek" 579 579 msgstr "" 580 580 581 #: includes/class-kind-fields.php:1 47581 #: includes/class-kind-fields.php:157 582 582 msgid "(GMT+01:00) Amsterdam" 583 583 msgstr "" 584 584 585 #: includes/class-kind-fields.php:1 48585 #: includes/class-kind-fields.php:158 586 586 msgid "(GMT+01:00) Andorra" 587 587 msgstr "" 588 588 589 #: includes/class-kind-fields.php:1 49589 #: includes/class-kind-fields.php:159 590 590 msgid "(GMT+01:00) Central European Time - Belgrade" 591 591 msgstr "" 592 592 593 #: includes/class-kind-fields.php:1 50593 #: includes/class-kind-fields.php:160 594 594 msgid "(GMT+01:00) Berlin" 595 595 msgstr "" 596 596 597 #: includes/class-kind-fields.php:1 51597 #: includes/class-kind-fields.php:161 598 598 msgid "(GMT+01:00) Brussels" 599 599 msgstr "" 600 600 601 #: includes/class-kind-fields.php:1 52601 #: includes/class-kind-fields.php:162 602 602 msgid "(GMT+01:00) Budapest" 603 603 msgstr "" 604 604 605 #: includes/class-kind-fields.php:1 53605 #: includes/class-kind-fields.php:163 606 606 msgid "(GMT+01:00) Copenhagen" 607 607 msgstr "" 608 608 609 #: includes/class-kind-fields.php:1 54609 #: includes/class-kind-fields.php:164 610 610 msgid "(GMT+01:00) Gibraltar" 611 611 msgstr "" 612 612 613 #: includes/class-kind-fields.php:1 55613 #: includes/class-kind-fields.php:165 614 614 msgid "(GMT+01:00) Luxembourg" 615 615 msgstr "" 616 616 617 #: includes/class-kind-fields.php:1 56617 #: includes/class-kind-fields.php:166 618 618 msgid "(GMT+01:00) Madrid" 619 619 msgstr "" 620 620 621 #: includes/class-kind-fields.php:1 57621 #: includes/class-kind-fields.php:167 622 622 msgid "(GMT+01:00) Malta" 623 623 msgstr "" 624 624 625 #: includes/class-kind-fields.php:1 58625 #: includes/class-kind-fields.php:168 626 626 msgid "(GMT+01:00) Monaco" 627 627 msgstr "" 628 628 629 #: includes/class-kind-fields.php:1 59629 #: includes/class-kind-fields.php:169 630 630 msgid "(GMT+01:00) Oslo" 631 631 msgstr "" 632 632 633 #: includes/class-kind-fields.php:1 60633 #: includes/class-kind-fields.php:170 634 634 msgid "(GMT+01:00) Paris" 635 635 msgstr "" 636 636 637 #: includes/class-kind-fields.php:1 61637 #: includes/class-kind-fields.php:171 638 638 msgid "(GMT+01:00) Central European Time - Prague" 639 639 msgstr "" 640 640 641 #: includes/class-kind-fields.php:1 62641 #: includes/class-kind-fields.php:172 642 642 msgid "(GMT+01:00) Rome" 643 643 msgstr "" 644 644 645 #: includes/class-kind-fields.php:1 63645 #: includes/class-kind-fields.php:173 646 646 msgid "(GMT+01:00) Stockholm" 647 647 msgstr "" 648 648 649 #: includes/class-kind-fields.php:1 64649 #: includes/class-kind-fields.php:174 650 650 msgid "(GMT+01:00) Tirane" 651 651 msgstr "" 652 652 653 #: includes/class-kind-fields.php:1 65653 #: includes/class-kind-fields.php:175 654 654 msgid "(GMT+01:00) Vienna" 655 655 msgstr "" 656 656 657 #: includes/class-kind-fields.php:1 66657 #: includes/class-kind-fields.php:176 658 658 msgid "(GMT+01:00) Warsaw" 659 659 msgstr "" 660 660 661 #: includes/class-kind-fields.php:1 67661 #: includes/class-kind-fields.php:177 662 662 msgid "(GMT+01:00) Zurich" 663 663 msgstr "" 664 664 665 #: includes/class-kind-fields.php:1 68665 #: includes/class-kind-fields.php:178 666 666 msgid "(GMT+02:00) Cairo" 667 667 msgstr "" 668 668 669 #: includes/class-kind-fields.php:1 69669 #: includes/class-kind-fields.php:179 670 670 msgid "(GMT+02:00) Johannesburg" 671 671 msgstr "" 672 672 673 #: includes/class-kind-fields.php:1 70673 #: includes/class-kind-fields.php:180 674 674 msgid "(GMT+02:00) Maputo" 675 675 msgstr "" 676 676 677 #: includes/class-kind-fields.php:1 71677 #: includes/class-kind-fields.php:181 678 678 msgid "(GMT+02:00) Tripoli" 679 679 msgstr "" 680 680 681 #: includes/class-kind-fields.php:1 72681 #: includes/class-kind-fields.php:182 682 682 msgid "(GMT+02:00) Amman" 683 683 msgstr "" 684 684 685 #: includes/class-kind-fields.php:1 73685 #: includes/class-kind-fields.php:183 686 686 msgid "(GMT+02:00) Beirut" 687 687 msgstr "" 688 688 689 #: includes/class-kind-fields.php:1 74689 #: includes/class-kind-fields.php:184 690 690 msgid "(GMT+02:00) Damascus" 691 691 msgstr "" 692 692 693 #: includes/class-kind-fields.php:1 75693 #: includes/class-kind-fields.php:185 694 694 msgid "(GMT+02:00) Gaza" 695 695 msgstr "" 696 696 697 #: includes/class-kind-fields.php:1 76697 #: includes/class-kind-fields.php:186 698 698 msgid "(GMT+02:00) Jerusalem" 699 699 msgstr "" 700 700 701 #: includes/class-kind-fields.php:1 77701 #: includes/class-kind-fields.php:187 702 702 msgid "(GMT+02:00) Nicosia" 703 703 msgstr "" 704 704 705 #: includes/class-kind-fields.php:1 78705 #: includes/class-kind-fields.php:188 706 706 msgid "(GMT+02:00) Athens" 707 707 msgstr "" 708 708 709 #: includes/class-kind-fields.php:1 79709 #: includes/class-kind-fields.php:189 710 710 msgid "(GMT+02:00) Bucharest" 711 711 msgstr "" 712 712 713 #: includes/class-kind-fields.php:1 80713 #: includes/class-kind-fields.php:190 714 714 msgid "(GMT+02:00) Chisinau" 715 715 msgstr "" 716 716 717 #: includes/class-kind-fields.php:1 81717 #: includes/class-kind-fields.php:191 718 718 msgid "(GMT+02:00) Helsinki" 719 719 msgstr "" 720 720 721 #: includes/class-kind-fields.php:1 82721 #: includes/class-kind-fields.php:192 722 722 msgid "(GMT+02:00) Istanbul" 723 723 msgstr "" 724 724 725 #: includes/class-kind-fields.php:1 83725 #: includes/class-kind-fields.php:193 726 726 msgid "(GMT+02:00) Moscow-01 - Kaliningrad" 727 727 msgstr "" 728 728 729 #: includes/class-kind-fields.php:1 84730 msgid "(GMT+02:00) K iev"731 msgstr "" 732 733 #: includes/class-kind-fields.php:1 85729 #: includes/class-kind-fields.php:194 730 msgid "(GMT+02:00) Kyiv" 731 msgstr "" 732 733 #: includes/class-kind-fields.php:195 734 734 msgid "(GMT+02:00) Riga" 735 735 msgstr "" 736 736 737 #: includes/class-kind-fields.php:1 86737 #: includes/class-kind-fields.php:196 738 738 msgid "(GMT+02:00) Sofia" 739 739 msgstr "" 740 740 741 #: includes/class-kind-fields.php:1 87741 #: includes/class-kind-fields.php:197 742 742 msgid "(GMT+02:00) Tallinn" 743 743 msgstr "" 744 744 745 #: includes/class-kind-fields.php:1 88745 #: includes/class-kind-fields.php:198 746 746 msgid "(GMT+02:00) Vilnius" 747 747 msgstr "" 748 748 749 #: includes/class-kind-fields.php:1 89749 #: includes/class-kind-fields.php:199 750 750 msgid "(GMT+03:00) Khartoum" 751 751 msgstr "" 752 752 753 #: includes/class-kind-fields.php: 190753 #: includes/class-kind-fields.php:200 754 754 msgid "(GMT+03:00) Nairobi" 755 755 msgstr "" 756 756 757 #: includes/class-kind-fields.php: 191757 #: includes/class-kind-fields.php:201 758 758 msgid "(GMT+03:00) Syowa" 759 759 msgstr "" 760 760 761 #: includes/class-kind-fields.php: 192761 #: includes/class-kind-fields.php:202 762 762 msgid "(GMT+03:00) Baghdad" 763 763 msgstr "" 764 764 765 #: includes/class-kind-fields.php: 193765 #: includes/class-kind-fields.php:203 766 766 msgid "(GMT+03:00) Qatar" 767 767 msgstr "" 768 768 769 #: includes/class-kind-fields.php: 194769 #: includes/class-kind-fields.php:204 770 770 msgid "(GMT+03:00) Riyadh" 771 771 msgstr "" 772 772 773 #: includes/class-kind-fields.php: 195773 #: includes/class-kind-fields.php:205 774 774 msgid "(GMT+03:00) Minsk" 775 775 msgstr "" 776 776 777 #: includes/class-kind-fields.php: 196777 #: includes/class-kind-fields.php:206 778 778 msgid "(GMT+03:00) Moscow+00 - Moscow" 779 779 msgstr "" 780 780 781 #: includes/class-kind-fields.php: 197781 #: includes/class-kind-fields.php:207 782 782 msgid "(GMT+03:30) Tehran" 783 783 msgstr "" 784 784 785 #: includes/class-kind-fields.php: 198785 #: includes/class-kind-fields.php:208 786 786 msgid "(GMT+04:00) Baku" 787 787 msgstr "" 788 788 789 #: includes/class-kind-fields.php: 199789 #: includes/class-kind-fields.php:209 790 790 msgid "(GMT+04:00) Dubai" 791 791 msgstr "" 792 792 793 #: includes/class-kind-fields.php:2 00793 #: includes/class-kind-fields.php:210 794 794 msgid "(GMT+04:00) Tbilisi" 795 795 msgstr "" 796 796 797 #: includes/class-kind-fields.php:2 01797 #: includes/class-kind-fields.php:211 798 798 msgid "(GMT+04:00) Yerevan" 799 799 msgstr "" 800 800 801 #: includes/class-kind-fields.php:2 02801 #: includes/class-kind-fields.php:212 802 802 msgid "(GMT+04:00) Moscow+01 - Samara" 803 803 msgstr "" 804 804 805 #: includes/class-kind-fields.php:2 03805 #: includes/class-kind-fields.php:213 806 806 msgid "(GMT+04:00) Mahe" 807 807 msgstr "" 808 808 809 #: includes/class-kind-fields.php:2 04809 #: includes/class-kind-fields.php:214 810 810 msgid "(GMT+04:00) Mauritius" 811 811 msgstr "" 812 812 813 #: includes/class-kind-fields.php:2 05813 #: includes/class-kind-fields.php:215 814 814 msgid "(GMT+04:00) Reunion" 815 815 msgstr "" 816 816 817 #: includes/class-kind-fields.php:2 06817 #: includes/class-kind-fields.php:216 818 818 msgid "(GMT+04:30) Kabul" 819 819 msgstr "" 820 820 821 #: includes/class-kind-fields.php:2 07821 #: includes/class-kind-fields.php:217 822 822 msgid "(GMT+05:00) Mawson" 823 823 msgstr "" 824 824 825 #: includes/class-kind-fields.php:2 08825 #: includes/class-kind-fields.php:218 826 826 msgid "(GMT+05:00) Aqtau" 827 827 msgstr "" 828 828 829 #: includes/class-kind-fields.php:2 09829 #: includes/class-kind-fields.php:219 830 830 msgid "(GMT+05:00) Aqtobe" 831 831 msgstr "" 832 832 833 #: includes/class-kind-fields.php:2 10833 #: includes/class-kind-fields.php:220 834 834 msgid "(GMT+05:00) Ashgabat" 835 835 msgstr "" 836 836 837 #: includes/class-kind-fields.php:2 11837 #: includes/class-kind-fields.php:221 838 838 msgid "(GMT+05:00) Dushanbe" 839 839 msgstr "" 840 840 841 #: includes/class-kind-fields.php:2 12841 #: includes/class-kind-fields.php:222 842 842 msgid "(GMT+05:00) Karachi" 843 843 msgstr "" 844 844 845 #: includes/class-kind-fields.php:2 13845 #: includes/class-kind-fields.php:223 846 846 msgid "(GMT+05:00) Tashkent" 847 847 msgstr "" 848 848 849 #: includes/class-kind-fields.php:2 14849 #: includes/class-kind-fields.php:224 850 850 msgid "(GMT+05:00) Moscow+02 - Yekaterinburg" 851 851 msgstr "" 852 852 853 #: includes/class-kind-fields.php:2 15853 #: includes/class-kind-fields.php:225 854 854 msgid "(GMT+05:00) Kerguelen" 855 855 msgstr "" 856 856 857 #: includes/class-kind-fields.php:2 16857 #: includes/class-kind-fields.php:226 858 858 msgid "(GMT+05:00) Maldives" 859 859 msgstr "" 860 860 861 #: includes/class-kind-fields.php:2 17861 #: includes/class-kind-fields.php:227 862 862 msgid "(GMT+05:30) India Standard Time" 863 863 msgstr "" 864 864 865 #: includes/class-kind-fields.php:2 18865 #: includes/class-kind-fields.php:228 866 866 msgid "(GMT+05:30) Colombo" 867 867 msgstr "" 868 868 869 #: includes/class-kind-fields.php:2 19870 msgid "(GMT+05:45) Kat mandu"871 msgstr "" 872 873 #: includes/class-kind-fields.php:2 20869 #: includes/class-kind-fields.php:229 870 msgid "(GMT+05:45) Kathmandu" 871 msgstr "" 872 873 #: includes/class-kind-fields.php:230 874 874 msgid "(GMT+06:00) Vostok" 875 875 msgstr "" 876 876 877 #: includes/class-kind-fields.php:2 21877 #: includes/class-kind-fields.php:231 878 878 msgid "(GMT+06:00) Almaty" 879 879 msgstr "" 880 880 881 #: includes/class-kind-fields.php:2 22881 #: includes/class-kind-fields.php:232 882 882 msgid "(GMT+06:00) Bishkek" 883 883 msgstr "" 884 884 885 #: includes/class-kind-fields.php:2 23885 #: includes/class-kind-fields.php:233 886 886 msgid "(GMT+06:00) Dhaka" 887 887 msgstr "" 888 888 889 #: includes/class-kind-fields.php:2 24889 #: includes/class-kind-fields.php:234 890 890 msgid "(GMT+06:00) Moscow+03 - Omsk, Novosibirsk" 891 891 msgstr "" 892 892 893 #: includes/class-kind-fields.php:2 25893 #: includes/class-kind-fields.php:235 894 894 msgid "(GMT+06:00) Thimphu" 895 895 msgstr "" 896 896 897 #: includes/class-kind-fields.php:2 26897 #: includes/class-kind-fields.php:236 898 898 msgid "(GMT+06:00) Chagos" 899 899 msgstr "" 900 900 901 #: includes/class-kind-fields.php:2 27902 msgid "(GMT+06:30) Rangoon"903 msgstr "" 904 905 #: includes/class-kind-fields.php:2 28901 #: includes/class-kind-fields.php:237 902 msgid "(GMT+06:30) Yangon" 903 msgstr "" 904 905 #: includes/class-kind-fields.php:238 906 906 msgid "(GMT+06:30) Cocos" 907 907 msgstr "" 908 908 909 #: includes/class-kind-fields.php:2 29909 #: includes/class-kind-fields.php:239 910 910 msgid "(GMT+07:00) Davis" 911 911 msgstr "" 912 912 913 #: includes/class-kind-fields.php:2 30913 #: includes/class-kind-fields.php:240 914 914 msgid "(GMT+07:00) Bangkok" 915 915 msgstr "" 916 916 917 #: includes/class-kind-fields.php:2 31917 #: includes/class-kind-fields.php:241 918 918 msgid "(GMT+07:00) Hovd" 919 919 msgstr "" 920 920 921 #: includes/class-kind-fields.php:2 32921 #: includes/class-kind-fields.php:242 922 922 msgid "(GMT+07:00) Jakarta" 923 923 msgstr "" 924 924 925 #: includes/class-kind-fields.php:2 33925 #: includes/class-kind-fields.php:243 926 926 msgid "(GMT+07:00) Moscow+04 - Krasnoyarsk" 927 927 msgstr "" 928 928 929 #: includes/class-kind-fields.php:234 930 msgid "(GMT+07:00) Hanoi" 931 msgstr "" 932 933 #: includes/class-kind-fields.php:235 929 #: includes/class-kind-fields.php:244 934 930 msgid "(GMT+07:00) Ho Chi Minh" 935 931 msgstr "" 936 932 937 #: includes/class-kind-fields.php:2 36933 #: includes/class-kind-fields.php:245 938 934 msgid "(GMT+07:00) Christmas" 939 935 msgstr "" 940 936 941 #: includes/class-kind-fields.php:2 37937 #: includes/class-kind-fields.php:246 942 938 msgid "(GMT+08:00) Casey" 943 939 msgstr "" 944 940 945 #: includes/class-kind-fields.php:2 38941 #: includes/class-kind-fields.php:247 946 942 msgid "(GMT+08:00) Brunei" 947 943 msgstr "" 948 944 949 #: includes/class-kind-fields.php:239 950 msgid "(GMT+08:00) Choibalsan" 951 msgstr "" 952 953 #: includes/class-kind-fields.php:240 945 #: includes/class-kind-fields.php:248 954 946 msgid "(GMT+08:00) Hong Kong" 955 947 msgstr "" 956 948 957 #: includes/class-kind-fields.php:24 1949 #: includes/class-kind-fields.php:249 958 950 msgid "(GMT+08:00) Moscow+05 - Irkutsk" 959 951 msgstr "" 960 952 961 #: includes/class-kind-fields.php:2 42953 #: includes/class-kind-fields.php:250 962 954 msgid "(GMT+08:00) Kuala Lumpur" 963 955 msgstr "" 964 956 965 #: includes/class-kind-fields.php:2 43957 #: includes/class-kind-fields.php:251 966 958 msgid "(GMT+08:00) Macau" 967 959 msgstr "" 968 960 969 #: includes/class-kind-fields.php:2 44961 #: includes/class-kind-fields.php:252 970 962 msgid "(GMT+08:00) Makassar" 971 963 msgstr "" 972 964 973 #: includes/class-kind-fields.php:2 45965 #: includes/class-kind-fields.php:253 974 966 msgid "(GMT+08:00) Manila" 975 967 msgstr "" 976 968 977 #: includes/class-kind-fields.php:2 46969 #: includes/class-kind-fields.php:254 978 970 msgid "(GMT+08:00) China Time - Beijing" 979 971 msgstr "" 980 972 981 #: includes/class-kind-fields.php:2 47973 #: includes/class-kind-fields.php:255 982 974 msgid "(GMT+08:00) Singapore" 983 975 msgstr "" 984 976 985 #: includes/class-kind-fields.php:2 48977 #: includes/class-kind-fields.php:256 986 978 msgid "(GMT+08:00) Taipei" 987 979 msgstr "" 988 980 989 #: includes/class-kind-fields.php:2 49981 #: includes/class-kind-fields.php:257 990 982 msgid "(GMT+08:00) Ulaanbaatar" 991 983 msgstr "" 992 984 993 #: includes/class-kind-fields.php:25 0985 #: includes/class-kind-fields.php:258 994 986 msgid "(GMT+08:00) Western Time - Perth" 995 987 msgstr "" 996 988 997 #: includes/class-kind-fields.php:25 1989 #: includes/class-kind-fields.php:259 998 990 msgid "(GMT+08:30) Pyongyang" 999 991 msgstr "" 1000 992 1001 #: includes/class-kind-fields.php:2 52993 #: includes/class-kind-fields.php:260 1002 994 msgid "(GMT+09:00) Dili" 1003 995 msgstr "" 1004 996 1005 #: includes/class-kind-fields.php:2 53997 #: includes/class-kind-fields.php:261 1006 998 msgid "(GMT+09:00) Jayapura" 1007 999 msgstr "" 1008 1000 1009 #: includes/class-kind-fields.php:2 541001 #: includes/class-kind-fields.php:262 1010 1002 msgid "(GMT+09:00) Seoul" 1011 1003 msgstr "" 1012 1004 1013 #: includes/class-kind-fields.php:2 551005 #: includes/class-kind-fields.php:263 1014 1006 msgid "(GMT+09:00) Tokyo" 1015 1007 msgstr "" 1016 1008 1017 #: includes/class-kind-fields.php:2 561009 #: includes/class-kind-fields.php:264 1018 1010 msgid "(GMT+09:00) Moscow+06 - Yakutsk" 1019 1011 msgstr "" 1020 1012 1021 #: includes/class-kind-fields.php:2 571013 #: includes/class-kind-fields.php:265 1022 1014 msgid "(GMT+09:00) Palau" 1023 1015 msgstr "" 1024 1016 1025 #: includes/class-kind-fields.php:2 581017 #: includes/class-kind-fields.php:266 1026 1018 msgid "(GMT+10:30) Central Time - Adelaide" 1027 1019 msgstr "" 1028 1020 1029 #: includes/class-kind-fields.php:2 591021 #: includes/class-kind-fields.php:267 1030 1022 msgid "(GMT+09:30) Central Time - Darwin" 1031 1023 msgstr "" 1032 1024 1033 #: includes/class-kind-fields.php:26 11025 #: includes/class-kind-fields.php:269 1034 1026 msgid "(GMT+10:00) Moscow+07 - Magadan" 1035 1027 msgstr "" 1036 1028 1037 #: includes/class-kind-fields.php:2 621029 #: includes/class-kind-fields.php:270 1038 1030 msgid "(GMT+10:00) Moscow+07 - Yuzhno-Sakhalinsk" 1039 1031 msgstr "" 1040 1032 1041 #: includes/class-kind-fields.php:2 631033 #: includes/class-kind-fields.php:271 1042 1034 msgid "(GMT+10:00) Eastern Time - Brisbane" 1043 1035 msgstr "" 1044 1036 1045 #: includes/class-kind-fields.php:2 641037 #: includes/class-kind-fields.php:272 1046 1038 msgid "(GMT+11:00) Eastern Time - Hobart" 1047 1039 msgstr "" 1048 1040 1049 #: includes/class-kind-fields.php:2 651041 #: includes/class-kind-fields.php:273 1050 1042 msgid "(GMT+11:00) Eastern Time - Melbourne, Sydney" 1051 1043 msgstr "" 1052 1044 1053 #: includes/class-kind-fields.php:2 661045 #: includes/class-kind-fields.php:274 1054 1046 msgid "(GMT+10:00) Truk" 1055 1047 msgstr "" 1056 1048 1057 #: includes/class-kind-fields.php:2 671049 #: includes/class-kind-fields.php:275 1058 1050 msgid "(GMT+10:00) Guam" 1059 1051 msgstr "" 1060 1052 1061 #: includes/class-kind-fields.php:2 681053 #: includes/class-kind-fields.php:276 1062 1054 msgid "(GMT+10:00) Port Moresby" 1063 1055 msgstr "" 1064 1056 1065 #: includes/class-kind-fields.php:2 691057 #: includes/class-kind-fields.php:277 1066 1058 msgid "(GMT+11:00) Efate" 1067 1059 msgstr "" 1068 1060 1069 #: includes/class-kind-fields.php:27 01061 #: includes/class-kind-fields.php:278 1070 1062 msgid "(GMT+11:00) Guadalcanal" 1071 1063 msgstr "" 1072 1064 1073 #: includes/class-kind-fields.php:27 11065 #: includes/class-kind-fields.php:279 1074 1066 msgid "(GMT+11:00) Kosrae" 1075 1067 msgstr "" 1076 1068 1077 #: includes/class-kind-fields.php:2 721069 #: includes/class-kind-fields.php:280 1078 1070 msgid "(GMT+11:00) Norfolk" 1079 1071 msgstr "" 1080 1072 1081 #: includes/class-kind-fields.php:2 731073 #: includes/class-kind-fields.php:281 1082 1074 msgid "(GMT+11:00) Noumea" 1083 1075 msgstr "" 1084 1076 1085 #: includes/class-kind-fields.php:2 741077 #: includes/class-kind-fields.php:282 1086 1078 msgid "(GMT+11:00) Ponape" 1087 1079 msgstr "" 1088 1080 1089 #: includes/class-kind-fields.php:2 751081 #: includes/class-kind-fields.php:283 1090 1082 msgid "(GMT+12:00) Moscow+09 - Petropavlovsk-Kamchatskiy" 1091 1083 msgstr "" 1092 1084 1093 #: includes/class-kind-fields.php:2 761085 #: includes/class-kind-fields.php:284 1094 1086 msgid "(GMT+13:00) Auckland" 1095 1087 msgstr "" 1096 1088 1097 #: includes/class-kind-fields.php:2 771089 #: includes/class-kind-fields.php:285 1098 1090 msgid "(GMT+13:00) Fiji" 1099 1091 msgstr "" 1100 1092 1101 #: includes/class-kind-fields.php:2 781093 #: includes/class-kind-fields.php:286 1102 1094 msgid "(GMT+12:00) Funafuti" 1103 1095 msgstr "" 1104 1096 1105 #: includes/class-kind-fields.php:2 791097 #: includes/class-kind-fields.php:287 1106 1098 msgid "(GMT+12:00) Kwajalein" 1107 1099 msgstr "" 1108 1100 1109 #: includes/class-kind-fields.php:28 01101 #: includes/class-kind-fields.php:288 1110 1102 msgid "(GMT+12:00) Majuro" 1111 1103 msgstr "" 1112 1104 1113 #: includes/class-kind-fields.php:28 11105 #: includes/class-kind-fields.php:289 1114 1106 msgid "(GMT+12:00) Nauru" 1115 1107 msgstr "" 1116 1108 1117 #: includes/class-kind-fields.php:2 821109 #: includes/class-kind-fields.php:290 1118 1110 msgid "(GMT+12:00) Tarawa" 1119 1111 msgstr "" 1120 1112 1121 #: includes/class-kind-fields.php:2 831113 #: includes/class-kind-fields.php:291 1122 1114 msgid "(GMT+12:00) Wake" 1123 1115 msgstr "" 1124 1116 1125 #: includes/class-kind-fields.php:2 841117 #: includes/class-kind-fields.php:292 1126 1118 msgid "(GMT+12:00) Wallis" 1127 1119 msgstr "" 1128 1120 1129 #: includes/class-kind-fields.php:2 851121 #: includes/class-kind-fields.php:293 1130 1122 msgid "(GMT+14:00) Apia" 1131 1123 msgstr "" 1132 1124 1133 #: includes/class-kind-fields.php:2 861134 msgid "(GMT+13:00) Enderbury"1135 msgstr "" 1136 1137 #: includes/class-kind-fields.php:2 871125 #: includes/class-kind-fields.php:294 1126 msgid "(GMT+13:00) Kanton" 1127 msgstr "" 1128 1129 #: includes/class-kind-fields.php:295 1138 1130 msgid "(GMT+13:00) Fakaofo" 1139 1131 msgstr "" 1140 1132 1141 #: includes/class-kind-fields.php:2 881133 #: includes/class-kind-fields.php:296 1142 1134 msgid "(GMT+13:00) Tongatapu" 1143 1135 msgstr "" 1144 1136 1145 #: includes/class-kind-fields.php:2 891137 #: includes/class-kind-fields.php:297 1146 1138 msgid "(GMT+14:00) Kiritimati" 1147 1139 msgstr "" 1148 1140 1149 #: includes/class-kind-fields.php:396 1141 #: includes/class-kind-fields.php:427 1142 #: templates/reply-time.php:21 1143 msgid "Years" 1144 msgstr "" 1145 1146 #: includes/class-kind-fields.php:428 1147 #: templates/reply-time.php:25 1148 msgid "Months" 1149 msgstr "" 1150 1151 #: includes/class-kind-fields.php:429 1152 #: templates/reply-time.php:29 1153 msgid "Days" 1154 msgstr "" 1155 1156 #: includes/class-kind-fields.php:430 1157 #: templates/reply-time.php:35 1158 msgid "Hours" 1159 msgstr "" 1160 1161 #: includes/class-kind-fields.php:431 1162 #: templates/reply-time.php:39 1163 msgid "Minutes" 1164 msgstr "" 1165 1166 #: includes/class-kind-fields.php:432 1167 #: templates/reply-time.php:43 1168 msgid "Seconds" 1169 msgstr "" 1170 1171 #: includes/class-kind-fields.php:463 1150 1172 msgid "Author Name" 1151 1173 msgstr "" 1152 1174 1153 #: includes/class-kind-fields.php:4 001175 #: includes/class-kind-fields.php:467 1154 1176 #: templates/reply-author.php:26 1155 1177 msgid "Author URL" 1156 1178 msgstr "" 1157 1179 1158 #: includes/class-kind-fields.php:4 041180 #: includes/class-kind-fields.php:471 1159 1181 msgid "Author Photo" 1160 1182 msgstr "" 1161 1183 1184 #: includes/class-kind-fields.php:493 1185 #: templates/reply-metabox.php:56 1186 msgid "Name" 1187 msgstr "" 1188 1189 #: includes/class-kind-fields.php:497 1190 #: templates/reply-metabox.php:50 1191 msgid "URL" 1192 msgstr "" 1193 1194 #: includes/class-kind-fields.php:501 1195 #: templates/reply-author.php:20 1196 #: templates/reply-metabox.php:45 1197 msgid "Author" 1198 msgstr "" 1199 1200 #: includes/class-kind-fields.php:505 1201 msgid "Summary" 1202 msgstr "" 1203 1204 #: includes/class-kind-fields.php:509 1205 msgid "Publication/Website" 1206 msgstr "" 1207 1208 #: includes/class-kind-fields.php:513 1209 msgid "Publish Date" 1210 msgstr "" 1211 1212 #: includes/class-kind-fields.php:517 1213 msgid "Updated Time" 1214 msgstr "" 1215 1216 #: includes/class-kind-fields.php:521 1217 #: includes/register-kinds.php:187 1218 msgid "Tags" 1219 msgstr "" 1220 1221 #: includes/class-kind-fields.php:525 1222 msgid "Featured Media" 1223 msgstr "" 1224 1225 #: includes/class-kind-fields.php:567 1226 msgid "Title" 1227 msgstr "" 1228 1229 #: includes/class-kind-fields.php:581 1230 #: includes/class-kind-metabox.php:422 1231 msgid "Rating" 1232 msgstr "" 1233 1234 #: includes/class-kind-fields.php:583 1235 #: includes/class-kind-metabox.php:346 1236 msgid "Very Dissatisfied" 1237 msgstr "" 1238 1239 #: includes/class-kind-fields.php:584 1240 #: includes/class-kind-metabox.php:347 1241 msgid "Dissatisfied" 1242 msgstr "" 1243 1244 #: includes/class-kind-fields.php:585 1245 #: includes/class-kind-metabox.php:348 1246 msgid "Neutral" 1247 msgstr "" 1248 1249 #: includes/class-kind-fields.php:586 1250 #: includes/class-kind-metabox.php:349 1251 msgid "Satisfied" 1252 msgstr "" 1253 1254 #: includes/class-kind-fields.php:587 1255 #: includes/class-kind-metabox.php:350 1256 msgid "Very Satisfied" 1257 msgstr "" 1258 1259 #: includes/class-kind-fields.php:603 1260 #: includes/class-kind-metabox.php:404 1261 #: includes/register-kinds.php:201 1262 #: views/kind.php:81 1263 msgid "RSVP" 1264 msgstr "" 1265 1266 #: includes/class-kind-fields.php:606 1267 #: includes/class-kind-metabox.php:376 1268 msgid "Yes" 1269 msgstr "" 1270 1271 #: includes/class-kind-fields.php:607 1272 #: includes/class-kind-metabox.php:377 1273 msgid "No" 1274 msgstr "" 1275 1276 #: includes/class-kind-fields.php:608 1277 #: includes/class-kind-metabox.php:378 1278 msgid "Maybe" 1279 msgstr "" 1280 1281 #: includes/class-kind-fields.php:609 1282 #: includes/class-kind-metabox.php:379 1283 msgid "Interested" 1284 msgstr "" 1285 1286 #: includes/class-kind-fields.php:610 1287 #: includes/class-kind-metabox.php:380 1288 msgid "Remote" 1289 msgstr "" 1290 1291 #: includes/class-kind-fields.php:625 1292 msgid "Read Status" 1293 msgstr "" 1294 1295 #: includes/class-kind-fields.php:627 1296 msgid "Want to Read" 1297 msgstr "" 1298 1299 #: includes/class-kind-fields.php:628 1300 msgid "Reading" 1301 msgstr "" 1302 1303 #: includes/class-kind-fields.php:629 1304 msgid "Finished Reading" 1305 msgstr "" 1306 1307 #: includes/class-kind-fields.php:645 1308 #: includes/register-kinds.php:215 1309 msgid "Start Date" 1310 msgstr "" 1311 1312 #: includes/class-kind-fields.php:649 1313 #: includes/register-kinds.php:219 1314 msgid "End Date" 1315 msgstr "" 1316 1317 #: includes/class-kind-fields.php:653 1318 #: templates/reply-time.php:18 1319 msgid "Duration" 1320 msgstr "" 1321 1162 1322 #: includes/class-kind-media-metadata.php:125 1163 #: includes/register-kinds.php:551 1164 #: includes/register-kinds.php:616 1323 #: includes/register-kinds.php:244 1324 #: includes/register-kinds.php:275 1325 #: includes/register-kinds.php:484 1165 1326 msgid "Artist" 1166 1327 msgstr "" … … 1233 1394 msgstr "" 1234 1395 1235 #: includes/class-kind-metabox.php:3461236 msgid "Very Dissatisfied"1237 msgstr ""1238 1239 #: includes/class-kind-metabox.php:3471240 msgid "Dissatisfied"1241 msgstr ""1242 1243 #: includes/class-kind-metabox.php:3481244 msgid "Neutral"1245 msgstr ""1246 1247 #: includes/class-kind-metabox.php:3491248 msgid "Satisfied"1249 msgstr ""1250 1251 #: includes/class-kind-metabox.php:3501252 msgid "Very Satisfied"1253 msgstr ""1254 1255 #: includes/class-kind-metabox.php:3761256 #: includes/register-kinds.php:4681257 msgid "Yes"1258 msgstr ""1259 1260 #: includes/class-kind-metabox.php:3771261 #: includes/register-kinds.php:4691262 msgid "No"1263 msgstr ""1264 1265 #: includes/class-kind-metabox.php:3781266 #: includes/register-kinds.php:4701267 msgid "Maybe"1268 msgstr ""1269 1270 #: includes/class-kind-metabox.php:3791271 #: includes/register-kinds.php:4711272 msgid "Interested"1273 msgstr ""1274 1275 #: includes/class-kind-metabox.php:3801276 #: includes/register-kinds.php:4721277 msgid "Remote"1278 msgstr ""1279 1280 #: includes/class-kind-metabox.php:4041281 #: includes/register-kinds.php:4601282 #: views/kind.php:811283 msgid "RSVP"1284 msgstr ""1285 1286 #: includes/class-kind-metabox.php:4221287 msgid "Rating"1288 msgstr ""1289 1290 1396 #: includes/class-kind-metabox.php:461 1291 1397 msgid "Response Properties" … … 1321 1427 msgstr "" 1322 1428 1323 #: includes/class-kind-taxonomy.php:6 091429 #: includes/class-kind-taxonomy.php:621 1324 1430 msgid "Post Kinds replaces the IndieWeb Taxonomy plugin. Deactivate IndieWeb Taxonomy, then activate Post Kinds." 1325 1431 msgstr "" 1326 1432 1327 #: includes/class-kind-taxonomy.php: 6971433 #: includes/class-kind-taxonomy.php:709 1328 1434 msgctxt "taxonomy general name" 1329 1435 msgid "Kinds" 1330 1436 msgstr "" 1331 1437 1332 #: includes/class-kind-taxonomy.php: 6981438 #: includes/class-kind-taxonomy.php:710 1333 1439 msgctxt "taxonomy singular name" 1334 1440 msgid "Kind" 1335 1441 msgstr "" 1336 1442 1337 #: includes/class-kind-taxonomy.php: 6991443 #: includes/class-kind-taxonomy.php:711 1338 1444 msgctxt "search locations" 1339 1445 msgid "Search Kinds" 1340 1446 msgstr "" 1341 1447 1342 #: includes/class-kind-taxonomy.php:7 001448 #: includes/class-kind-taxonomy.php:712 1343 1449 msgctxt "popular kinds" 1344 1450 msgid "Popular Kinds" 1345 1451 msgstr "" 1346 1452 1347 #: includes/class-kind-taxonomy.php:7 011453 #: includes/class-kind-taxonomy.php:713 1348 1454 msgctxt "all taxonomy items" 1349 1455 msgid "All Kinds" 1350 1456 msgstr "" 1351 1457 1352 #: includes/class-kind-taxonomy.php:7 021458 #: includes/class-kind-taxonomy.php:714 1353 1459 msgctxt "taxonomy parent item" 1354 1460 msgid "Parent Kind" 1355 1461 msgstr "" 1356 1462 1357 #: includes/class-kind-taxonomy.php:7 031463 #: includes/class-kind-taxonomy.php:715 1358 1464 msgctxt "taxonomy parent item with colon" 1359 1465 msgid "Parent Kind:" 1360 1466 msgstr "" 1361 1467 1362 #: includes/class-kind-taxonomy.php:7 041468 #: includes/class-kind-taxonomy.php:716 1363 1469 msgid "This will appear on archives as the description if your theme supports" 1364 1470 msgstr "" 1365 1471 1366 #: includes/class-kind-taxonomy.php:7 051472 #: includes/class-kind-taxonomy.php:717 1367 1473 msgctxt "edit taxonomy item" 1368 1474 msgid "Edit Kind" 1369 1475 msgstr "" 1370 1476 1371 #: includes/class-kind-taxonomy.php:7 061477 #: includes/class-kind-taxonomy.php:718 1372 1478 msgctxt "view taxonomy item" 1373 1479 msgid "View Kind" 1374 1480 msgstr "" 1375 1481 1376 #: includes/class-kind-taxonomy.php:7 071482 #: includes/class-kind-taxonomy.php:719 1377 1483 msgctxt "update taxonomy item" 1378 1484 msgid "Update Kind" 1379 1485 msgstr "" 1380 1486 1381 #: includes/class-kind-taxonomy.php:7 081487 #: includes/class-kind-taxonomy.php:720 1382 1488 msgctxt "add taxonomy item" 1383 1489 msgid "Add New Kind" 1384 1490 msgstr "" 1385 1491 1386 #: includes/class-kind-taxonomy.php:7 091492 #: includes/class-kind-taxonomy.php:721 1387 1493 msgctxt "new taxonomy item" 1388 1494 msgid "New Kind" 1389 1495 msgstr "" 1390 1496 1391 #: includes/class-kind-taxonomy.php:7 101497 #: includes/class-kind-taxonomy.php:722 1392 1498 msgctxt "separate kinds with commas" 1393 1499 msgid "Separate kinds with commas" 1394 1500 msgstr "" 1395 1501 1396 #: includes/class-kind-taxonomy.php:7 111502 #: includes/class-kind-taxonomy.php:723 1397 1503 msgctxt "add or remove items" 1398 1504 msgid "Add or remove kinds" 1399 1505 msgstr "" 1400 1506 1401 #: includes/class-kind-taxonomy.php:7 121507 #: includes/class-kind-taxonomy.php:724 1402 1508 msgctxt "choose most used" 1403 1509 msgid "Choose from the most used kinds" 1404 1510 msgstr "" 1405 1511 1406 #: includes/class-kind-taxonomy.php:7 131512 #: includes/class-kind-taxonomy.php:725 1407 1513 msgctxt "no kinds found" 1408 1514 msgid "No kinds found" 1409 1515 msgstr "" 1410 1516 1411 #: includes/class-kind-taxonomy.php:7 141517 #: includes/class-kind-taxonomy.php:726 1412 1518 msgctxt "no kinds" 1413 1519 msgid "No kinds" 1414 1520 msgstr "" 1415 1521 1416 #: includes/class-kind-taxonomy.php:7 151522 #: includes/class-kind-taxonomy.php:727 1417 1523 msgid "Back to Kinds" 1418 1524 msgstr "" 1419 1525 1420 #: includes/class-kind-taxonomy.php:7 161526 #: includes/class-kind-taxonomy.php:728 1421 1527 msgid "Kind Link" 1422 1528 msgstr "" 1423 1529 1424 #: includes/class-kind-taxonomy.php:7 171530 #: includes/class-kind-taxonomy.php:729 1425 1531 msgid "A link to a kind" 1426 1532 msgstr "" … … 1429 1535 #. translators: 1: Taxonomy. 2: Month name and year 1430 1536 #. translators: 1. Taxonomy . 1: Date 1431 #: includes/class-kind-taxonomy.php:11 141432 #: includes/class-kind-taxonomy.php:11 171433 #: includes/class-kind-taxonomy.php:11 201537 #: includes/class-kind-taxonomy.php:1138 1538 #: includes/class-kind-taxonomy.php:1141 1539 #: includes/class-kind-taxonomy.php:1144 1434 1540 #, php-format 1435 1541 msgid "%1$1s - %2$2s" … … 1437 1543 1438 1544 #. translators: 1: Taxonomy. Yearly archive title. 2: Year 1439 #: includes/class-kind-taxonomy.php:11 141545 #: includes/class-kind-taxonomy.php:1138 1440 1546 msgctxt "yearly archives date format" 1441 1547 msgid "Y" … … 1443 1549 1444 1550 #. translators: 1: Taxonomy. 2: Month name and year 1445 #: includes/class-kind-taxonomy.php:11 171551 #: includes/class-kind-taxonomy.php:1141 1446 1552 msgctxt "monthly archives date format" 1447 1553 msgid "F Y" … … 1449 1555 1450 1556 #. translators: 1. Taxonomy . 1: Date 1451 #: includes/class-kind-taxonomy.php:11 201557 #: includes/class-kind-taxonomy.php:1144 1452 1558 msgctxt "daily archives date format" 1453 1559 msgid "F j, Y" … … 1455 1561 1456 1562 #. translators: 1. Title 2. Translated term for Firehose Feed 1457 #: includes/class-kind-taxonomy.php:11 241563 #: includes/class-kind-taxonomy.php:1148 1458 1564 #, php-format 1459 1565 msgid "%1$s - %2$2s" … … 1461 1567 1462 1568 #. translators: 1. Title 2. Translated term for Firehose Feed 1463 #: includes/class-kind-taxonomy.php:11 241569 #: includes/class-kind-taxonomy.php:1148 1464 1570 msgid "Firehose" 1465 1571 msgstr "" 1466 1572 1467 1573 #. translators: 1: Title prefix. 2: Title. 1468 #: includes/class-kind-taxonomy.php:11 301574 #: includes/class-kind-taxonomy.php:1154 1469 1575 #, php-format 1470 1576 msgctxt "archive title" … … 1473 1579 1474 1580 #. translators: All 1475 #: includes/class-kind-taxonomy.php:14 551581 #: includes/class-kind-taxonomy.php:1481 1476 1582 #, php-format 1477 1583 msgid "All %1s" 1478 1584 msgstr "" 1479 1585 1480 #: includes/class-kind-taxonomy.php:16 471586 #: includes/class-kind-taxonomy.php:1673 1481 1587 msgid "Invalid post" 1482 1588 msgstr "" 1483 1589 1484 #: includes/class-kind-taxonomy.php:16 501590 #: includes/class-kind-taxonomy.php:1676 1485 1591 msgid "Invalid Kind" 1486 1592 msgstr "" 1487 1593 1488 #: includes/class-kind-taxonomy.php:16 701594 #: includes/class-kind-taxonomy.php:1696 1489 1595 msgid "Invalid post." 1490 1596 msgstr "" 1491 1597 1492 #: includes/class-kind-taxonomy.php:16 731598 #: includes/class-kind-taxonomy.php:1699 1493 1599 msgid "Sorry, you are not allowed to set the kind of this post." 1494 1600 msgstr "" … … 1613 1719 msgstr[1] "" 1614 1720 1721 #: includes/class-post-kind.php:181 1722 msgid "The title argument is deprecated. A kind has a title when its properties include a name field, such as Kind_Fields::title_field()." 1723 msgstr "" 1724 1615 1725 #: includes/register-kinds.php:17 1616 1726 msgid "Article" … … 1621 1731 msgstr "" 1622 1732 1623 #: includes/register-kinds.php:2 31733 #: includes/register-kinds.php:25 1624 1734 msgid "traditional long form content: a post with an explicit title and body" 1625 1735 msgstr "" 1626 1736 1627 #: includes/register-kinds.php:3 41737 #: includes/register-kinds.php:35 1628 1738 msgid "Note" 1629 1739 msgstr "" 1630 1740 1631 #: includes/register-kinds.php:3 51741 #: includes/register-kinds.php:36 1632 1742 msgid "Notes" 1633 1743 msgstr "" 1634 1744 1635 #: includes/register-kinds.php:4 01745 #: includes/register-kinds.php:41 1636 1746 msgid "short content: a post or status update with just plain content and typically without a title" 1637 1747 msgstr "" … … 1649 1759 msgstr "" 1650 1760 1651 #: includes/register-kinds.php:58 1761 #: includes/register-kinds.php:56 1762 #: includes/register-kinds.php:591 1652 1763 msgid "In Reply To" 1653 1764 msgstr "" 1654 1765 1655 #: includes/register-kinds.php:62 1766 #: includes/register-kinds.php:59 1767 msgid "a reply to content typically on another site" 1768 msgstr "" 1769 1770 #: includes/register-kinds.php:69 1771 #: includes/register-kinds.php:74 1772 msgid "Repost" 1773 msgstr "" 1774 1775 #: includes/register-kinds.php:70 1776 msgid "Reposts" 1777 msgstr "" 1778 1779 #: includes/register-kinds.php:71 1780 msgid "Reposted" 1781 msgstr "" 1782 1783 #: includes/register-kinds.php:77 1784 msgid "a complete reposting of content from another site" 1785 msgstr "" 1786 1787 #: includes/register-kinds.php:87 1788 #: includes/register-kinds.php:92 1789 msgid "Like" 1790 msgstr "" 1791 1792 #: includes/register-kinds.php:88 1793 msgid "Likes" 1794 msgstr "" 1795 1796 #: includes/register-kinds.php:89 1797 msgid "Liked" 1798 msgstr "" 1799 1800 #: includes/register-kinds.php:95 1801 msgid "a way to pay compliments to the original post/poster of external content" 1802 msgstr "" 1803 1804 #: includes/register-kinds.php:105 1805 msgid "Favorite" 1806 msgstr "" 1807 1808 #: includes/register-kinds.php:106 1809 msgid "Favorites" 1810 msgstr "" 1811 1812 #: includes/register-kinds.php:107 1813 #: includes/register-kinds.php:110 1814 msgid "Favorited" 1815 msgstr "" 1816 1817 #: includes/register-kinds.php:113 1818 msgid "special to the author" 1819 msgstr "" 1820 1821 #: includes/register-kinds.php:123 1822 #: includes/register-kinds.php:128 1823 msgid "Bookmark" 1824 msgstr "" 1825 1826 #: includes/register-kinds.php:124 1827 msgid "Bookmarks" 1828 msgstr "" 1829 1830 #: includes/register-kinds.php:125 1831 msgid "Bookmarked" 1832 msgstr "" 1833 1656 1834 #: includes/register-kinds.php:131 1657 #: includes/register-kinds.php:200 1658 #: includes/register-kinds.php:269 1835 msgid "storing a link/bookmark for personal use or sharing with others" 1836 msgstr "" 1837 1838 #: includes/register-kinds.php:141 1839 msgid "Photo" 1840 msgstr "" 1841 1842 #: includes/register-kinds.php:142 1843 msgid "Photos" 1844 msgstr "" 1845 1846 #: includes/register-kinds.php:146 1847 msgid "a post with an embedded image/photo as its primary focus" 1848 msgstr "" 1849 1850 #: includes/register-kinds.php:156 1851 msgid "Video" 1852 msgstr "" 1853 1854 #: includes/register-kinds.php:157 1855 msgid "Videos" 1856 msgstr "" 1857 1858 #: includes/register-kinds.php:161 1859 msgid "a post with an embedded video as its primary focus" 1860 msgstr "" 1861 1862 #: includes/register-kinds.php:171 1863 msgid "Audio" 1864 msgstr "" 1865 1866 #: includes/register-kinds.php:172 1867 msgid "Audios" 1868 msgstr "" 1869 1870 #: includes/register-kinds.php:176 1871 msgid "a post with an embedded audio file as its primary focus" 1872 msgstr "" 1873 1874 #: includes/register-kinds.php:186 1875 msgid "Tag" 1876 msgstr "" 1877 1878 #: includes/register-kinds.php:188 1879 msgid "Tagged" 1880 msgstr "" 1881 1882 #: includes/register-kinds.php:191 1883 msgid "allows you to tag a post as being of a specific category or tag, or for person tagging" 1884 msgstr "" 1885 1886 #: includes/register-kinds.php:202 1887 msgid "RSVPs" 1888 msgstr "" 1889 1890 #: includes/register-kinds.php:203 1891 msgid "RSVPed" 1892 msgstr "" 1893 1894 #: includes/register-kinds.php:208 1895 msgid "Event Details" 1896 msgstr "" 1897 1898 #: includes/register-kinds.php:225 1899 msgid "a specific type of reply regarding attendance of an event" 1900 msgstr "" 1901 1902 #: includes/register-kinds.php:235 1903 msgid "Listen" 1904 msgstr "" 1905 1906 #: includes/register-kinds.php:236 1907 msgid "Listens" 1908 msgstr "" 1909 1910 #: includes/register-kinds.php:237 1911 msgid "Listened" 1912 msgstr "" 1913 1914 #: includes/register-kinds.php:242 1915 msgid "Listen To" 1916 msgstr "" 1917 1918 #: includes/register-kinds.php:245 1919 #: includes/register-kinds.php:485 1920 msgid "Album" 1921 msgstr "" 1922 1923 #: includes/register-kinds.php:246 1924 #: includes/register-kinds.php:277 1925 #: includes/register-kinds.php:486 1926 msgid "Release Date" 1927 msgstr "" 1928 1929 #: includes/register-kinds.php:248 1930 #: includes/register-kinds.php:488 1931 msgid "Album Art" 1932 msgstr "" 1933 1934 #: includes/register-kinds.php:256 1935 msgid "listening to audio; sometimes called a scrobble" 1936 msgstr "" 1937 1938 #: includes/register-kinds.php:266 1939 msgid "Watch" 1940 msgstr "" 1941 1942 #: includes/register-kinds.php:267 1943 msgid "Watches" 1944 msgstr "" 1945 1946 #: includes/register-kinds.php:268 1947 msgid "Watched" 1948 msgstr "" 1949 1950 #: includes/register-kinds.php:273 1951 msgid "Watching To" 1952 msgstr "" 1953 1954 #: includes/register-kinds.php:276 1955 msgid "Series" 1956 msgstr "" 1957 1958 #: includes/register-kinds.php:279 1959 msgid "Poster" 1960 msgstr "" 1961 1962 #: includes/register-kinds.php:287 1963 msgid "watching a movie, television show, online video, play or other visual-based event" 1964 msgstr "" 1965 1966 #: includes/register-kinds.php:297 1967 msgid "Checkin" 1968 msgstr "" 1969 1970 #: includes/register-kinds.php:298 1971 msgid "Checkins" 1972 msgstr "" 1973 1974 #: includes/register-kinds.php:299 1975 msgid "Checked into" 1976 msgstr "" 1977 1978 #: includes/register-kinds.php:305 1979 msgid "Checked In" 1980 msgstr "" 1981 1982 #: includes/register-kinds.php:311 1983 msgid "identifying you are at a particular geographic location" 1984 msgstr "" 1985 1986 #: includes/register-kinds.php:321 1987 msgid "Wish" 1988 msgstr "" 1989 1990 #: includes/register-kinds.php:322 1991 msgid "Wishes" 1992 msgstr "" 1993 1994 #: includes/register-kinds.php:323 1995 msgid "Wished" 1996 msgstr "" 1997 1998 #: includes/register-kinds.php:326 1999 msgid "a post indicating a desire/wish. The archive of which would be a wishlist, such as a gift registry or similar" 2000 msgstr "" 2001 2002 #: includes/register-kinds.php:336 2003 msgid "Play" 2004 msgstr "" 2005 2006 #: includes/register-kinds.php:337 2007 msgid "Playing" 2008 msgstr "" 2009 1659 2010 #: includes/register-kinds.php:338 1660 #: includes/register-kinds.php:4811661 #: includes/register-kinds.php:5431662 #: includes/register-kinds.php:6081663 #: includes/register-kinds.php:6731664 #: templates/reply-metabox.php:561665 msgid "Name"1666 msgstr ""1667 1668 #: includes/register-kinds.php:661669 #: includes/register-kinds.php:1351670 #: includes/register-kinds.php:2041671 #: includes/register-kinds.php:2731672 2011 #: includes/register-kinds.php:342 1673 #: includes/register-kinds.php:485 1674 #: includes/register-kinds.php:547 1675 #: includes/register-kinds.php:612 2012 msgid "Played" 2013 msgstr "" 2014 2015 #: includes/register-kinds.php:348 2016 msgid "playing a game" 2017 msgstr "" 2018 2019 #: includes/register-kinds.php:358 2020 #: includes/register-kinds.php:359 2021 msgid "Weather" 2022 msgstr "" 2023 2024 #: includes/register-kinds.php:363 2025 msgid "current weather conditions" 2026 msgstr "" 2027 2028 #: includes/register-kinds.php:373 2029 #: includes/register-kinds.php:374 2030 msgid "Exercise" 2031 msgstr "" 2032 2033 #: includes/register-kinds.php:375 2034 msgid "Exercised" 2035 msgstr "" 2036 2037 #: includes/register-kinds.php:378 2038 msgid "some form of physical activity or workout (examples: walk, run, cycle, hike, yoga, etc.)" 2039 msgstr "" 2040 2041 #: includes/register-kinds.php:388 2042 msgid "Trip" 2043 msgstr "" 2044 2045 #: includes/register-kinds.php:389 2046 msgid "Trips" 2047 msgstr "" 2048 2049 #: includes/register-kinds.php:390 2050 #: includes/register-kinds.php:405 2051 msgid "Travelled" 2052 msgstr "" 2053 2054 #: includes/register-kinds.php:393 2055 msgid "represents a geographic journey" 2056 msgstr "" 2057 2058 #: includes/register-kinds.php:403 2059 msgid "Itinerary" 2060 msgstr "" 2061 2062 #: includes/register-kinds.php:404 2063 msgid "Itineraries" 2064 msgstr "" 2065 2066 #: includes/register-kinds.php:408 2067 msgid "parts of a scheduled trip including transit by car, plane, train, etc." 2068 msgstr "" 2069 2070 #: includes/register-kinds.php:419 2071 #: includes/register-kinds.php:420 2072 msgid "Eat" 2073 msgstr "" 2074 2075 #: includes/register-kinds.php:421 2076 #: includes/register-kinds.php:424 2077 msgid "Ate" 2078 msgstr "" 2079 2080 #: includes/register-kinds.php:428 2081 msgid "what you are eating, perhaps for a food diary" 2082 msgstr "" 2083 2084 #: includes/register-kinds.php:439 2085 msgid "Drink" 2086 msgstr "" 2087 2088 #: includes/register-kinds.php:440 2089 msgid "Drinks" 2090 msgstr "" 2091 2092 #: includes/register-kinds.php:441 2093 #: includes/register-kinds.php:444 2094 msgid "Drank" 2095 msgstr "" 2096 2097 #: includes/register-kinds.php:448 2098 msgid "what you are drinking, perhaps for a food dairy" 2099 msgstr "" 2100 2101 #: includes/register-kinds.php:459 2102 msgid "Follow" 2103 msgstr "" 2104 2105 #: includes/register-kinds.php:460 2106 msgid "Follows" 2107 msgstr "" 2108 2109 #: includes/register-kinds.php:461 2110 msgid "Followed" 2111 msgstr "" 2112 2113 #: includes/register-kinds.php:464 2114 msgid "indicating you are now following or subscribing to another person`s activities online" 2115 msgstr "" 2116 2117 #: includes/register-kinds.php:475 2118 msgid "Jam" 2119 msgstr "" 2120 2121 #: includes/register-kinds.php:476 2122 msgid "Jams" 2123 msgstr "" 2124 2125 #: includes/register-kinds.php:477 2126 #: includes/register-kinds.php:482 2127 msgid "Listened to" 2128 msgstr "" 2129 2130 #: includes/register-kinds.php:496 2131 msgid "a particularly personally meaningful song (a listen with added emphasis)" 2132 msgstr "" 2133 2134 #: includes/register-kinds.php:507 2135 #: includes/register-kinds.php:509 2136 #: includes/register-kinds.php:513 2137 msgid "Read" 2138 msgstr "" 2139 2140 #: includes/register-kinds.php:508 2141 msgid "Reads" 2142 msgstr "" 2143 2144 #: includes/register-kinds.php:520 2145 msgid "reading a book, magazine, newspaper, other physical document, or online post" 2146 msgstr "" 2147 2148 #: includes/register-kinds.php:531 2149 msgid "Quote" 2150 msgstr "" 2151 2152 #: includes/register-kinds.php:532 2153 msgid "Quotes" 2154 msgstr "" 2155 2156 #: includes/register-kinds.php:533 2157 #: includes/register-kinds.php:536 2158 msgid "Quoted" 2159 msgstr "" 2160 2161 #: includes/register-kinds.php:539 2162 msgid "quoted content" 2163 msgstr "" 2164 2165 #: includes/register-kinds.php:550 2166 msgid "Mood" 2167 msgstr "" 2168 2169 #: includes/register-kinds.php:551 2170 msgid "Moods" 2171 msgstr "" 2172 2173 #: includes/register-kinds.php:552 2174 msgid "Felt" 2175 msgstr "" 2176 2177 #: includes/register-kinds.php:555 2178 msgid "how you are feeling (example: happy, sad, indifferent, etc.)" 2179 msgstr "" 2180 2181 #: includes/register-kinds.php:566 2182 msgid "Recipe" 2183 msgstr "" 2184 2185 #: includes/register-kinds.php:567 2186 msgid "Recipes" 2187 msgstr "" 2188 2189 #: includes/register-kinds.php:568 2190 msgid "Cooked" 2191 msgstr "" 2192 2193 #: includes/register-kinds.php:574 2194 msgid "list of ingredients and directions for making food or drink" 2195 msgstr "" 2196 2197 #: includes/register-kinds.php:585 2198 msgid "Issue" 2199 msgstr "" 2200 2201 #: includes/register-kinds.php:586 2202 msgid "Issues" 2203 msgstr "" 2204 2205 #: includes/register-kinds.php:587 2206 msgid "Filed an Issue" 2207 msgstr "" 2208 2209 #: includes/register-kinds.php:594 2210 msgid "Issue is a special kind of article post that is a reply to typically some source code, though potentially anything at a source control repository." 2211 msgstr "" 2212 2213 #: includes/register-kinds.php:605 2214 msgid "Question" 2215 msgstr "" 2216 2217 #: includes/register-kinds.php:606 2218 msgid "Questions" 2219 msgstr "" 2220 2221 #: includes/register-kinds.php:607 2222 msgid "Asked a question" 2223 msgstr "" 2224 2225 #: includes/register-kinds.php:610 2226 msgid "Question is a post type for soliciting answer replies, which are then typically up/down voted by others and then displayed underneath the question post ordered by highest positive vote count rather than time ordered." 2227 msgstr "" 2228 2229 #: includes/register-kinds.php:621 2230 msgid "Sleep" 2231 msgstr "" 2232 2233 #: includes/register-kinds.php:622 2234 msgid "Sleeps" 2235 msgstr "" 2236 2237 #: includes/register-kinds.php:623 2238 msgid "Slept" 2239 msgstr "" 2240 2241 #: includes/register-kinds.php:626 2242 msgid "Sleep is a passive metrics post type that indicates how much time (and often a graph of how deeply) a person has slept." 2243 msgstr "" 2244 2245 #: includes/register-kinds.php:637 2246 msgid "Event" 2247 msgstr "" 2248 2249 #: includes/register-kinds.php:638 2250 msgid "Events" 2251 msgstr "" 2252 2253 #: includes/register-kinds.php:639 2254 msgid "Planned" 2255 msgstr "" 2256 2257 #: includes/register-kinds.php:645 2258 msgid "An event is a type of post that in addition to a post name (event title) has a start datetime (likely end datetime), and a location." 2259 msgstr "" 2260 2261 #: includes/register-kinds.php:655 2262 msgid "Review" 2263 msgstr "" 2264 2265 #: includes/register-kinds.php:656 2266 msgid "Reviews" 2267 msgstr "" 2268 2269 #: includes/register-kinds.php:657 2270 #: includes/register-kinds.php:660 2271 msgid "Reviewed" 2272 msgstr "" 2273 2274 #: includes/register-kinds.php:664 2275 msgid "A review is a post evaluating a product or service, usually involving a written description, sometimes with summary numerical evaluations, also known as just a rating." 2276 msgstr "" 2277 2278 #: includes/register-kinds.php:675 2279 msgid "Acquisition" 2280 msgstr "" 2281 2282 #: includes/register-kinds.php:676 2283 msgid "Acquisitions" 2284 msgstr "" 2285 1676 2286 #: includes/register-kinds.php:677 1677 #: templates/reply-metabox.php:501678 msgid "URL"1679 msgstr ""1680 1681 #: includes/register-kinds.php:701682 #: includes/register-kinds.php:1391683 #: includes/register-kinds.php:2081684 #: includes/register-kinds.php:2771685 #: includes/register-kinds.php:3461686 #: templates/reply-author.php:201687 #: templates/reply-metabox.php:451688 msgid "Author"1689 msgstr ""1690 1691 #: includes/register-kinds.php:771692 #: includes/register-kinds.php:1461693 #: includes/register-kinds.php:2151694 #: includes/register-kinds.php:2841695 #: includes/register-kinds.php:3531696 #: includes/register-kinds.php:4891697 #: includes/register-kinds.php:5581698 #: includes/register-kinds.php:6231699 msgid "Summary"1700 msgstr ""1701 1702 #: includes/register-kinds.php:811703 #: includes/register-kinds.php:1501704 #: includes/register-kinds.php:2191705 #: includes/register-kinds.php:2881706 #: includes/register-kinds.php:3571707 #: includes/register-kinds.php:4931708 msgid "Publication/Website"1709 msgstr ""1710 1711 #: includes/register-kinds.php:851712 #: includes/register-kinds.php:1541713 #: includes/register-kinds.php:2231714 #: includes/register-kinds.php:2921715 #: includes/register-kinds.php:3611716 msgid "Publish Date"1717 msgstr ""1718 1719 #: includes/register-kinds.php:891720 #: includes/register-kinds.php:1581721 #: includes/register-kinds.php:2271722 #: includes/register-kinds.php:2961723 #: includes/register-kinds.php:3651724 msgid "Updated Time"1725 msgstr ""1726 1727 #: includes/register-kinds.php:931728 #: includes/register-kinds.php:1621729 #: includes/register-kinds.php:2311730 #: includes/register-kinds.php:3001731 #: includes/register-kinds.php:3691732 #: includes/register-kinds.php:4451733 #: includes/register-kinds.php:5051734 #: includes/register-kinds.php:5701735 #: includes/register-kinds.php:6351736 msgid "Tags"1737 msgstr ""1738 1739 #: includes/register-kinds.php:1001740 #: includes/register-kinds.php:1691741 #: includes/register-kinds.php:2381742 #: includes/register-kinds.php:3071743 #: includes/register-kinds.php:3761744 #: includes/register-kinds.php:5121745 msgid "Featured Media"1746 msgstr ""1747 1748 #: includes/register-kinds.php:1091749 msgid "a reply to content typically on another site"1750 msgstr ""1751 1752 #: includes/register-kinds.php:1201753 #: includes/register-kinds.php:1271754 msgid "Repost"1755 msgstr ""1756 1757 #: includes/register-kinds.php:1211758 msgid "Reposts"1759 msgstr ""1760 1761 #: includes/register-kinds.php:1221762 msgid "Reposted"1763 msgstr ""1764 1765 #: includes/register-kinds.php:1781766 msgid "a complete reposting of content from another site"1767 msgstr ""1768 1769 #: includes/register-kinds.php:1891770 #: includes/register-kinds.php:1961771 msgid "Like"1772 msgstr ""1773 1774 #: includes/register-kinds.php:1901775 msgid "Likes"1776 msgstr ""1777 1778 #: includes/register-kinds.php:1911779 msgid "Liked"1780 msgstr ""1781 1782 #: includes/register-kinds.php:2471783 msgid "a way to pay compliments to the original post/poster of external content"1784 msgstr ""1785 1786 #: includes/register-kinds.php:2581787 msgid "Favorite"1788 msgstr ""1789 1790 #: includes/register-kinds.php:2591791 msgid "Favorites"1792 msgstr ""1793 1794 #: includes/register-kinds.php:2601795 #: includes/register-kinds.php:2651796 msgid "Favorited"1797 msgstr ""1798 1799 #: includes/register-kinds.php:3161800 msgid "special to the author"1801 msgstr ""1802 1803 #: includes/register-kinds.php:3271804 #: includes/register-kinds.php:3341805 msgid "Bookmark"1806 msgstr ""1807 1808 #: includes/register-kinds.php:3281809 msgid "Bookmarks"1810 msgstr ""1811 1812 #: includes/register-kinds.php:3291813 msgid "Bookmarked"1814 msgstr ""1815 1816 #: includes/register-kinds.php:3851817 msgid "storing a link/bookmark for personal use or sharing with others"1818 msgstr ""1819 1820 #: includes/register-kinds.php:3961821 msgid "Photo"1822 msgstr ""1823 1824 #: includes/register-kinds.php:3971825 msgid "Photos"1826 msgstr ""1827 1828 #: includes/register-kinds.php:4011829 msgid "a post with an embedded image/photo as its primary focus"1830 msgstr ""1831 1832 #: includes/register-kinds.php:4121833 msgid "Video"1834 msgstr ""1835 1836 #: includes/register-kinds.php:4131837 msgid "Videos"1838 msgstr ""1839 1840 #: includes/register-kinds.php:4171841 msgid "a post with an embedded video as its primary focus"1842 msgstr ""1843 1844 #: includes/register-kinds.php:4281845 msgid "Audio"1846 msgstr ""1847 1848 #: includes/register-kinds.php:4291849 msgid "Audios"1850 msgstr ""1851 1852 #: includes/register-kinds.php:4331853 msgid "a post with an embedded audio file as its primary focus"1854 msgstr ""1855 1856 #: includes/register-kinds.php:4441857 msgid "Tag"1858 msgstr ""1859 1860 #: includes/register-kinds.php:4461861 msgid "Tagged"1862 msgstr ""1863 1864 #: includes/register-kinds.php:4491865 msgid "allows you to tag a post as being of a specific category or tag, or for person tagging"1866 msgstr ""1867 1868 #: includes/register-kinds.php:4611869 msgid "RSVPs"1870 msgstr ""1871 1872 #: includes/register-kinds.php:4621873 msgid "RSVPed"1874 msgstr ""1875 1876 #: includes/register-kinds.php:4771877 msgid "Event Details"1878 msgstr ""1879 1880 #: includes/register-kinds.php:4971881 msgid "Start Date"1882 msgstr ""1883 1884 #: includes/register-kinds.php:5011885 msgid "End Date"1886 msgstr ""1887 1888 #: includes/register-kinds.php:5211889 msgid "a specific type of reply regarding attendance of an event"1890 msgstr ""1891 1892 #: includes/register-kinds.php:5321893 msgid "Listen"1894 msgstr ""1895 1896 #: includes/register-kinds.php:5331897 msgid "Listens"1898 msgstr ""1899 1900 #: includes/register-kinds.php:5341901 msgid "Listened"1902 msgstr ""1903 1904 #: includes/register-kinds.php:5391905 msgid "Listen To"1906 msgstr ""1907 1908 #: includes/register-kinds.php:5621909 msgid "Album"1910 msgstr ""1911 1912 #: includes/register-kinds.php:5661913 #: includes/register-kinds.php:6311914 msgid "Release Date"1915 msgstr ""1916 1917 #: includes/register-kinds.php:5771918 msgid "Album Art"1919 msgstr ""1920 1921 #: includes/register-kinds.php:5861922 msgid "listening to audio; sometimes called a scrobble"1923 msgstr ""1924 1925 #: includes/register-kinds.php:5971926 msgid "Watch"1927 msgstr ""1928 1929 #: includes/register-kinds.php:5981930 msgid "Watches"1931 msgstr ""1932 1933 #: includes/register-kinds.php:5991934 msgid "Watched"1935 msgstr ""1936 1937 #: includes/register-kinds.php:6041938 msgid "Watching To"1939 msgstr ""1940 1941 #: includes/register-kinds.php:6271942 msgid "Series"1943 msgstr ""1944 1945 #: includes/register-kinds.php:6421946 msgid "Poster"1947 msgstr ""1948 1949 #: includes/register-kinds.php:6511950 msgid "watching a movie, television show, online video, play or other visual-based event"1951 msgstr ""1952 1953 #: includes/register-kinds.php:6621954 msgid "Checkin"1955 msgstr ""1956 1957 #: includes/register-kinds.php:6631958 msgid "Checkins"1959 msgstr ""1960 1961 #: includes/register-kinds.php:6641962 msgid "Checked into"1963 msgstr ""1964 1965 #: includes/register-kinds.php:6691966 msgid "Checked In"1967 msgstr ""1968 1969 #: includes/register-kinds.php:6811970 msgid "Latitude"1971 msgstr ""1972 1973 #: includes/register-kinds.php:6891974 msgid "Longitude"1975 msgstr ""1976 1977 #: includes/register-kinds.php:6971978 msgid "Street Address"1979 msgstr ""1980 1981 #: includes/register-kinds.php:7011982 msgid "Locality"1983 msgstr ""1984 1985 #: includes/register-kinds.php:7051986 msgid "Region"1987 msgstr ""1988 1989 #: includes/register-kinds.php:7091990 msgid "Country Name"1991 msgstr ""1992 1993 #: includes/register-kinds.php:7131994 msgid "Postal Code"1995 msgstr ""1996 1997 #: includes/register-kinds.php:7191998 msgid "identifying you are at a particular geographic location"1999 msgstr ""2000 2001 #: includes/register-kinds.php:7302002 msgid "Wish"2003 msgstr ""2004 2005 #: includes/register-kinds.php:7312006 msgid "Wishes"2007 msgstr ""2008 2009 #: includes/register-kinds.php:7322010 msgid "Wished"2011 msgstr ""2012 2013 #: includes/register-kinds.php:7352014 msgid "a post indicating a desire/wish. The archive of which would be a wishlist, such as a gift registry or similar"2015 msgstr ""2016 2017 #: includes/register-kinds.php:7462018 msgid "Play"2019 msgstr ""2020 2021 #: includes/register-kinds.php:7472022 msgid "Playing"2023 msgstr ""2024 2025 #: includes/register-kinds.php:7482026 msgid "Played"2027 msgstr ""2028 2029 #: includes/register-kinds.php:7512030 msgid "playing a game"2031 msgstr ""2032 2033 #: includes/register-kinds.php:7622034 #: includes/register-kinds.php:7632035 msgid "Weather"2036 msgstr ""2037 2038 #: includes/register-kinds.php:7672039 msgid "current weather conditions"2040 msgstr ""2041 2042 #: includes/register-kinds.php:7782043 #: includes/register-kinds.php:7792044 msgid "Exercise"2045 msgstr ""2046 2047 #: includes/register-kinds.php:7802048 msgid "Exercised"2049 msgstr ""2050 2051 #: includes/register-kinds.php:7832052 msgid "some form of physical activity or workout (examples: walk, run, cycle, hike, yoga, etc.)"2053 msgstr ""2054 2055 #: includes/register-kinds.php:7942056 msgid "Trip"2057 msgstr ""2058 2059 #: includes/register-kinds.php:7952060 msgid "Trips"2061 msgstr ""2062 2063 #: includes/register-kinds.php:7962064 #: includes/register-kinds.php:8122065 msgid "Travelled"2066 msgstr ""2067 2068 #: includes/register-kinds.php:7992069 msgid "represents a geographic journey"2070 msgstr ""2071 2072 #: includes/register-kinds.php:8102073 msgid "Itinerary"2074 msgstr ""2075 2076 #: includes/register-kinds.php:8112077 msgid "Itineraries"2078 msgstr ""2079 2080 #: includes/register-kinds.php:8152081 msgid "parts of a scheduled trip including transit by car, plane, train, etc."2082 msgstr ""2083 2084 #: includes/register-kinds.php:8272085 #: includes/register-kinds.php:8282086 msgid "Eat"2087 msgstr ""2088 2089 #: includes/register-kinds.php:8292090 msgid "Ate"2091 msgstr ""2092 2093 #: includes/register-kinds.php:8322094 msgid "what you are eating, perhaps for a food diary"2095 msgstr ""2096 2097 #: includes/register-kinds.php:8442098 msgid "Drink"2099 msgstr ""2100 2101 #: includes/register-kinds.php:8452102 msgid "Drinks"2103 msgstr ""2104 2105 #: includes/register-kinds.php:8462106 msgid "Drank"2107 msgstr ""2108 2109 #: includes/register-kinds.php:8492110 msgid "what you are drinking, perhaps for a food dairy"2111 msgstr ""2112 2113 #: includes/register-kinds.php:8612114 msgid "Follow"2115 msgstr ""2116 2117 #: includes/register-kinds.php:8622118 msgid "Follows"2119 msgstr ""2120 2121 #: includes/register-kinds.php:8632122 msgid "Followed"2123 msgstr ""2124 2125 #: includes/register-kinds.php:8662126 msgid "indicating you are now following or subscribing to another person`s activities online"2127 msgstr ""2128 2129 #: includes/register-kinds.php:8782130 msgid "Jam"2131 msgstr ""2132 2133 #: includes/register-kinds.php:8792134 msgid "Jams"2135 msgstr ""2136 2137 #: includes/register-kinds.php:8802138 msgid "Listened to"2139 msgstr ""2140 2141 #: includes/register-kinds.php:8832142 msgid "a particularly personally meaningful song (a listen with added emphasis)"2143 msgstr ""2144 2145 #: includes/register-kinds.php:8952146 #: includes/register-kinds.php:8972147 msgid "Read"2148 msgstr ""2149 2150 #: includes/register-kinds.php:8962151 msgid "Reads"2152 msgstr ""2153 2154 #: includes/register-kinds.php:9002155 msgid "reading a book, magazine, newspaper, other physical document, or online post"2156 msgstr ""2157 2158 #: includes/register-kinds.php:9122159 msgid "Quote"2160 msgstr ""2161 2162 #: includes/register-kinds.php:9132163 msgid "Quotes"2164 msgstr ""2165 2166 #: includes/register-kinds.php:9142167 msgid "Quoted"2168 msgstr ""2169 2170 #: includes/register-kinds.php:9172171 msgid "quoted content"2172 msgstr ""2173 2174 #: includes/register-kinds.php:9292175 msgid "Mood"2176 msgstr ""2177 2178 #: includes/register-kinds.php:9302179 msgid "Moods"2180 msgstr ""2181 2182 #: includes/register-kinds.php:9312183 msgid "Felt"2184 msgstr ""2185 2186 #: includes/register-kinds.php:9342187 msgid "how you are feeling (example: happy, sad, indifferent, etc.)"2188 msgstr ""2189 2190 #: includes/register-kinds.php:9462191 msgid "Recipe"2192 msgstr ""2193 2194 #: includes/register-kinds.php:9472195 msgid "Recipes"2196 msgstr ""2197 2198 #: includes/register-kinds.php:9482199 msgid "Cooked"2200 msgstr ""2201 2202 #: includes/register-kinds.php:9512203 msgid "list of ingredients and directions for making food or drink"2204 msgstr ""2205 2206 #: includes/register-kinds.php:9632207 msgid "Issue"2208 msgstr ""2209 2210 #: includes/register-kinds.php:9642211 msgid "Issues"2212 msgstr ""2213 2214 #: includes/register-kinds.php:9652215 msgid "Filed an Issue"2216 msgstr ""2217 2218 #: includes/register-kinds.php:9682219 msgid "Issue is a special kind of article post that is a reply to typically some source code, though potentially anything at a source control repository."2220 msgstr ""2221 2222 #: includes/register-kinds.php:9802223 msgid "Question"2224 msgstr ""2225 2226 #: includes/register-kinds.php:9812227 msgid "Questions"2228 msgstr ""2229 2230 #: includes/register-kinds.php:9822231 msgid "Asked a question"2232 msgstr ""2233 2234 #: includes/register-kinds.php:9852235 msgid "Question is a post type for soliciting answer replies, which are then typically up/down voted by others and then displayed underneath the question post ordered by highest positive vote count rather than time ordered."2236 msgstr ""2237 2238 #: includes/register-kinds.php:9972239 msgid "Sleep"2240 msgstr ""2241 2242 #: includes/register-kinds.php:9982243 msgid "Sleeps"2244 msgstr ""2245 2246 #: includes/register-kinds.php:9992247 msgid "Slept"2248 msgstr ""2249 2250 #: includes/register-kinds.php:10022251 msgid "Sleep is a passive metrics post type that indicates how much time (and often a graph of how deeply) a person has slept."2252 msgstr ""2253 2254 #: includes/register-kinds.php:10142255 msgid "Event"2256 msgstr ""2257 2258 #: includes/register-kinds.php:10152259 msgid "Events"2260 msgstr ""2261 2262 #: includes/register-kinds.php:10162263 msgid "Planned"2264 msgstr ""2265 2266 #: includes/register-kinds.php:10192267 msgid "An event is a type of post that in addition to a post name (event title) has a start datetime (likely end datetime), and a location."2268 msgstr ""2269 2270 #: includes/register-kinds.php:10302271 msgid "Review"2272 msgstr ""2273 2274 #: includes/register-kinds.php:10312275 msgid "Reviews"2276 msgstr ""2277 2278 #: includes/register-kinds.php:10322279 msgid "Reviewed"2280 msgstr ""2281 2282 #: includes/register-kinds.php:10352283 msgid "A review is a post evaluating a product or service, usually involving a written description, sometimes with summary numerical evaluations, also known as just a rating."2284 msgstr ""2285 2286 #: includes/register-kinds.php:10472287 msgid "Acquisition"2288 msgstr ""2289 2290 #: includes/register-kinds.php:10482291 msgid "Acquisitions"2292 msgstr ""2293 2294 #: includes/register-kinds.php:10492295 2287 msgid "Acquired" 2296 2288 msgstr "" 2297 2289 2298 #: includes/register-kinds.php: 10522290 #: includes/register-kinds.php:680 2299 2291 msgid "Purchases, gifts, found things, or objects donated" 2300 2292 msgstr "" 2301 2293 2302 #: includes/register-kinds.php: 10632294 #: includes/register-kinds.php:690 2303 2295 msgid "Craft" 2304 2296 msgstr "" 2305 2297 2306 #: includes/register-kinds.php: 10642298 #: includes/register-kinds.php:691 2307 2299 msgid "Crafts" 2308 2300 msgstr "" 2309 2301 2310 #: includes/register-kinds.php:1065 2302 #: includes/register-kinds.php:692 2303 #: includes/register-kinds.php:695 2311 2304 msgid "Crafted" 2312 2305 msgstr "" 2313 2306 2314 #: includes/register-kinds.php: 10682307 #: includes/register-kinds.php:698 2315 2308 msgid "Activities like knitting, crocheting, cross stitch, wood working, restoration, 3d printing...the activity of building something." 2316 2309 msgstr "" … … 2388 2381 #: templates/reply-metabox.php:47 2389 2382 msgid "Clear" 2390 msgstr ""2391 2392 #: templates/reply-time.php:182393 msgid "Duration"2394 msgstr ""2395 2396 #: templates/reply-time.php:212397 msgid "Years"2398 msgstr ""2399 2400 #: templates/reply-time.php:252401 msgid "Months"2402 msgstr ""2403 2404 #: templates/reply-time.php:292405 msgid "Days"2406 msgstr ""2407 2408 #: templates/reply-time.php:352409 msgid "Hours"2410 msgstr ""2411 2412 #: templates/reply-time.php:392413 msgid "Minutes"2414 msgstr ""2415 2416 #: templates/reply-time.php:432417 msgid "Seconds"2418 2383 msgstr "" 2419 2384 -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-base.php
r3738687 r3810578 14 14 * 15 15 * Provides date ordering for feed items and sanitizers for values taken from 16 * remote documents. The limit_* sanitizers are derived from the Press This17 * code thatwas removed from WordPress core.16 * remote documents. limit_string() is derived from the Press This code that 17 * was removed from WordPress core. 18 18 * 19 19 * @since 1.0.0 … … 109 109 110 110 /** 111 * Limits an array to 100 values.112 *113 * Originally 50, raised because some sites are very detailed in their meta.114 *115 * @since 1.0.0116 *117 * @param array $value Array to limit.118 * @return array The first 100 values of $value, or an empty array if $value is119 * not an array.120 */121 protected static function limit_array( $value ) {122 if ( is_array( $value ) ) {123 if ( count( $value ) > 100 ) {124 return array_slice( $value, 0, 100 );125 }126 127 return $value;128 }129 130 return array();131 }132 133 /**134 111 * Sanitizes a string and limits it to 5,000 characters. 135 112 * … … 159 136 160 137 /** 161 * Validates a URL, resolves it against the source URL, and limits its length.162 *163 * @since 1.0.0164 *165 * @param string $url URL to check.166 * @param string $source_url URL of the document, used to resolve relative URLs.167 * @return string The absolute URL passed through esc_url_raw() (http and https168 * only), or an empty string if it is not a string, longer than169 * 2,048 characters, or invalid.170 */171 protected static function limit_url( $url, $source_url ) {172 if ( ! is_string( $url ) ) {173 return '';174 }175 176 // HTTP 1.1 allows 8000 chars but the "de-facto" standard supported in all current browsers is 2048.177 if ( strlen( $url ) > 2048 ) {178 return ''; // Return empty rather than a truncated/invalid URL.179 }180 181 // Does not look like a URL.182 if ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) {183 return '';184 }185 186 $url = pt_make_absolute_url( $url, $source_url );187 188 return esc_url_raw( $url, array( 'http', 'https' ) );189 }190 191 /**192 * Filters out image URLs that are unlikely to be content images.193 *194 * Excludes ad images, share buttons, loaders and spinners, spacers,195 * thumbnails, WordPress interface, theme and plugin images, tracking pixels196 * and the WordPress.com stats image.197 *198 * @since 1.0.0199 *200 * @param string $src Image source URL.201 * @param string $source_url URL of the document, used to resolve relative URLs.202 * @return string The image URL, or an empty string if it is excluded.203 */204 protected static function limit_img( $src, $source_url ) {205 $src = self::limit_url( $src, $source_url );206 207 if ( preg_match( '!/ad[sx]?/!i', $src ) ) {208 // Ads.209 return '';210 } elseif ( preg_match( '!(/share-?this[^.]+?\.[a-z0-9]{3,4})(\?.*)?$!i', $src ) ) {211 // Share-this type button.212 return '';213 } elseif ( preg_match( '!/(spinner|loading|spacer|blank|rss)\.(gif|jpg|png)!i', $src ) ) {214 // Loaders, spinners, spacers.215 return '';216 } elseif ( preg_match( '!/([^./]+[-_])?(spinner|loading|spacer|blank)s?([-_][^./]+)?\.[a-z0-9]{3,4}!i', $src ) ) {217 // Fancy loaders, spinners, spacers.218 return '';219 } elseif ( preg_match( '!([^./]+[-_])?thumb[^.]*\.(gif|jpg|png)$!i', $src ) ) {220 // Thumbnails, too small, usually irrelevant to context.221 return '';222 } elseif ( false !== stripos( $src, '/wp-includes/' ) ) {223 // Classic WordPress interface images.224 return '';225 } elseif ( false !== stripos( $src, '/wp-content/themes' ) ) {226 // Anything within a WordPress theme directory.227 return '';228 } elseif ( false !== stripos( $src, '/wp-content/plugins' ) ) {229 // Anything within a WordPress plugin directory.230 return '';231 } elseif ( preg_match( '![^\d]\d{1,2}x\d+\.(gif|jpg|png)$!i', $src ) ) {232 // Most often tiny buttons/thumbs (< 100px wide).233 return '';234 } elseif ( preg_match( '!/pixel\.(mathtag|quantserve)\.com!i', $src ) ) {235 // Tracking pixels (mathtag.com, quantserve.com); see https://www.quantcast.com/how-we-do-it/iab-standard-measurement/how-we-collect-data/ for details.236 return '';237 } elseif ( preg_match( '!/[gb]\.gif(\?.+)?$!i', $src ) ) {238 // WordPress.com stats gif.239 return '';240 }241 /**242 * Filters an image URL after the built-in exclusions have been applied.243 *244 * Return an empty string to exclude the image.245 *246 * @since 1.0.0247 *248 * @param string $src Absolute image URL that passed the built-in checks, or an249 * empty string if the URL was invalid.250 */251 return apply_filters( 'parse_this_img_filters', $src );252 }253 254 /**255 * Converts an embed URL into the canonical URL of what it embeds.256 *257 * YouTube, Vimeo, Daily Motion and Vine (now defunct) player URLs are258 * rewritten to their watch-page form. Any other URL is kept only if it259 * matches a registered oEmbed provider.260 *261 * @since 1.0.0262 *263 * @param string $src Embed source URL.264 * @param string $source_url URL of the document, used to resolve relative URLs.265 * @return string The canonical URL, or an empty string if no provider matches.266 */267 protected static function limit_embed( $src, $source_url ) {268 $src = self::limit_url( $src, $source_url );269 270 if ( empty( $src ) ) {271 return '';272 }273 274 if ( preg_match( '!//(m|www)\.youtube\.com/(embed|v)/([^?]+)\?.+$!i', $src, $src_matches ) ) {275 // Embedded Youtube videos (www or mobile).276 $src = 'https://www.youtube.com/watch?v=' . $src_matches[3];277 } elseif ( preg_match( '!//player\.vimeo\.com/video/([\d]+)([?/].*)?$!i', $src, $src_matches ) ) {278 // Embedded Vimeo iframe videos.279 $src = 'https://vimeo.com/' . (int) $src_matches[1];280 } elseif ( preg_match( '!//vimeo\.com/moogaloop\.swf\?clip_id=([\d]+)$!i', $src, $src_matches ) ) {281 // Embedded Vimeo Flash videos.282 $src = 'https://vimeo.com/' . (int) $src_matches[1];283 } elseif ( preg_match( '!//vine\.co/v/([^/]+)/embed!i', $src, $src_matches ) ) {284 // Embedded Vine videos. Vine shut down in 2017; kept for old links.285 $src = 'https://vine.co/v/' . $src_matches[1];286 } elseif ( preg_match( '!//(www\.)?dailymotion\.com/embed/video/([^/?]+)([/?].+)?!i', $src, $src_matches ) ) {287 // Embedded Daily Motion videos.288 $src = 'https://www.dailymotion.com/video/' . $src_matches[2];289 } else {290 $oembed = _wp_oembed_get_object();291 292 if ( ! $oembed->get_provider(293 $src,294 array(295 'discover' => false,296 )297 ) ) {298 $src = '';299 }300 }301 302 return $src;303 }304 305 /**306 138 * Adds a value to an array key, turning the key into a list on repeats. 307 139 * -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-discovery.php
r3738687 r3810578 295 295 'type' => 'card', 296 296 ); 297 if ( wp_http_validate_url( $jf2['author'] ) ) {297 if ( pt_is_http_url( $jf2['author'] ) ) { 298 298 $author['url'] = $jf2['author']; 299 299 } else { -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-html.php
r3738687 r3810578 97 97 $src = $video->getAttribute( 'src' ); 98 98 if ( ! empty( $src ) ) { 99 $videos[] = $src;99 $videos[] = pt_make_absolute_url( $src, $url ); 100 100 } 101 101 } … … 110 110 $src = $audio->getAttribute( 'src' ); 111 111 if ( ! empty( $src ) ) { 112 $audios[] = $src;112 $audios[] = pt_make_absolute_url( $src, $url ); 113 113 } 114 114 } … … 117 117 $src = $audio->getAttribute( 'data-audio-url' ); 118 118 if ( ! empty( $src ) ) { 119 $audios[] = $src;119 $audios[] = pt_make_absolute_url( $src, $url ); 120 120 } 121 121 } 122 122 $jf2['audio'] = array_unique( $audios ); 123 123 } 124 125 /*126 For now do not search every link embed etc127 // Fetch and gather <iframe> data.128 $embeds = array();129 130 foreach ( $xpath->query( '//iframe[@src]' ) as $embed ) {131 $src = self::limit_embed( $embed->getAttribute( 'src' ), $url );132 if ( ! empty( $src ) ) {133 $embeds[] = $src;134 }135 }136 137 // Fetch and gather <img> data.138 $images = array();139 foreach ( $xpath->query( '//img[@src]' ) as $image ) {140 $src = self::limit_img( $image->getAttribute( 'src' ), $url );141 if ( ! empty( $src ) ) {142 $images[] = $src;143 }144 }145 $images = array_unique( $images );146 147 // Fetch and gather <link> data.148 $links = array();149 150 foreach ( $xpath->query( '//link[@rel and @href]' ) as $link ) {151 $rel = $link->getAttribute( 'rel' );152 $url = self::limit_url( $link->getAttribute( 'href' ), $url );153 if ( ! empty( $url ) ) {154 $links[ $rel ] = $url;155 }156 }157 158 $video_extensions = array(159 'mp4',160 'mkv',161 'webm',162 'ogv',163 'avi',164 'm4v',165 'mpg',166 );167 $audio_extensions = array(168 'mp3',169 'ogg',170 'm4a',171 'm4b',172 'flac',173 'aac',174 );175 $urls = array();176 foreach ( $xpath->query( '//a' ) as $link ) {177 $u = pt_make_absolute_url( $link->getAttribute( 'href' ), $url );178 $urls[] = wp_http_validate_url( $u );179 $extension = pathinfo( wp_parse_url( $url, PHP_URL_PATH ), PATHINFO_EXTENSION );180 if ( in_array( $extension, $audio_extensions, true ) ) {181 $audios[] = $url;182 }183 if ( in_array( $extension, $video_extensions, true ) ) {184 $videos[] = $url;185 }186 }187 */188 124 189 125 if ( ! empty( $args['debug'] ) ) { … … 201 137 * 202 138 * @since 1.0.0 139 * @since 2.0.1 Parse.ly tags are trimmed, article:modified_time becomes 140 * updated rather than modified, and Dublin Core names (DC., 141 * dc. and DCTERMS.) are matched in any case. 203 142 * 204 143 * @param array $meta Meta values as grouped by parse_meta(), keyed by prefix … … 269 208 $modified = $meta['article']['modified_time'] ?? $meta['article']['modified'] ?? null; 270 209 if ( $modified ) { 271 $jf2[' modified'] = normalize_iso8601( $modified );210 $jf2['updated'] = normalize_iso8601( $modified ); 272 211 } 273 212 $jf2['category'] = $meta['article']['tag'] ?? null; … … 314 253 } 315 254 } 316 if ( isset( $meta['dc'] ) ) { 317 $dc = $meta['dc']; 318 if ( isset( $dc['Title'] ) ) { 319 $jf2['name'] = $dc['Title']; 320 } 321 if ( isset( $dc['Creator'] ) ) { 322 if ( is_string( $dc['Creator'] ) ) { 323 $jf2['author'] = $dc['Creator']; 255 // Dublin Core: DC.title, dc.title, DCTERMS.title and so on, in any case. 256 $dc = array(); 257 foreach ( $meta as $prefix => $values ) { 258 if ( is_array( $values ) && in_array( strtolower( (string) $prefix ), array( 'dc', 'dcterms' ), true ) ) { 259 foreach ( $values as $key => $value ) { 260 $dc += array( strtolower( (string) $key ) => $value ); 261 } 262 } 263 } 264 if ( $dc ) { 265 if ( isset( $dc['title'] ) ) { 266 $jf2['name'] = $dc['title']; 267 } 268 if ( isset( $dc['creator'] ) ) { 269 if ( is_string( $dc['creator'] ) ) { 270 $jf2['author'] = $dc['creator']; 324 271 } else { 325 272 $jf2['author'] = array(); 326 foreach ( $dc[' Creator'] as $creator ) {273 foreach ( $dc['creator'] as $creator ) { 327 274 $jf2['author'][] = array( 328 275 'type' => 'card', … … 332 279 } 333 280 } 334 if ( isset( $dc['Description'] ) ) { 335 $jf2['summary'] = $dc['Description']; 336 } 337 if ( isset( $dc['Date'] ) && ! isset( $jf2['published'] ) ) { 338 $jf2['published'] = normalize_iso8601( $dc['Date'] ); 281 if ( isset( $dc['description'] ) ) { 282 $jf2['summary'] = $dc['description']; 283 } 284 $date = $dc['date'] ?? ( $dc['issued'] ?? ( $dc['created'] ?? null ) ); 285 if ( $date && ! isset( $jf2['published'] ) ) { 286 $jf2['published'] = normalize_iso8601( $date ); 339 287 } 340 288 } … … 365 313 366 314 if ( empty( $jf2['category'] ) && isset( $meta['parsely-tags'] ) ) { 367 if ( is_array( $meta['parsely-tags'] ) ) { 368 $jf2['category'] = $meta['parsely-tags']; 369 } else { 370 $jf2['category'] = explode( ',', $meta['parsely-tags'] ); 371 } 315 $tags = is_array( $meta['parsely-tags'] ) ? $meta['parsely-tags'] : explode( ',', $meta['parsely-tags'] ); 316 $jf2['category'] = array_values( array_filter( array_map( 'trim', array_filter( $tags, 'is_string' ) ), 'strlen' ) ); 372 317 } 373 318 -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-jsonld.php
r3738687 r3810578 210 210 if ( ! array_key_exists( 'author', $return ) && array_key_exists( 'person', $jf2 ) ) { 211 211 $return['author'] = $jf2['person']; 212 }213 if ( ! array_key_exists( 'publication', $return ) && array_key_exists( 'publisher', $jf2 ) ) {214 $return['publication'] = $jf2['publisher'];215 212 } 216 213 return array_filter( $return, array( __CLASS__, 'is_set' ) ); … … 538 535 * Converts a MusicRelease node into a jf2 cite. 539 536 * 540 * @since 1.0.0 537 * The artists (releaseOf.byArtist, one or a list) become a list of cards 538 * in author. 539 * 540 * @since 1.0.0 541 * @since 2.0.1 Artists are cards rather than one-item lists, and a single 542 * byArtist object is accepted. 541 543 * 542 544 * @param array $music MusicRelease node. … … 559 561 'featured' => self::image_to_photo( $music['image'] ?? null ), 560 562 ); 561 if ( isset( $music['releaseOf'] ) ) { 562 if ( isset( $music['releaseOf']['byArtist'] ) ) { 563 $return['author'] = array(); 564 foreach ( $music['releaseOf']['byArtist'] as $artist ) { 565 $return['author'][] = array( 566 array_filter( 567 array( 568 'type' => 'card', 569 'name' => $artist['name'] ?? null, 570 'url' => $artist['@id'] ?? null, 571 ) 572 ), 573 ); 563 if ( isset( $music['releaseOf']['byArtist'] ) ) { 564 // One artist or a list of them; each becomes a card. 565 $artists = $music['releaseOf']['byArtist']; 566 if ( ! is_array( $artists ) || ! wp_is_numeric_array( $artists ) ) { 567 $artists = array( $artists ); 568 } 569 $return['author'] = array(); 570 foreach ( $artists as $artist ) { 571 if ( is_string( $artist ) ) { 572 $artist = array( 'name' => $artist ); 573 } 574 if ( ! is_array( $artist ) ) { 575 continue; 576 } 577 $card = array_filter( 578 array( 579 'name' => $artist['name'] ?? null, 580 'url' => $artist['url'] ?? ( $artist['@id'] ?? null ), 581 ), 582 'is_string' 583 ); 584 if ( $card ) { 585 $return['author'][] = array( 'type' => 'card' ) + $card; 574 586 } 575 587 } … … 630 642 * Converts an Event node into a jf2 event. 631 643 * 632 * @since 1.0.0 644 * The organizer may be an Organization or a Person. 645 * 646 * @since 1.0.0 647 * @since 2.0.1 Accepts a Person as organizer. 633 648 * 634 649 * @param array $event Event or BusinessEvent node. … … 644 659 'url' => $event['url'] ?? null, 645 660 'summary' => $event['description'] ?? null, 646 'organizer' => self:: organization_to_hcard( $event['organizer'] ?? null ),661 'organizer' => self::person_to_hcard( $event['organizer'] ?? null ), 647 662 'location' => self::place_to_hcard( $event['location'] ?? null ), 648 663 'start' => normalize_iso8601( $event['startDate'] ?? null ), … … 658 673 * Returns the URL of an ImageObject. 659 674 * 660 * For a list, the last image is used. 661 * 662 * @since 1.0.0 675 * For a list, the last image is used. The URL is taken from url, then 676 * contentUrl, then @id. 677 * 678 * @since 1.0.0 679 * @since 2.0.1 Falls back to contentUrl and @id when there is no url. 663 680 * 664 681 * @param array|string|mixed $image ImageObject node, list of nodes, or URL. 665 * @return string|false The image URL, or false if $image is not an image. 682 * @return string|false The image URL, or false if $image is not an image or 683 * has no URL. 666 684 */ 667 685 public static function image_to_photo( $image ) { … … 686 704 * } 687 705 */ 688 return $image['url']; 706 foreach ( array( 'url', 'contentUrl', '@id' ) as $key ) { 707 if ( isset( $image[ $key ] ) && is_string( $image[ $key ] ) && '' !== trim( $image[ $key ] ) ) { 708 return trim( $image[ $key ] ); 709 } 710 } 711 return false; 689 712 } 690 713 … … 693 716 * 694 717 * @since 1.0.0 718 * @since 2.0.1 The transcript's plain text is content.text, not content.value. 695 719 * 696 720 * @param array|string $audio AudioObject node, or a URL. … … 717 741 if ( isset( $audio['transcript'] ) ) { 718 742 $return['content'] = array( 719 'html' => Parser::clean_content( $audio['transcript'] ),720 ' value' => wp_strip_all_tags( $audio['transcript']),743 'html' => Parser::clean_content( $audio['transcript'] ), 744 'text' => trim( wp_strip_all_tags( $audio['transcript'] ) ), 721 745 ); 722 746 } … … 731 755 * 732 756 * @since 1.0.0 757 * @since 2.0.1 The transcript's plain text is content.text, not content.value. 733 758 * 734 759 * @param array|string $video VideoObject node, or a URL. … … 755 780 if ( isset( $video['transcript'] ) ) { 756 781 $return['content'] = array( 757 'html' => Parser::clean_content( $video['transcript'] ),758 ' value' => wp_strip_all_tags( $video['transcript']),782 'html' => Parser::clean_content( $video['transcript'] ), 783 'text' => trim( wp_strip_all_tags( $video['transcript'] ) ), 759 784 ); 760 785 } … … 813 838 814 839 /** 840 * Returns the card properties for a schema.org address. 841 * 842 * A PostalAddress gives its parts; plain text, which schema.org also allows, 843 * becomes the card's label. 844 * 845 * @since 2.0.1 846 * 847 * @param array|string|mixed $address PostalAddress node or text. 848 * @return array Address properties, possibly empty. 849 */ 850 private static function address_properties( $address ) { 851 if ( is_string( $address ) ) { 852 $address = trim( $address ); 853 return '' === $address ? array() : array( 'label' => $address ); 854 } 855 $parts = self::postaladdress_to_address( $address ); 856 return is_array( $parts ) ? $parts : array(); 857 } 858 859 /** 815 860 * Converts a Place node into a jf2 card. 816 861 * 817 862 * @since 1.0.0 863 * @since 2.0.1 A plain-text address is kept as the card's label. 818 864 * 819 865 * @param array|mixed $place Place node. … … 839 885 840 886 if ( isset( $place['address'] ) ) { 841 $address = self::postaladdress_to_address( $place['address'] ); 842 if ( is_array( $address ) ) { 843 $hcard = array_merge( $hcard, $address ); 844 } 887 $hcard = array_merge( $hcard, self::address_properties( $place['address'] ) ); 845 888 } 846 889 return array_filter( $hcard ); … … 927 970 * 928 971 * @since 1.0.0 972 * @since 2.0.1 A plain-text address is kept as the card's label. 929 973 * 930 974 * @param array|mixed $organization Organization, NewsMediaOrganization, NGO or … … 963 1007 } 964 1008 if ( isset( $organization['address'] ) ) { 965 $address = self::postaladdress_to_address( $organization['address'] ); 966 if ( is_array( $address ) ) { 967 $publication = array_merge( $publication, $address ); 968 } else { 969 $publication['_address'] = $address; 970 } 1009 $publication = array_merge( $publication, self::address_properties( $organization['address'] ) ); 971 1010 } 972 1011 return array_filter( $publication ); … … 1071 1110 * Converts an article or web page node into a jf2 entry. 1072 1111 * 1073 * Accepts WebPage, Article, NewsArticle and BlogPosting. 1074 * 1075 * @since 1.0.0 1112 * Accepts WebPage, Article, NewsArticle and BlogPosting. The author comes 1113 * from author, or from creator when there is no usable author. 1114 * 1115 * @since 1.0.0 1116 * @since 2.0.1 A creator no longer replaces the author, and is a single card 1117 * when there is only one. 1076 1118 * 1077 1119 * @param array|mixed $newsarticle Article node. … … 1110 1152 if ( ! is_array( $newsarticle['keywords'] ) ) { 1111 1153 $newsarticle['keywords'] = explode( ',', $newsarticle['keywords'] ); 1112 } elseif ( is_string( $newsarticle['keywords'] ) ) {1113 $newsarticle['keywords'] = array( $newsarticle['keywords'] );1114 1154 } 1115 1155 $jf2['category'] = array_map( 'trim', $newsarticle['keywords'] ); … … 1122 1162 ); 1123 1163 } 1124 if ( isset( $newsarticle['author'] ) ) { 1125 if ( ! wp_is_numeric_array( $newsarticle['author'] ) ) { 1126 $newsarticle['author'] = array( $newsarticle['author'] ); 1127 } 1128 $jf2['author'] = array(); 1129 foreach ( $newsarticle['author'] as $author ) { 1130 $jf2['author'][] = self::person_to_hcard( $author ); 1131 } 1132 $jf2['author'] = array_filter( $jf2['author'] ); 1133 if ( 0 === count( $jf2['author'] ) ) { 1134 unset( $jf2['author'] ); 1135 } elseif ( 1 === count( $jf2['author'] ) ) { 1136 $jf2['author'] = array_pop( $jf2['author'] ); 1137 } 1138 } 1139 if ( isset( $newsarticle['creator'] ) ) { 1140 if ( ! wp_is_numeric_array( $newsarticle['creator'] ) ) { 1141 $newsarticle['creator'] = array( $newsarticle['creator'] ); 1142 } 1143 $jf2['author'] = array(); 1144 foreach ( $newsarticle['creator'] as $creator ) { 1145 $jf2['author'][] = self::person_to_hcard( $creator ); 1164 // The author, or failing that the creator: one card, or a list of them. 1165 foreach ( array( 'author', 'creator' ) as $property ) { 1166 if ( isset( $jf2['author'] ) || ! isset( $newsarticle[ $property ] ) ) { 1167 continue; 1168 } 1169 $agents = $newsarticle[ $property ]; 1170 if ( ! wp_is_numeric_array( $agents ) ) { 1171 $agents = array( $agents ); 1172 } 1173 $cards = array_values( array_filter( array_map( array( __CLASS__, 'person_to_hcard' ), $agents ) ) ); 1174 if ( 1 === count( $cards ) ) { 1175 $jf2['author'] = $cards[0]; 1176 } elseif ( $cards ) { 1177 $jf2['author'] = $cards; 1146 1178 } 1147 1179 } -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-mf2.php
r3738687 r3810578 199 199 * @since 1.0.0 200 200 * @since 2.0.0 Implements steps 7.2 to 7.4 of the algorithm. Added $args. 201 * @since 2.0.1 Recognizes author URLs by their syntax, without a DNS lookup. 201 202 * 202 203 * @param array $item Microformat to find the author of. … … 219 220 return $a; 220 221 } elseif ( is_string( $a ) ) { 221 if ( wp_http_validate_url( $a ) ) {222 if ( pt_is_http_url( $a ) ) { 222 223 // 5.2 "otherwise if author property is an http(s) URL, let the author-page have that URL" 223 224 $authorpage = $a; … … 489 490 * 490 491 * The first h-card is removed from the items and used as the feed's author. 491 * If only one item remains, the document is returned with that h-card as the 492 * item's author instead. 493 * 494 * @since 1.0.0 492 * If only one item remains, the document is returned with just that item, 493 * and the h-card becomes its author if it has none of its own. 494 * 495 * @since 1.0.0 496 * @since 2.0.1 The remaining item keeps its own author, and is no longer 497 * lost when the h-card came first. 495 498 * 496 499 * @param array $input Parsed mf2 document. 497 * @return array Parsed mf2 document with one h-feed item. 500 * @return array Parsed mf2 document with one item: an h-feed, or the only 501 * item that isn't the h-card. 498 502 */ 499 503 public static function normalize_feed( $input ) { … … 506 510 } 507 511 } 512 $input['items'] = array_values( $input['items'] ); 513 $author = $hcard ? array( 'author' => array( $hcard ) ) : array(); 508 514 if ( 1 === count( $input['items'] ) ) { 509 if ( self::has_prop( $input['items'][0], 'author' ) ) {515 if ( $hcard && ! self::has_prop( $input['items'][0], 'author' ) ) { 510 516 $input['items'][0]['properties']['author'] = array( $hcard ); 511 517 } … … 516 522 array( 517 523 'type' => array( 'h-feed' ), 518 'properties' => array( 519 'author' => array( $hcard ), 520 ), 524 'properties' => $author, 521 525 'children' => $input['items'], 522 526 ), … … 1043 1047 * 1044 1048 * Microformats2 parsing is vocabulary-agnostic, so any h-* root gets the 1045 * generic properties from parse_h() and its type without the h- prefix, 1046 * as jf2 does for known types (h-org becomes org). 1047 * 1048 * @since 1.0.0 1049 * generic properties from parse_h(), every other property it has (as 1050 * get_prop_array() converts them), and its type without the h- prefix, as 1051 * jf2 does for known types (h-org becomes org, h-review-aggregate becomes 1052 * review-aggregate). 1053 * 1054 * @since 1.0.0 1055 * @since 2.0.1 Passes through all properties parse_h() doesn't read, even 1056 * ones known from other types (category, photo, rating), and 1057 * keeps items that have none of the generic properties. 1049 1058 * 1050 1059 * @param array $unknown Microformat. 1051 1060 * @param array $mf Parsed mf2 document. 1052 1061 * @param array $args Parse arguments (see Parser::parse()). 1053 * @return array jf2 with the generic properties and the type, or an empty1054 * array ifthe type isn't h-* or no properties were found.1062 * @return array jf2 with the properties and the type, or an empty array if 1063 * the type isn't h-* or no properties were found. 1055 1064 */ 1056 1065 public static function parse_hunknown( $unknown, $mf, $args ) { … … 1059 1068 return array(); 1060 1069 } 1061 // Parse unknown h property.1062 1070 $data = self::parse_h( $unknown, $mf, $args ); 1071 // parse_h() reads these, and may drop one on purpose (a name that repeats 1072 // the content), so only the rest are passed through. 1073 $generic = array( 'name', 'published', 'updated', 'url', 'author', 'content', 'summary' ); 1074 $rest = array_diff( array_keys( (array) ( $unknown['properties'] ?? array() ) ), $generic, array_keys( $data ) ); 1075 if ( $rest ) { 1076 $data = array_merge( $data, self::filter_empty( self::get_prop_array( $unknown, array_values( $rest ), $args ) ) ); 1077 } 1063 1078 if ( empty( $data ) ) { 1064 1079 return array(); … … 1074 1089 * Reads name, published, updated, url, author, content and summary, drops 1075 1090 * the name when it only repeats the start of the content (see 1076 * name_is_content_prefix()), and adds the document's rel=syndication links. 1091 * name_is_content_prefix()), and adds the document's rel=syndication links 1092 * to the item's own syndication. 1077 1093 * 1078 1094 * @since 1.0.0 1079 1095 * @since 2.0.0 Drops a name that is a prefix of the content, including a 1080 1096 * truncated one, not only one that contains all of it. 1097 * @since 2.0.1 rel=syndication links are merged with the item's own 1098 * syndication instead of replacing it. 1081 1099 * 1082 1100 * @param array $entry Microformat. … … 1108 1126 } 1109 1127 1128 // The page's rel=syndication links add to the item's own u-syndication; 1129 // callers merge this result over their own properties. 1110 1130 if ( isset( $mf['rels']['syndication'] ) ) { 1111 if ( isset( $data['syndication'] ) ) { 1112 if ( is_string( $data['syndication'] ) ) { 1113 $data['syndication'] = array( $data['syndication'] ); 1114 } 1115 $data['syndication'] = array_unique( array_merge( $data['syndication'], $mf['rels']['syndication'] ) ); 1116 } else { 1117 $data['syndication'] = $mf['rels']['syndication']; 1118 } 1131 $own = array_filter( (array) ( self::get_prop_array( $entry, array( 'syndication' ), $args )['syndication'] ?? array() ), 'is_string' ); 1132 $data['syndication'] = array_values( array_unique( array_merge( $own, $mf['rels']['syndication'] ) ) ); 1119 1133 } 1120 1134 return self::filter_empty( $data ); … … 1470 1484 $properties = array( 'category', 'item' ); 1471 1485 $data = array_merge( $data, self::get_prop_array( $entry, $properties, $args ) ); 1472 $properties = array();1473 foreach ( $properties as $p ) {1474 $v = self::get_plaintext( $entry, $p );1475 if ( null !== $v ) {1476 $data[ $p ] = $v;1477 }1478 }1479 1486 $data = array_merge( $data, self::parse_h( $entry, $mf, $args ) ); 1480 1487 return self::filter_empty( $data ); … … 1504 1511 $properties = array( 'category', 'item' ); 1505 1512 $data = array_merge( $data, self::get_prop_array( $entry, $properties, $args ) ); 1506 $properties = array();1507 foreach ( $properties as $p ) {1508 $v = self::get_plaintext( $entry, $p );1509 if ( null !== $v ) {1510 $data[ $p ] = $v;1511 }1512 }1513 1513 $data = array_merge( $data, self::parse_h( $entry, $mf, $args ) ); 1514 1514 return self::filter_empty( $data ); … … 1579 1579 $properties = array( 'category', 'item' ); 1580 1580 $data = array_merge( $data, self::get_prop_array( $item, $properties, $args ) ); 1581 $properties = array();1582 foreach ( $properties as $p ) {1583 $v = self::get_plaintext( $item, $p );1584 if ( null !== $v ) {1585 $data[ $p ] = $v;1586 }1587 }1588 1581 $data = array_merge( $data, self::parse_h( $item, $mf, $args ) ); 1589 1582 return self::filter_empty( $data ); -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-restapi.php
r3738687 r3810578 32 32 * 33 33 * @since 1.0.0 34 * @since 2.0.1 Returns null, rather than failing, when the field is not an 35 * object with a rendered value. 34 36 * 35 37 * @param string $key Field name. 36 38 * @param array $item REST API object. 37 * @return string|null The field's 'rendered' value, or null if absent. 39 * @return string|null The field's 'rendered' value, or null if absent or 40 * the field is not an object. 38 41 */ 39 42 public static function get_rendered( $key, $item ) { 40 if ( ! array_key_exists( $key, $item) ) {43 if ( ! isset( $item[ $key ] ) || ! is_array( $item[ $key ] ) ) { 41 44 return null; 42 45 } 43 if ( array_key_exists( 'rendered', $item[ $key ] ) ) { 44 return $item[ $key ]['rendered']; 45 } 46 return null; 46 return $item[ $key ]['rendered'] ?? null; 47 47 } 48 48 … … 279 279 return $return; 280 280 } else { 281 $content = self::fetch( $rest_url, '/wp/v2/posts ?_embed=1' );281 $content = self::fetch( $rest_url, '/wp/v2/posts' ); 282 282 if ( is_wp_error( $content ) || ! is_array( $content ) ) { 283 283 return $content; -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-rss.php
r3738687 r3810578 102 102 * 103 103 * @since 1.0.0 104 * @since 2.0.1 An author whose name is a single link is no longer dropped. 104 105 * 105 106 * @param SimplePie_Author|SimplePie_Author[]|null $author One author or a list. … … 129 130 if ( ! empty( $names ) ) { 130 131 if ( 1 === count( $names ) ) { 131 reset( $names ); 132 $r['name'] = key( $names ); 132 $r['name'] = (string) key( $names ); 133 $r['url'] = reset( $names ) ? reset( $names ) : $r['url']; 134 $return[] = array_filter( $r ); 133 135 } else { 134 136 foreach ( $names as $name => $url ) { -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/functions.php
r3738687 r3810578 1173 1173 } 1174 1174 } 1175 1176 if ( ! function_exists( __NAMESPACE__ . '\\pt_is_http_url' ) ) { 1177 /** 1178 * Checks whether a string is an absolute http(s) URL with a host. 1179 * 1180 * This is a syntax check only. Unlike wp_http_validate_url(), it does not 1181 * resolve the host, so it is cheap and gives the same answer whether or not 1182 * the site is reachable. Use it to decide what a value is (a URL or a 1183 * name); fetching still goes through pt_remote_get(), which rejects unsafe 1184 * hosts. 1185 * 1186 * @since 2.0.1 1187 * 1188 * @param mixed $url Value to check. 1189 * @return bool True if $url is an http or https URL with a host. 1190 */ 1191 function pt_is_http_url( $url ) { 1192 if ( ! is_string( $url ) || preg_match( '/\s/', $url ) ) { 1193 return false; 1194 } 1195 $parts = wp_parse_url( $url ); 1196 return is_array( $parts ) && ! empty( $parts['host'] ) && in_array( strtolower( $parts['scheme'] ?? '' ), array( 'http', 'https' ), true ); 1197 } 1198 } -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/DOMTreeBuilder.php
r3738687 r3810578 372 372 373 373 if (false !== $needsWorkaround) { 374 $xml = "<$lname xmlns=\" $needsWorkaround\" " . (strlen($prefix) && isset($this->nsStack[0][$prefix]) ? ("xmlns:$prefix=\"" . $this->nsStack[0][$prefix]. '"') : '') . '/>';374 $xml = "<$lname xmlns=\"" . htmlspecialchars($needsWorkaround, ENT_QUOTES | ENT_XML1, 'UTF-8') . '" ' . (strlen($prefix) && isset($this->nsStack[0][$prefix]) ? ("xmlns:$prefix=\"" . htmlspecialchars($this->nsStack[0][$prefix], ENT_QUOTES | ENT_XML1, 'UTF-8') . '"') : '') . '/>'; 375 375 376 376 $frag = new \DOMDocument('1.0', 'UTF-8'); 377 $frag->loadXML($xml); 377 $previous = libxml_use_internal_errors(true); 378 try { 379 $loaded = $frag->loadXML($xml); 380 } finally { 381 libxml_clear_errors(); 382 libxml_use_internal_errors($previous); 383 } 384 if (!$loaded || null === $frag->documentElement) { 385 throw new \DOMException('Invalid namespace declaration'); 386 } 378 387 379 388 $ele = $this->doc->importNode($frag->documentElement, true); … … 386 395 } 387 396 } catch (\DOMException $e) { 388 $this->parseError("Illegal tag name : <$lname>. Replaced with <invalid>.");397 $this->parseError("Illegal tag name or namespace: <$lname>. Replaced with <invalid>."); 389 398 $ele = $this->doc->createElement('invalid'); 390 399 } … … 672 681 return true; 673 682 } 683 684 // Stop at an ancestor whose own insertion would already have closed 685 // any open <p>. Inserting an AUTOCLOSE_P element calls autoclose('p'), 686 // which moves the insertion point above the <p>, so no <p> can still 687 // be open further up. Without this the walk runs to the document root 688 // on every block-level start tag, making deeply nested markup 689 // quadratic. Elements that are BLOCK_TAG but not AUTOCLOSE_P (table, 690 // address, canvas, dd, hr, noscript, output, tfoot) are NOT boundaries, 691 // because they nest inside a <p> without closing it. 692 if ('p' === $tagName 693 && $working !== $this->current 694 && Elements::isA($working->tagName, Elements::AUTOCLOSE_P)) { 695 return false; 696 } 674 697 } while ($working = $working->parentNode); 675 698 -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/Scanner.php
r2839509 r3810578 30 30 31 31 /** 32 * Cached byte offset, line and column of the last position lookup. 33 * 34 * Lets currentLine() and columnOffset() advance from the previous lookup 35 * instead of rescanning the input from the start for every parse error. 36 */ 37 private $posChar = 0; 38 private $posLine = 1; 39 private $posColumn = 0; 40 41 /** 32 42 * Parse errors. 33 43 */ … … 247 257 // Add one to $this->char because we want the number for the next 248 258 // byte to be processed. 249 return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1; 259 $this->advancePosition(min($this->char, $this->EOF)); 260 261 return $this->posLine; 262 } 263 264 /** 265 * Move the cached line/column forward to the given byte offset. 266 * 267 * @param int $offset 268 */ 269 private function advancePosition($offset) 270 { 271 if ($offset < $this->posChar) { 272 $this->posChar = 0; 273 $this->posLine = 1; 274 $this->posColumn = 0; 275 } 276 277 $segment = substr($this->data, $this->posChar, $offset - $this->posChar); 278 $this->posChar = $offset; 279 280 $lastNewline = strrpos($segment, "\n"); 281 if (false === $lastNewline) { 282 $this->posColumn += UTF8Utils::countChars($segment); 283 } else { 284 $this->posLine += substr_count($segment, "\n"); 285 $this->posColumn = UTF8Utils::countChars(substr($segment, $lastNewline + 1)); 286 } 250 287 } 251 288 … … 288 325 } 289 326 290 // strrpos is weird, and the offset needs to be negative for what we 291 // want (i.e., the last \n before $this->char). This needs to not have 292 // one (to make it point to the next character, the one we want the 293 // position of) added to it because strrpos's behaviour includes the 294 // final offset byte. 295 $backwardFrom = $this->char - 1 - strlen($this->data); 296 $lastLine = strrpos($this->data, "\n", $backwardFrom); 297 298 // However, for here we want the length up until the next byte to be 299 // processed, so add one to the current byte ($this->char). 300 if (false !== $lastLine) { 301 $findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine); 302 } else { 303 // After a newline. 304 $findLengthOf = substr($this->data, 0, $this->char); 305 } 306 307 return UTF8Utils::countChars($findLengthOf); 327 $this->advancePosition($this->char); 328 329 return $this->posColumn; 308 330 } 309 331 -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/Tokenizer.php
r3738687 r3810578 568 568 protected function quotedAttributeValue($quote) 569 569 { 570 $stoplist = "\f" .$quote;570 $stoplist = $quote; 571 571 $val = ''; 572 572 -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/UTF8Utils.php
r3738687 r3810578 28 28 */ 29 29 30 use Masterminds\HTML5\Exception;31 32 30 class UTF8Utils 33 31 { … … 39 37 /** 40 38 * Count the number of characters in a string. 41 * UTF-8 aware. This will try (in order) iconv, MB, and finally a custom counter.39 * UTF-8 aware. 42 40 * 43 41 * @param string $string … … 47 45 public static function countChars($string) 48 46 { 49 // Get the length for the string we need. 50 if (function_exists('mb_strlen')) { 51 return mb_strlen($string, 'utf-8'); 52 } 53 54 if (function_exists('iconv_strlen')) { 55 return iconv_strlen($string, 'utf-8'); 56 } 57 58 $count = count_chars($string); 59 60 // 0x80 = 0x7F - 0 + 1 (one added to get inclusive range) 61 // 0x33 = 0xF4 - 0x2C + 1 (one added to get inclusive range) 62 return array_sum(array_slice($count, 0, 0x80)) + array_sum(array_slice($count, 0xC2, 0x33)); 47 return mb_strlen($string, 'utf-8'); 63 48 } 64 49 … … 89 74 // which contains links to the actual but reports as well as work around 90 75 // details. 91 if (function_exists('mb_convert_encoding')) {92 // mb library has the following behaviors:93 // - UTF-16 surrogates result in false.94 // - Overlongs and outside Plane 16 result in empty strings.76 // 77 // mb library has the following behaviors: 78 // - UTF-16 surrogates result in false. 79 // - Overlongs and outside Plane 16 result in empty strings. 95 80 96 // Before we run mb_convert_encoding we need to tell it what to do with 97 // characters it does not know. This could be different than the parent 98 // application executing this library so we store the value, change it 99 // to our needs, and then change it back when we are done. This feels 100 // a little excessive and it would be great if there was a better way. 101 $save = mb_substitute_character(); 102 mb_substitute_character('none'); 103 $data = mb_convert_encoding($data, 'UTF-8', $encoding); 104 mb_substitute_character($save); 105 } 106 // @todo Get iconv running in at least some environments if that is possible. 107 elseif (function_exists('iconv') && 'auto' !== $encoding) { 108 // fprintf(STDOUT, "iconv found\n"); 109 // iconv has the following behaviors: 110 // - Overlong representations are ignored. 111 // - Beyond Plane 16 is replaced with a lower char. 112 // - Incomplete sequences generate a warning. 113 $data = @iconv($encoding, 'UTF-8//IGNORE', $data); 114 } else { 115 throw new Exception('Not implemented, please install mbstring or iconv'); 116 } 81 // Before we run mb_convert_encoding we need to tell it what to do with 82 // characters it does not know. This could be different than the parent 83 // application executing this library so we store the value, change it 84 // to our needs, and then change it back when we are done. This feels 85 // a little excessive and it would be great if there was a better way. 86 $save = mb_substitute_character(); 87 mb_substitute_character(0xFFFD); 88 $data = mb_convert_encoding($data, 'UTF-8', $encoding); 89 mb_substitute_character($save); 117 90 118 91 /* -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Serializer/OutputRules.php
r3738687 r3810578 279 279 } 280 280 281 /** 282 * Write an entity reference node. 283 * 284 * Such a node carries the entity name only: its nodeValue is null and its 285 * textContent is empty, so it cannot go through text(). saveXML() gives 286 * back the reference as it was written, which is what DOMDocument does. 287 * 288 * @param \DOMEntityReference $ele The entity reference to write. 289 */ 290 public function entityReference($ele) 291 { 292 $this->wr($ele->ownerDocument->saveXML($ele)); 293 } 294 281 295 public function processorInstruction($ele) 282 296 { … … 301 315 foreach ($this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele) as $nsNode) { 302 316 if (!in_array($nsNode->nodeValue, $this->implicitNamespaces)) { 303 $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($ nsNode->nodeValue)->wr('"');317 $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($this->enc((string) $nsNode->nodeValue, true))->wr('"'); 304 318 } 305 319 } -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Serializer/Traverser.php
r2110745 r3810578 105 105 $this->rules->comment($node); 106 106 break; 107 case XML_ENTITY_REF_NODE: 108 // entityReference() is not on RulesInterface, so a custom rules 109 // implementation keeps the previous behaviour of skipping the node 110 // rather than fataling on a missing method. 111 if ($this->rules instanceof OutputRules) { 112 $this->rules->entityReference($node); 113 } 114 break; 107 115 // Currently we don't support embedding DTDs. 108 116 default: -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/mf2/Parser.php
r3738687 r3810578 64 64 */ 65 65 function fetch($url, $convertClassic = true, &$curlInfo=null) { 66 $version = '0'; 67 if (is_array($curl = curl_version())) { 68 $version = $curl['version']; 69 } 70 66 71 $ch = curl_init(); 67 72 curl_setopt($ch, CURLOPT_URL, $url); … … 70 75 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 71 76 curl_setopt($ch, CURLOPT_MAXREDIRS, 5); 77 78 if (version_compare($version, '7.21.6', '>=')) { 79 // see https://curl.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html 80 curl_setopt($ch, CURLOPT_ACCEPT_ENCODING, ''); 81 } elseif (version_compare($version, '7.10.5', '>=')) { 82 // see https://curl.se/ch/7.10.5.html 83 curl_setopt($ch, CURLOPT_ENCODING, ''); 84 } 85 72 86 curl_setopt($ch, CURLOPT_HTTPHEADER, array( 73 87 'Accept: text/html' 74 88 )); 75 89 $html = curl_exec($ch); 90 91 if ($html === false) { 92 return null; 93 } 94 76 95 $info = $curlInfo = curl_getinfo($ch); 77 curl_close($ch); 96 if (PHP_VERSION_ID < 80000) { 97 curl_close($ch); 98 } 78 99 79 100 if (strpos(strtolower($info['content_type']), 'html') === false) { … … 94 115 */ 95 116 function unicodeToHtmlEntities($input) { 96 return mb_convert_encoding($input, 'HTML-ENTITIES', mb_detect_encoding($input)); 117 // Convert all non-ASCII characters to HTML numeric entities. 118 $convmap = [ 119 0x80, 0x1FFFFF, 0, 0x10FFFF, 120 ]; 121 122 return mb_encode_numericentity($input, $convmap, mb_detect_encoding($input), true); 97 123 } 98 124 … … 112 138 113 139 function unicodeTrim($str) { 114 // this is cheating. TODO: find a better way if this causes any problems 115 $str = str_replace(mb_convert_encoding(' ', 'UTF-8', 'HTML-ENTITIES'), ' ', $str); 116 $str = preg_replace('/^\s+/', '', $str); 117 return preg_replace('/\s+$/', '', $str); 140 return preg_replace('/^\s+|\s+$/u', '', $str); 118 141 } 119 142 … … 146 169 147 170 /** 171 * Registered with the XPath object and used within XPaths for finding root elements. 172 * @param string $class 173 * @return bool 174 */ 175 function classHasMf2RootClassname($class) { 176 return count(mfNamesFromClass($class, 'h-')) > 0; 177 } 178 179 /** 148 180 * Get Nested µf Property Name From Class 149 181 * … … 158 190 $propertyNames = array(); 159 191 160 $class = str_replace(array(' ', ' ', "\n"), ' ', $class); 161 foreach (explode(' ', $class) as $classname) { 162 foreach ($prefixes as $prefix) { 163 // Check if $classname is a valid property classname for $prefix. 164 if (mb_substr($classname, 0, mb_strlen($prefix)) == $prefix && $classname != $prefix) { 165 $propertyName = mb_substr($classname, mb_strlen($prefix)); 166 $propertyNames[$propertyName][] = $prefix; 167 } 192 foreach ($prefixes as $prefix) { 193 $classes = mfNamesFromClass($class, $prefix); 194 foreach ($classes as $property) { 195 $propertyNames[$property][] = $prefix; 168 196 } 169 197 } … … 356 384 */ 357 385 public function __construct($input, $url = null, $jsonMode = false) { 386 $emptyDocDefault = '<html><body></body></html>'; 358 387 libxml_use_internal_errors(true); 359 388 if (is_string($input)) { 389 if (empty($input)) { 390 $input = $emptyDocDefault; 391 } 392 360 393 if (class_exists('Masterminds\\HTML5')) { 361 394 $doc = new \Masterminds\HTML5(array('disable_html_ns' => true)); … … 369 402 } else { 370 403 $doc = new DOMDocument(); 371 @$doc->loadHTML(''); 372 } 373 404 @$doc->loadHTML($emptyDocDefault); 405 } 406 407 // Create an XPath object and allow some PHP functions to be used within XPath queries. 374 408 $this->xpath = new DOMXPath($doc); 409 $this->xpath->registerNamespace('php', 'http://php.net/xpath'); 410 $this->xpath->registerPhpFunctions('\\Mf2\\classHasMf2RootClassname'); 375 411 376 412 $baseurl = $url; … … 405 441 406 442 private function elementPrefixParsed(\DOMElement $e, $prefix) { 407 if (!$this->parsed-> contains($e))408 $this->parsed-> attach($e, array());443 if (!$this->parsed->offsetExists($e)) 444 $this->parsed->offsetSet($e, array()); 409 445 410 446 $prefixes = $this->parsed[$e]; … … 420 456 */ 421 457 private function isElementParsed(\DOMElement $e, $prefix) { 422 if (!$this->parsed-> contains($e)) {458 if (!$this->parsed->offsetExists($e)) { 423 459 return false; 424 460 } … … 440 476 */ 441 477 private function isElementUpgraded(\DOMElement $el, $property) { 442 if ( $this->upgraded-> contains($el) ) {478 if ( $this->upgraded->offsetExists($el) ) { 443 479 if ( in_array($property, $this->upgraded[$el]) ) { 444 480 return true; … … 586 622 */ 587 623 public function parseValueClassTitle(\DOMElement $e, $separator = '') { 588 $valueClassElements = $this->xpath->query('./*[contains(concat(" ", @class, " "), " value ")]', $e);624 $valueClassElements = $this->xpath->query('./*[contains(concat(" ", normalize-space(@class), " "), " value ")]', $e); 589 625 590 626 if ($valueClassElements->length !== 0) { … … 598 634 } 599 635 600 $valueTitleElements = $this->xpath->query('./*[contains(concat(" ", @class, " "), " value-title ")]', $e);636 $valueTitleElements = $this->xpath->query('./*[contains(concat(" ", normalize-space(@class), " "), " value-title ")]', $e); 601 637 602 638 if ($valueTitleElements->length !== 0) { … … 686 722 public function parseDT(\DOMElement $dt, &$dates = array(), &$impliedTimezone = null) { 687 723 // Check for value-class pattern 688 $valueClassChildren = $this->xpath->query('./*[contains(concat(" ", @class, " "), " value ") or contains(concat(" ", @class, " "), " value-title ")]', $dt);724 $valueClassChildren = $this->xpath->query('./*[contains(concat(" ", normalize-space(@class), " "), " value ") or contains(concat(" ", normalize-space(@class), " "), " value-title ")]', $dt); 689 725 $dtValue = false; 690 726 … … 938 974 public function parseH(\DOMElement $e, $is_backcompat = false, $has_nested_mf = false) { 939 975 // If it’s already been parsed (e.g. is a child mf), skip 940 if ($this->parsed-> contains($e)) {976 if ($this->parsed->offsetExists($e)) { 941 977 return null; 942 978 } … … 962 998 963 999 // Handle p-* 964 foreach ($this->xpath->query('.//*[contains(concat(" ", @class) ," p-")]', $e) as $p) {1000 foreach ($this->xpath->query('.//*[contains(concat(" ", normalize-space(@class)) ," p-")]', $e) as $p) { 965 1001 // element is already parsed 966 1002 if ($this->isElementParsed($p, 'p')) { … … 987 1023 988 1024 // Handle u-* 989 foreach ($this->xpath->query('.//*[contains(concat(" ", @class)," u-")]', $e) as $u) {1025 foreach ($this->xpath->query('.//*[contains(concat(" ", normalize-space(@class))," u-")]', $e) as $u) { 990 1026 // element is already parsed 991 1027 if ($this->isElementParsed($u, 'u')) { … … 1012 1048 1013 1049 // Handle dt-* 1014 foreach ($this->xpath->query('.//*[contains(concat(" ", @class), " dt-")]', $e) as $dt) {1050 foreach ($this->xpath->query('.//*[contains(concat(" ", normalize-space(@class)), " dt-")]', $e) as $dt) { 1015 1051 // element is already parsed 1016 1052 if ($this->isElementParsed($dt, 'dt')) { … … 1047 1083 1048 1084 // Handle e-* 1049 foreach ($this->xpath->query('.//*[contains(concat(" ", @class)," e-")]', $e) as $em) {1085 foreach ($this->xpath->query('.//*[contains(concat(" ", normalize-space(@class))," e-")]', $e) as $em) { 1050 1086 // element is already parsed 1051 1087 if ($this->isElementParsed($em, 'e')) { … … 1165 1201 'properties' => $return 1166 1202 ); 1167 1203 1168 1204 if(trim($e->getAttribute('id')) !== '') { 1169 1205 $parsed['id'] = trim($e->getAttribute("id")); … … 1507 1543 // start with mf2 root class name xpath 1508 1544 $xpaths = array( 1509 ' contains(concat(" ",normalize-space(@class)), " h-")'1545 '(php:function("\\Mf2\\classHasMf2RootClassname", normalize-space(@class)))' 1510 1546 ); 1511 1547 … … 1562 1598 break; 1563 1599 1600 case 'hfeed': 1601 $this->upgradeRelTagToCategory($el); 1602 break; 1603 1604 case 'hproduct': 1605 $review_and_hreview_aggregate = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " review ") and contains(concat(" ", normalize-space(@class), " "), " hreview-aggregate ")]', $el); 1606 1607 if ( $review_and_hreview_aggregate->length ) { 1608 foreach ( $review_and_hreview_aggregate as $tempEl ) { 1609 if ( !$this->hasRootMf2($tempEl) ) { 1610 $this->backcompat($tempEl, 'hreview-aggregate'); 1611 $this->addMfClasses($tempEl, 'p-review h-review-aggregate'); 1612 $this->addUpgraded($tempEl, array('review hreview-aggregate')); 1613 } 1614 } 1615 } 1616 1617 $review_and_hreview = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " review ") and contains(concat(" ", normalize-space(@class), " "), " hreview ")]', $el); 1618 1619 if ( $review_and_hreview->length ) { 1620 foreach ( $review_and_hreview as $tempEl ) { 1621 if ( !$this->hasRootMf2($tempEl) ) { 1622 $this->backcompat($tempEl, 'hreview'); 1623 $this->addMfClasses($tempEl, 'p-review h-review'); 1624 $this->addUpgraded($tempEl, array('review hreview')); 1625 } 1626 } 1627 } 1628 1629 break; 1630 1631 case 'hreview-aggregate': 1564 1632 case 'hreview': 1565 1633 $item_and_vcard = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " item ") and contains(concat(" ", normalize-space(@class), " "), " vcard ")]', $el); … … 1593 1661 if ( !$this->hasRootMf2($tempEl) ) { 1594 1662 $this->addMfClasses($tempEl, 'p-item h-product'); 1595 $this->backcompat($tempEl, ' vevent');1663 $this->backcompat($tempEl, 'hproduct'); 1596 1664 $this->addUpgraded($tempEl, array('item', 'hproduct')); 1597 1665 } … … 1599 1667 } 1600 1668 1669 $rel_self_bookmark = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@rel), " "), " self ") and contains(concat(" ", normalize-space(@rel), " "), " bookmark ")]', $el); 1670 1671 if ( $rel_self_bookmark->length ) { 1672 foreach ( $rel_self_bookmark as $tempEl ) { 1673 $this->addMfClasses($tempEl, 'u-url'); 1674 $this->addUpgraded($tempEl, array('self', 'bookmark')); 1675 } 1676 } 1677 1678 $reviewer_nodes = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " reviewer ")]', $el); 1679 1680 if ( $reviewer_nodes->length ) { 1681 foreach ( $reviewer_nodes as $tempEl ) { 1682 if ( !$this->hasRootMf2($tempEl) ) { 1683 $this->addMfClasses($tempEl, 'p-author h-card'); 1684 } 1685 } 1686 } 1687 1601 1688 $this->upgradeRelTagToCategory($el); 1602 1689 break; 1603 1690 1604 1691 case 'vevent': 1605 $location = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " location")]', $el);1606 1607 if ( $location ->length ) {1608 foreach ( $location as $tempEl ) {1692 $location_and_vcard = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " location ") and contains(concat(" ", normalize-space(@class), " "), " vcard ")]', $el); 1693 1694 if ( $location_and_vcard->length ) { 1695 foreach ( $location_and_vcard as $tempEl ) { 1609 1696 if ( !$this->hasRootMf2($tempEl) ) { 1610 $this->addMfClasses($tempEl, ' h-card');1697 $this->addMfClasses($tempEl, 'p-location h-card'); 1611 1698 $this->backcompat($tempEl, 'vcard'); 1699 $this->addUpgraded($tempEl, array('location', 'vcard')); 1612 1700 } 1613 1701 } … … 1658 1746 1659 1747 // add element to list of upgraded elements 1660 if ( !$this->upgraded-> contains($el) ) {1661 $this->upgraded-> attach($el, $property);1748 if ( !$this->upgraded->offsetExists($el) ) { 1749 $this->upgraded->offsetSet($el, $property); 1662 1750 } else { 1663 1751 $this->upgraded[$el] = array_merge($this->upgraded[$el], $property); … … 1688 1776 public function hasRootMf2(\DOMElement $el) { 1689 1777 $class = str_replace(array("\t", "\n"), ' ', $el->getAttribute('class')); 1690 $classes = array_filter(explode(' ', $class)); 1691 1692 foreach ( $classes as $classname ) { 1693 if ( strpos($classname, 'h-') === 0 ) { 1694 return true; 1695 } 1696 } 1697 1698 return false; 1778 1779 // Check for valid mf2 root classnames, not just any classname with a h- prefix. 1780 return count(mfNamesFromClass($class, 'h-')) > 0; 1699 1781 } 1700 1782 … … 1713 1795 // replace all roots 1714 1796 foreach ($this->classicRootMap as $old => $new) { 1715 foreach ($xp->query('//*[contains(concat(" ", @class, " "), " ' . $old . ' ") and not(contains(concat(" ", @class, " "), " ' . $new . ' "))]') as $el) {1797 foreach ($xp->query('//*[contains(concat(" ", normalize-space(@class), " "), " ' . $old . ' ") and not(contains(concat(" ", normalize-space(@class), " "), " ' . $new . ' "))]') as $el) { 1716 1798 $el->setAttribute('class', $el->getAttribute('class') . ' ' . $new); 1717 1799 } … … 1721 1803 $newRoot = $this->classicRootMap[$oldRoot]; 1722 1804 foreach ($properties as $old => $data) { 1723 foreach ($xp->query('//*[contains(concat(" ", @class, " "), " ' . $oldRoot . ' ")]//*[contains(concat(" ", @class, " "), " ' . $old . ' ") and not(contains(concat(" ", @class, " "), " ' . $data['replace'] . ' "))]') as $el) {1805 foreach ($xp->query('//*[contains(concat(" ", normalize-space(@class), " "), " ' . $oldRoot . ' ")]//*[contains(concat(" ", normalize-space(@class), " "), " ' . $old . ' ") and not(contains(concat(" ", normalize-space(@class), " "), " ' . $data['replace'] . ' "))]') as $el) { 1724 1806 $el->setAttribute('class', $el->getAttribute('class') . ' ' . $data['replace']); 1725 1807 } … … 1756 1838 'vevent' => 'h-event', 1757 1839 'hreview' => 'h-review', 1840 'hreview-aggregate' => 'h-review-aggregate', 1758 1841 'hproduct' => 'h-product', 1759 1842 'adr' => 'h-adr', 1843 'geo' => 'h-geo' 1760 1844 ); 1761 1845 … … 1874 1958 ), 1875 1959 'hfeed' => array( 1876 # nothing currently 1960 'author' => array( 1961 'replace' => 'p-author h-card', 1962 'context' => 'vcard' 1963 ), 1964 'url' => array( 1965 'replace' => 'u-url' 1966 ), 1967 'photo' => array( 1968 'replace' => 'u-photo' 1969 ), 1970 'category' => array( 1971 'replace' => 'p-category' 1972 ), 1877 1973 ), 1878 1974 'hentry' => array( … … 1984 2080 ), 1985 2081 'location' => array( 1986 'replace' => 'h-card', 1987 'context' => 'vcard' 2082 'replace' => 'p-location', 1988 2083 ), 1989 2084 'geo' => array( 1990 2085 'replace' => 'p-location h-geo' 1991 2086 ), 2087 'attendee' => array( 2088 'replace' => 'p-attendee h-card', 2089 'context' => 'vcard' 2090 ) 1992 2091 ), 1993 2092 'hreview' => array( … … 2002 2101 'context' => 'item' 2003 2102 ), 2004 'reviewer' => array( 2005 'replace' => 'p-author h-card', 2006 'context' => 'vcard', 2007 ), 2103 # reviewer: see backcompat() 2008 2104 'dtreviewed' => array( 2009 2105 'replace' => 'dt-published' … … 2023 2119 'category' => array( 2024 2120 'replace' => 'p-category' 2121 ), 2122 ), 2123 'hreview-aggregate' => array( 2124 'summary' => array( 2125 'replace' => 'p-name' 2126 ), 2127 # fn: see item.fn below 2128 # photo: see item.photo below 2129 # url: see item.url below 2130 'item' => array( 2131 'replace' => 'p-item h-item', 2132 'context' => 'item' 2133 ), 2134 'rating' => array( 2135 'replace' => 'p-rating' 2136 ), 2137 'best' => array( 2138 'replace' => 'p-best' 2139 ), 2140 'worst' => array( 2141 'replace' => 'p-worst' 2142 ), 2143 'average' => array( 2144 'replace' => 'p-average' 2145 ), 2146 'count' => array( 2147 'replace' => 'p-count' 2148 ), 2149 'votes' => array( 2150 'replace' => 'p-votes' 2025 2151 ), 2026 2152 ), … … 2047 2173 'replace' => 'u-url', 2048 2174 ), 2049 'review' => array( 2050 'replace' => 'p-review h-review', 2051 ), 2175 // review is handled in the special processing section to allow for 'review hreview-aggregate' 2052 2176 'price' => array( 2053 2177 'replace' => 'p-price' -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/parse-this.php
r3738687 r3810578 4 4 * Plugin URI: https://github.com/dshanske/parse-this 5 5 * Description: Turns URLs into structured jf2 data from microformats2, JSON-LD, meta tags and RSS, Atom and JSON feeds. 6 * Version: 2.0. 06 * Version: 2.0.1 7 7 * Author: David Shanske 8 8 * Author URI: https://david.shanske.com … … 45 45 * @var string 46 46 */ 47 define( 'PARSE_THIS_VERSION', '2.0. 0' );47 define( 'PARSE_THIS_VERSION', '2.0.1' ); 48 48 } 49 49 require_once plugin_dir_path( __FILE__ ) . 'includes/autoload.php'; -
indieweb-post-kinds/tags/4.0.2/lib/parse-this/readme.txt
r3738687 r3810578 2 2 Contributors: dshanske 3 3 Tags: indieweb, microformats, jf2, json-ld, feeds 4 Stable tag: 2.0. 04 Stable tag: 2.0.1 5 5 Requires at least: 6.2 6 6 Requires PHP: 7.4 … … 88 88 89 89 * `pt_rewrite_secure`: the list of domains whose `http://` URLs are upgraded to `https://` before fetching. 90 * `parse_this_img_filters`: an image URL found in a page, after the built-in exclusions (ads, spinners, tracking pixels and so on). Return an empty string to drop it.91 90 * `parse_this_url_shorteners`: the hosts treated as link shorteners. Links to them in a summary are expanded to where they redirect; other links are left as they are, without a request. 92 91 * `parse_this_native_html_parser`: whether to parse HTML with PHP's own HTML5 parser on PHP 8.4 and later. Default true. Return false to use the bundled masterminds/html5 parser instead; the two only differ on invalid markup, where PHP's parser does what browsers do. … … 162 161 163 162 == Changelog == 163 164 = 2.0.1 ( 2026-11-18 ) = 165 166 Bug fixes and maintenance. Plugins that bundle Parse This need no changes. 167 168 * Relative `<audio>` and `<video>` URLs found by the HTML parser are now made absolute. 169 * The bundled php-mf2 is updated to 0.5.1, and masterminds/html5 (the HTML parser used before PHP 8.4) to 2.12.0. php-mf2 no longer raises PHP 8.2 and 8.5 deprecation notices while parsing (three remain on PHP 8.4+ when the file loads, fixed upstream but not yet released). It also parses classic hReview markup better: the reviewer becomes the author, and hreview-aggregate and geo are recognized. 170 * Unused and unreachable code is removed, including the `limit_array()`, `limit_url()`, `limit_img()` and `limit_embed()` helpers, a commented-out block in the HTML parser that would have scraped every image, embed and link on a page, and the `parse_this_img_filters` filter, which could no longer run. 171 * Code coverage is measured in CI, and the test suite now covers about 95% of the plugin's code. PHP 8.5 is fully supported. 172 * WordPress REST API: a feed of a site with plain permalinks no longer requests a route that doesn't exist, and a field that isn't a `{rendered}` object no longer causes a fatal error. 173 * Microformats: types Parse This has no handler for (h-review-aggregate, h-x-*) keep all their properties, including category, photo and rating; old-style hreview-aggregate markup is no longer lost. A feed request for a page with an h-card and one other item now returns that item, with the h-card as its author only if it has none. A page's `rel=syndication` links are added to an entry's own syndication instead of replacing it. Author URLs are recognized by their syntax, without a DNS lookup, so an author whose site is unreachable is no longer given its URL as a name. 174 * JSON-LD: `creator` no longer replaces `author`; plain-text addresses are kept as the card's label; an ImageObject without `url` uses `contentUrl` or `@id`; a person can organize an event; music release artists are plain cards, and a single artist is accepted; audio and video transcripts use `content.text`. 175 * Meta tags: Parse.ly tags are trimmed, `article:modified_time` becomes `updated`, and Dublin Core tags are read whatever their case (`DC.title`, `dc.title`, `DCTERMS.*`). 176 * RSS: an author whose name is a single link is no longer dropped. 164 177 165 178 = 2.0.0 ( 2026-10-03 ) = … … 222 235 == Upgrade Notice == 223 236 237 = 2.0.1 = 238 Bug fixes for the JSON-LD, microformats, meta tag, RSS and WordPress REST API parsers, and updated bundled libraries. Plugins that use Parse This need no changes. 239 224 240 = 2.0.0 = 225 241 A major update: classes and functions move to the ParseThis namespace (the old names Post Kinds and Yarns use still work), the output format changes in places, and the REST endpoint now requires the edit_posts capability. Requires PHP 7.4 and WordPress 6.2. -
indieweb-post-kinds/tags/4.0.2/readme.txt
r3771941 r3810578 2 2 Contributors: dshanske 3 3 Tags: indieweb, interaction, posts, webmention, share, like, scrobble 4 Stable tag: 4.0. 14 Stable tag: 4.0.2 5 5 Requires at least: 6.2 6 6 Requires PHP: 7.4 … … 305 305 306 306 == Changelog == 307 308 = 4.0.2 ( 2026-11-18 ) = 309 * Update the bundled Parse This to 2.0.1, with fixes to how citations are read from microformats, JSON-LD, meta tags, RSS and the WordPress REST API, and updated php-mf2 and HTML5 parsers 310 * Fix accented and non-Latin text in media metadata, such as an audio file's title or artist, being garbled when it was saved ("Café" became "Café"). Metadata already saved this way isn't repaired 311 * Fix category and tag archives linked by ID (`?cat=5`, the default on sites with plain permalinks) having an empty title and causing PHP warnings 312 * The embed template for a kind is now named after its slug (`embed-post-like.php`), so it no longer depends on the site's language. The old name (`embed-post-Like.php`) still works 313 * Fix the `tz_timezone_to_seconds()` helper, which failed on every call (a fatal error on PHP 8) 314 * Every kind shown in the editor except photo, video and audio now has a field schema (returned by the `post-kinds/1.0/fields` REST route), built from shared field sets; citations are marked required, and ratings, times and read status are optional fields. The checkin schema is a place reference (name and URL); its unused address and coordinate fields are removed. This is groundwork for editors driven by the schema 315 * Deprecate the `title` argument of `register_post_kind()`: a kind has a title when its properties include a `name` field. Passing `'title' => true` still works and adds one 316 * `Kind_Fields`, which builds editor fields from a kind's schema, now works: fields render escaped, with structured names (`mf2_in-reply-to[name]`); `rebuild_data()` reassembles submitted fields; the new `sanitize()` validates values by field type for any editor or REST client; and fields can be marked required, with `missing()` listing the empty ones. Its time zone list uses current names 317 * Code coverage is measured in CI, and the test suite now covers about 92% of the plugin's code 307 318 308 319 = 4.0.1 ( 2026-10-28 ) = -
indieweb-post-kinds/trunk/.gitattributes
r3738687 r3810578 5 5 /tests export-ignore 6 6 /bin export-ignore 7 /build export-ignore 7 8 /node_modules export-ignore 8 9 /sass export-ignore -
indieweb-post-kinds/trunk/develop.txt
r3771941 r3810578 1 Developer notes for Post Kinds 4.0. 1. Every function, method and hook listed here has a docblock in the code with its full parameters and return values.1 Developer notes for Post Kinds 4.0.2. Every function, method and hook listed here has a docblock in the code with its full parameters and return values. 2 2 3 3 == Template functions == … … 24 24 `register_post_kind( $slug, $args )` - Registers a kind. Call it on `init`. `includes/register-kinds.php` registers the built-in kinds the same way, and Kind_Taxonomy::register_post_kind() documents every argument. 25 25 `set_post_kind_visibility( $slug, $show = true )` - Shows or hides a kind in Settings, including the kinds reserved for future use. 26 27 A kind's `properties` argument is its field schema: the microformats properties an editor offers for it, keyed by property, as Kind_Fields documents. Fields are optional unless they set `'required' => true`; a kind that responds to something should make its citation required. A `name` field means the kind has a title. Kind_Fields provides the shared field sets the built-in kinds use: `cite_field()` (with overrides to relabel, remove or add citation fields), `title_field()`, `rating_field()`, `rsvp_field()`, `read_status_field()` and `time_fields()`. `Kind_Fields::sanitize()` and `Kind_Fields::missing()` sanitize submitted values and list the required fields that are empty. 26 28 27 29 == Time functions == … … 122 124 * Since 4.0.0, the global functions `display_formatted_datetime()`, `divide_datetime()`, `build_datetime()`, `get_datetime_offset()`, `divide_interval()` and `build_interval()`. Use the Kind_Time methods of the same names. They will be removed in 5.0.0. 123 125 * Since 4.0.0, the `MF2_Post` class. Use Kind_Post. It will be removed in a future major version. 126 * Since 4.0.2, the `title` argument of `register_post_kind()`. Add a `name` field to the kind's properties instead, such as `Kind_Fields::title_field()`. `'title' => true` still adds one, and `Post_Kind::$title` reflects whether the properties have a name field. 124 127 125 128 == Styling icons == … … 132 135 133 136 To change a view, copy it into a `kind_views` folder in your theme and edit the copy. If a child theme has a `kind_views` folder, it is used instead of the parent theme's; the two aren't combined. For each post, the plugin looks for `kind-{slug}.php` in your theme and then in the plugin, and only then for `kind.php` in the same order. So a theme `kind.php` replaces only the kinds that have no view of their own. The `kind_view_paths` filter changes which folders are searched before the plugin's. 137 138 When a post is embedded on another site (WordPress post embeds), a theme can style each kind with an `embed-{post_type}-{slug}.php` template, such as `embed-post-like.php`. Before 4.0.2 the template was named after the kind's translated name (`embed-post-Like.php`); that name still works, after the slug. 134 139 135 140 Copies don't receive updates. After upgrading, compare them with the plugin's views. Since 4.0.0, views escape everything they print, and the `Kind_View` helpers return escaped markup. -
indieweb-post-kinds/trunk/includes/class-kind-fields.php
r3738687 r3810578 12 12 * Generates form fields for the posting UI from a kind's property schema. 13 13 * 14 * Supported field types and their options: 14 * The schemas are editor-agnostic: the same field definitions (exposed by 15 * the post-kinds/1.0/fields REST route) can drive the Classic Editor, a block 16 * editor UI or another editor. The field_*() methods render them as HTML for 17 * the Classic Editor. 18 * 19 * A field definition has a 'type' and a 'label'; other keys depend on the type. 20 * Supported types, one for each field_*() method: 21 * - text, textarea, url 22 * - number: `step` (default 1). 23 * - select: `options`, an associative array of value => label. 24 * - list: values separated by semicolons. 15 25 * - datetime 16 * - duration 17 * - author: a name, URL and photo by default. 18 * - select: `options` is an associative array of value => label. 19 * - url 20 * - text 21 * - list 22 * - textarea 23 * - number 24 * - cite: an h-cite object. 26 * - duration: `pieces`, which of Y, M, D, H, I (minutes) and S to show. Default H, I and S. 27 * - author: a name, URL and photo. 28 * - cite, venue: nested fields in `properties`. 29 * 30 * Any other type is treated as text. Any field can have `required` set to 31 * true; fields are optional otherwise. See missing(). 25 32 * 26 33 * @since 3.3.4 … … 31 38 * Returns a list of time zones with translated labels. 32 39 * 33 * @since 3.3.4 40 * Only time zones the host's time zone database knows are listed. 41 * 42 * @since 3.3.4 43 * @since 4.0.2 Uses current identifiers, and leaves out unknown ones. 34 44 * 35 45 * @return string[] Labels, keyed by time zone identifier. 36 46 */ 37 47 public static function timezone_list() { 38 returnarray(48 $zones = array( 39 49 'Pacific/Niue' => __( '(GMT-11:00) Niue', 'indieweb-post-kinds' ), 40 50 'Pacific/Pago_Pago' => __( '(GMT-11:00) Pago Pago', 'indieweb-post-kinds' ), … … 109 119 'America/Cayenne' => __( '(GMT-03:00) Cayenne', 'indieweb-post-kinds' ), 110 120 'America/Fortaleza' => __( '(GMT-03:00) Fortaleza', 'indieweb-post-kinds' ), 111 'America/ Godthab' => __( '(GMT-03:00) Godthab', 'indieweb-post-kinds' ),121 'America/Nuuk' => __( '(GMT-02:00) Nuuk', 'indieweb-post-kinds' ), 112 122 'America/Maceio' => __( '(GMT-03:00) Maceio', 'indieweb-post-kinds' ), 113 123 'America/Miquelon' => __( '(GMT-03:00) Miquelon', 'indieweb-post-kinds' ), … … 182 192 'Europe/Istanbul' => __( '(GMT+02:00) Istanbul', 'indieweb-post-kinds' ), 183 193 'Europe/Kaliningrad' => __( '(GMT+02:00) Moscow-01 - Kaliningrad', 'indieweb-post-kinds' ), 184 'Europe/K iev' => __( '(GMT+02:00) Kiev', 'indieweb-post-kinds' ),194 'Europe/Kyiv' => __( '(GMT+02:00) Kyiv', 'indieweb-post-kinds' ), 185 195 'Europe/Riga' => __( '(GMT+02:00) Riga', 'indieweb-post-kinds' ), 186 196 'Europe/Sofia' => __( '(GMT+02:00) Sofia', 'indieweb-post-kinds' ), … … 215 225 'Indian/Kerguelen' => __( '(GMT+05:00) Kerguelen', 'indieweb-post-kinds' ), 216 226 'Indian/Maldives' => __( '(GMT+05:00) Maldives', 'indieweb-post-kinds' ), 217 'Asia/ Calcutta'=> __( '(GMT+05:30) India Standard Time', 'indieweb-post-kinds' ),227 'Asia/Kolkata' => __( '(GMT+05:30) India Standard Time', 'indieweb-post-kinds' ), 218 228 'Asia/Colombo' => __( '(GMT+05:30) Colombo', 'indieweb-post-kinds' ), 219 'Asia/Kat mandu' => __( '(GMT+05:45) Katmandu', 'indieweb-post-kinds' ),229 'Asia/Kathmandu' => __( '(GMT+05:45) Kathmandu', 'indieweb-post-kinds' ), 220 230 'Antarctica/Vostok' => __( '(GMT+06:00) Vostok', 'indieweb-post-kinds' ), 221 231 'Asia/Almaty' => __( '(GMT+06:00) Almaty', 'indieweb-post-kinds' ), … … 225 235 'Asia/Thimphu' => __( '(GMT+06:00) Thimphu', 'indieweb-post-kinds' ), 226 236 'Indian/Chagos' => __( '(GMT+06:00) Chagos', 'indieweb-post-kinds' ), 227 'Asia/ Rangoon' => __( '(GMT+06:30) Rangoon', 'indieweb-post-kinds' ),237 'Asia/Yangon' => __( '(GMT+06:30) Yangon', 'indieweb-post-kinds' ), 228 238 'Indian/Cocos' => __( '(GMT+06:30) Cocos', 'indieweb-post-kinds' ), 229 239 'Antarctica/Davis' => __( '(GMT+07:00) Davis', 'indieweb-post-kinds' ), … … 232 242 'Asia/Jakarta' => __( '(GMT+07:00) Jakarta', 'indieweb-post-kinds' ), 233 243 'Asia/Krasnoyarsk' => __( '(GMT+07:00) Moscow+04 - Krasnoyarsk', 'indieweb-post-kinds' ), 234 'Asia/Saigon' => __( '(GMT+07:00) Hanoi', 'indieweb-post-kinds' ),235 244 'Asia/Ho_Chi_Minh' => __( '(GMT+07:00) Ho Chi Minh', 'indieweb-post-kinds' ), 236 245 'Indian/Christmas' => __( '(GMT+07:00) Christmas', 'indieweb-post-kinds' ), 237 246 'Antarctica/Casey' => __( '(GMT+08:00) Casey', 'indieweb-post-kinds' ), 238 247 'Asia/Brunei' => __( '(GMT+08:00) Brunei', 'indieweb-post-kinds' ), 239 'Asia/Choibalsan' => __( '(GMT+08:00) Choibalsan', 'indieweb-post-kinds' ),240 248 'Asia/Hong_Kong' => __( '(GMT+08:00) Hong Kong', 'indieweb-post-kinds' ), 241 249 'Asia/Irkutsk' => __( '(GMT+08:00) Moscow+05 - Irkutsk', 'indieweb-post-kinds' ), … … 284 292 'Pacific/Wallis' => __( '(GMT+12:00) Wallis', 'indieweb-post-kinds' ), 285 293 'Pacific/Apia' => __( '(GMT+14:00) Apia', 'indieweb-post-kinds' ), 286 'Pacific/ Enderbury' => __( '(GMT+13:00) Enderbury', 'indieweb-post-kinds' ),294 'Pacific/Kanton' => __( '(GMT+13:00) Kanton', 'indieweb-post-kinds' ), 287 295 'Pacific/Fakaofo' => __( '(GMT+13:00) Fakaofo', 'indieweb-post-kinds' ), 288 296 'Pacific/Tongatapu' => __( '(GMT+13:00) Tongatapu', 'indieweb-post-kinds' ), 289 297 'Pacific/Kiritimati' => __( '(GMT+14:00) Kiritimati', 'indieweb-post-kinds' ), 290 298 ); 299 300 // Identifiers the host's time zone database doesn't know, such as names added after it was built, are left out. 301 $known = array(); 302 foreach ( array_keys( $zones ) as $zone ) { 303 try { 304 new DateTimeZone( $zone ); 305 $known[ $zone ] = true; 306 } catch ( Exception $e ) { 307 continue; 308 } 309 } 310 return array_intersect_key( $zones, $known ); 291 311 } 292 312 … … 295 315 * 296 316 * @since 3.3.4 317 * @since 4.0.2 Uses get_gmt_offsets(). 297 318 * 298 319 * @return string[] Offsets such as '-05:00'. 299 320 */ 300 321 public static function get_offset_list() { 301 $o = wp_cache_get( 'kind_offset_list' ); 302 if ( false !== $o ) { 303 return $o; 304 } 305 $o = array(); 306 $t_zones = timezone_identifiers_list(); 307 foreach ( $t_zones as $a ) { 308 $datetime = new DateTime( 'now', new DateTimeZone( $a ) ); 309 $o[] = Kind_Time::get_datetime_offset( $datetime ); 310 } 311 $o = array_unique( $o ); 312 asort( $o ); 313 wp_cache_set( 'kind_offset_list', $o, '', DAY_IN_SECONDS ); 314 return $o; 322 return get_gmt_offsets(); 323 } 324 325 /** 326 * Returns an id attribute for a field name, such as mf2_in-reply-to-name for mf2_in-reply-to[name]. 327 * 328 * @since 4.0.2 329 * 330 * @param string $name Field name. 331 * @return string 332 */ 333 private static function field_id( $name ) { 334 return trim( preg_replace( '/[^A-Za-z0-9_-]+/', '-', $name ), '-' ); 335 } 336 337 /** 338 * Returns the opening label for a field. 339 * 340 * @since 4.0.2 341 * 342 * @param array $args Field arguments, as returned by validate(). 343 * @param string $for Optional. The id the label is for. Default the field's id. 344 * @return string 345 */ 346 private static function label( $args, $for = null ) { 347 return sprintf( 348 '<label for="%1$s" class="%2$s">%3$s', 349 esc_attr( $for ?? $args['id'] ), 350 esc_attr( self::classes( $args ) ), 351 esc_html( $args['label'] ) 352 ); 353 } 354 355 /** 356 * Returns a field's classes, with kind-field-required added for a required field. 357 * 358 * @since 4.0.2 359 * 360 * @param array $args Field arguments, as returned by validate(). 361 * @param string $extra Optional. Classes to add first. Default empty. 362 * @return string 363 */ 364 private static function classes( $args, $extra = '' ) { 365 $classes = array( $extra, $args['class'], empty( $args['required'] ) ? '' : 'kind-field-required' ); 366 return implode( ' ', array_filter( array_map( 'trim', $classes ), 'strlen' ) ); 367 } 368 369 /** 370 * Returns the aria-required attribute for a required field, or an empty string. 371 * 372 * The HTML required attribute isn't used: it would stop a draft from being 373 * saved while the field is empty. 374 * 375 * @since 4.0.2 376 * 377 * @param array $args Field arguments, as returned by validate(). 378 * @return string 379 */ 380 private static function aria_required( $args ) { 381 return empty( $args['required'] ) ? '' : ' aria-required="true"'; 315 382 } 316 383 … … 318 385 * Renders date, time and offset inputs. 319 386 * 320 * @since 3.3.4 321 * 322 * @param array $args Field arguments, as returned by validate(): 'name', 'label' and 'class'. 323 * @param DateTime|string|false $datetime Date, or a date string. Default now. 387 * The parts are named {name}[date], {name}[time] and {name}[offset]. 388 * 389 * @since 3.3.4 390 * @since 4.0.2 The inputs are empty when there is no date, instead of showing now. 391 * 392 * @param array $args Field arguments, as returned by validate(). 393 * @param DateTimeInterface|string|false $datetime Date, or a date string. 324 394 * @return string The inputs. 325 395 */ 326 396 public static function field_datetime( $args, $datetime ) { 327 if ( is_string( $datetime ) ) { 328 $datetime = new DateTime( $datetime, wp_timezone() ); 329 } 330 if ( ! $datetime ) { 331 $datetime = new DateTime( 'now', wp_timezone() ); 397 $time = Kind_Time::divide_datetime( $datetime ); 398 if ( ! $time ) { 399 $time = array( 'offset' => Kind_Time::get_datetime_offset() ); 332 400 } 333 401 $return = array(); 334 $time = Kind_Time::divide_datetime( $datetime ); 335 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 336 $return[] = sprintf( '<input type="date" name="mf2_%1$s_date" id="mf2_%1$s_date" value="%2$s"/>', $args['name'], ( $time['date'] ?? '' ) ); 337 $return[] = sprintf( '<input type="time" name="mf2_%1$s_time" id="mf2_%1$s_time" step="1" value="%2$s"/>', $args['name'], ( $time['time'] ?? '' ) ); 338 $return[] = sprintf( '<select name="%1s_offset" id="%1$s_offset">', $args['name'] ); 402 $return[] = self::label( $args, $args['id'] . '-date' ); 403 $return[] = sprintf( '<input type="date" name="%1$s[date]" id="%2$s-date" value="%3$s"%4$s />', esc_attr( $args['name'] ), esc_attr( $args['id'] ), esc_attr( $time['date'] ?? '' ), self::aria_required( $args ) ); 404 $return[] = sprintf( '<input type="time" name="%1$s[time]" id="%2$s-time" step="1" value="%3$s" />', esc_attr( $args['name'] ), esc_attr( $args['id'] ), esc_attr( $time['time'] ?? '' ) ); 405 $return[] = sprintf( '<select name="%1$s[offset]" id="%2$s-offset">', esc_attr( $args['name'] ), esc_attr( $args['id'] ) ); 339 406 foreach ( self::get_offset_list() as $offset ) { 340 $return[] = sprintf( '<option value="%1$s"%2$s>%3$s</option>', $offset, selected( $offset, $time['offset'], false ), sprintf( 'GMT%1$s',$offset ) );407 $return[] = sprintf( '<option value="%1$s"%2$s>%3$s</option>', esc_attr( $offset ), selected( $offset, $time['offset'] ?? '', false ), esc_html( 'GMT' . $offset ) ); 341 408 } 342 409 $return[] = '</select></label>'; … … 345 412 346 413 /** 347 * Renders duration inputs. 348 * 349 * @since 3.3.4 350 * 351 * @param array $args Field arguments, as returned by validate(), including 'pieces'. 352 * @param DateInterval|string $interval Duration, or an ISO 8601 duration. Default 0. 414 * Renders duration inputs, one for each of $args['pieces']. 415 * 416 * The parts are named {name}[Y], {name}[M], {name}[D], {name}[H], {name}[I] and {name}[S]. 417 * 418 * @since 3.3.4 419 * 420 * @param array $args Field arguments, as returned by validate(), including 'pieces'. 421 * @param DateInterval|string|false $interval Duration, or an ISO 8601 duration. 353 422 * @return string The inputs. 354 423 */ 355 424 public static function field_duration( $args, $interval ) { 356 if ( is_string( $interval ) ) { 357 $interval = new DateInterval( $interval ); 358 } 359 if ( ! $interval ) { 360 $interval = new DateInterval( 'PT0S' ); 361 } 425 $duration = Kind_Time::divide_interval( kind_safe_interval( $interval ) ); 426 $pieces = array( 427 'Y' => array( 1000, __( 'Years', 'indieweb-post-kinds' ) ), 428 'M' => array( 11, __( 'Months', 'indieweb-post-kinds' ) ), 429 'D' => array( 31, __( 'Days', 'indieweb-post-kinds' ) ), 430 'H' => array( 23, __( 'Hours', 'indieweb-post-kinds' ) ), 431 'I' => array( 59, __( 'Minutes', 'indieweb-post-kinds' ) ), 432 'S' => array( 59, __( 'Seconds', 'indieweb-post-kinds' ) ), 433 ); 434 $first = reset( $args['pieces'] ); 362 435 $return = array(); 363 $duration = Kind_Time::divide_interval( $interval ); 364 $max = array( 365 'Y' => 1000, 366 'M' => 11, 367 'D' => 31, 368 'H' => 23, 369 'I' => 59, 370 'S' => 60, 371 ); 372 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 436 $return[] = self::label( $args, $args['id'] . '-' . $first ); 373 437 foreach ( $args['pieces'] as $piece ) { 374 $return[] = sprintf( '<input type="number" name="mf2_%2$s_%1$s" id="mf2_%3$s_%1$s" value="%4$s" step="1" max="%5$s" />', $piece, $args['name'], $args['id'], ( $duration['year'] ?? '' ), $max[ $piece ] ); 438 $return[] = sprintf( 439 '<input type="number" name="%1$s[%2$s]" id="%3$s-%2$s" value="%4$s" min="0" max="%5$d" step="1" aria-label="%6$s" />', 440 esc_attr( $args['name'] ), 441 esc_attr( $piece ), 442 esc_attr( $args['id'] ), 443 esc_attr( $duration[ $piece ] ? (string) $duration[ $piece ] : '' ), 444 $pieces[ $piece ][0], 445 esc_attr( $pieces[ $piece ][1] ) 446 ); 375 447 } 376 448 $return[] = '</label>'; … … 379 451 380 452 /** 381 * Renders author name, URL and photo inputs. 382 * 383 * @since 3.3.4 384 * 385 * @param array $args Field arguments, as returned by validate(). 386 * @param array|false $author Values, with 'name', 'url' and 'photo' keys. 387 * @return string The inputs. 388 */ 389 public static function field_author( $args, $author ) { 390 if ( ! $author ) { 391 $author = array(); 392 } 393 $props = array( 453 * Returns the default fields of an author: name, URL and photo. 454 * 455 * @since 4.0.2 456 * 457 * @return array Field definitions, keyed by property. 458 */ 459 public static function author_properties() { 460 return array( 394 461 'name' => array( 395 462 'type' => 'text', … … 405 472 ), 406 473 ); 407 // Ensure all props are set for values. 408 foreach ( array_keys( $props ) as $prop ) { 409 if ( ! array_key_exists( $prop, $author ) ) { 410 $author[ $prop ] = ''; 411 } 412 } 413 return self::render( $props, $author ); 414 } 415 416 417 /** 418 * Renders a select. The options are in $args['options']. 474 } 475 476 /** 477 * Returns the fields of a citation, for a kind's schema. 478 * 479 * The fields are name, url, author, summary, publication, published, 480 * updated, category (tags) and featured. Overrides change them by key: 481 * false removes a field, an array is merged into its definition (to 482 * relabel it, for example), and a new key adds a field. 483 * 484 * @since 4.0.2 485 * 486 * @param array $overrides Optional. Changes to the fields, keyed by property. Default empty array. 487 * @return array Field definitions, keyed by property. 488 */ 489 public static function cite_properties( $overrides = array() ) { 490 $properties = array( 491 'name' => array( 492 'type' => 'text', 493 'label' => __( 'Name', 'indieweb-post-kinds' ), 494 ), 495 'url' => array( 496 'type' => 'url', 497 'label' => __( 'URL', 'indieweb-post-kinds' ), 498 ), 499 'author' => array( 500 'type' => 'author', 501 'label' => __( 'Author', 'indieweb-post-kinds' ), 502 ), 503 'summary' => array( 504 'type' => 'textarea', 505 'label' => __( 'Summary', 'indieweb-post-kinds' ), 506 ), 507 'publication' => array( 508 'type' => 'text', 509 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 510 ), 511 'published' => array( 512 'type' => 'datetime', 513 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 514 ), 515 'updated' => array( 516 'type' => 'datetime', 517 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 518 ), 519 'category' => array( 520 'type' => 'list', 521 'label' => __( 'Tags', 'indieweb-post-kinds' ), 522 ), 523 'featured' => array( 524 'type' => 'url', 525 'label' => __( 'Featured Media', 'indieweb-post-kinds' ), 526 ), 527 ); 528 foreach ( (array) $overrides as $key => $override ) { 529 if ( false === $override ) { 530 unset( $properties[ $key ] ); 531 } elseif ( is_array( $override ) ) { 532 $properties[ $key ] = isset( $properties[ $key ] ) ? array_merge( $properties[ $key ], $override ) : $override; 533 } 534 } 535 return $properties; 536 } 537 538 /** 539 * Returns a citation field, for a kind's schema. 540 * 541 * @since 4.0.2 542 * 543 * @param string $label Label, such as 'In Reply To'. 544 * @param array $overrides Optional. Changes to the citation's fields; see cite_properties(). Default empty array. 545 * @param bool $required Optional. Whether the citation is required. Default true: a response needs something to respond to. 546 * @return array Field definition. 547 */ 548 public static function cite_field( $label, $overrides = array(), $required = true ) { 549 return array( 550 'type' => 'cite', 551 'label' => $label, 552 'required' => (bool) $required, 553 'properties' => self::cite_properties( $overrides ), 554 ); 555 } 556 557 /** 558 * Returns the title field, for kinds that show a title. 559 * 560 * @since 4.0.2 561 * 562 * @return array Field definition. 563 */ 564 public static function title_field() { 565 return array( 566 'type' => 'text', 567 'label' => __( 'Title', 'indieweb-post-kinds' ), 568 ); 569 } 570 571 /** 572 * Returns the optional rating field: a satisfaction rating from 1 to 5. 573 * 574 * @since 4.0.2 575 * 576 * @return array Field definition. 577 */ 578 public static function rating_field() { 579 return array( 580 'type' => 'select', 581 'label' => __( 'Rating', 'indieweb-post-kinds' ), 582 'options' => array( 583 1 => __( 'Very Dissatisfied', 'indieweb-post-kinds' ), 584 2 => __( 'Dissatisfied', 'indieweb-post-kinds' ), 585 3 => __( 'Neutral', 'indieweb-post-kinds' ), 586 4 => __( 'Satisfied', 'indieweb-post-kinds' ), 587 5 => __( 'Very Satisfied', 'indieweb-post-kinds' ), 588 ), 589 ); 590 } 591 592 /** 593 * Returns the RSVP field. 594 * 595 * @since 4.0.2 596 * 597 * @param bool $required Optional. Whether it is required. Default true. 598 * @return array Field definition. 599 */ 600 public static function rsvp_field( $required = true ) { 601 return array( 602 'type' => 'select', 603 'label' => __( 'RSVP', 'indieweb-post-kinds' ), 604 'required' => (bool) $required, 605 'options' => array( 606 'yes' => __( 'Yes', 'indieweb-post-kinds' ), 607 'no' => __( 'No', 'indieweb-post-kinds' ), 608 'maybe' => __( 'Maybe', 'indieweb-post-kinds' ), 609 'interested' => __( 'Interested', 'indieweb-post-kinds' ), 610 'remote' => __( 'Remote', 'indieweb-post-kinds' ), 611 ), 612 ); 613 } 614 615 /** 616 * Returns the optional read status field: to-read, reading or finished. 617 * 618 * @since 4.0.2 619 * 620 * @return array Field definition. 621 */ 622 public static function read_status_field() { 623 return array( 624 'type' => 'select', 625 'label' => __( 'Read Status', 'indieweb-post-kinds' ), 626 'options' => array( 627 'to-read' => __( 'Want to Read', 'indieweb-post-kinds' ), 628 'reading' => __( 'Reading', 'indieweb-post-kinds' ), 629 'finished' => __( 'Finished Reading', 'indieweb-post-kinds' ), 630 ), 631 ); 632 } 633 634 /** 635 * Returns the optional time fields: start, end and duration. 636 * 637 * @since 4.0.2 638 * 639 * @return array Field definitions, keyed by property. 640 */ 641 public static function time_fields() { 642 return array( 643 'start' => array( 644 'type' => 'datetime', 645 'label' => __( 'Start Date', 'indieweb-post-kinds' ), 646 ), 647 'end' => array( 648 'type' => 'datetime', 649 'label' => __( 'End Date', 'indieweb-post-kinds' ), 650 ), 651 'duration' => array( 652 'type' => 'duration', 653 'label' => __( 'Duration', 'indieweb-post-kinds' ), 654 'pieces' => array( 'H', 'I', 'S' ), 655 ), 656 ); 657 } 658 659 /** 660 * Renders author name, URL and photo inputs, named {name}[name], {name}[url] and {name}[photo]. 661 * 662 * @since 3.3.4 663 * 664 * @param array $args Field arguments, as returned by validate(). 665 * @param array|string|false $author An author as jf2 or mf2, or a name or URL. For a list, the first. 666 * @return string The inputs. 667 */ 668 public static function field_author( $args, $author ) { 669 $authors = Kind_Post::normalize_authors( $author ? $author : array() ); 670 $author = $authors ? $authors[0] : array(); 671 return self::fieldset( $args, self::author_properties(), $author ); 672 } 673 674 /** 675 * Renders a select. The options are in $args['options'], value => label. 419 676 * 420 677 * @since 3.3.4 … … 425 682 */ 426 683 public static function field_select( $args, $selected ) { 427 $return = array();428 429 $return[] = sprintf( '< label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label']);430 $return[] = sprintf( '<select name="mf2_%1s" id="mf2_%1$s">', $args['name'] );684 $return = array(); 685 $return[] = self::label( $args ); 686 $return[] = sprintf( '<select name="%1$s" id="%2$s"%3$s>', esc_attr( $args['name'] ), esc_attr( $args['id'] ), self::aria_required( $args ) ); 687 $return[] = '<option value=""></option>'; 431 688 foreach ( $args['options'] as $key => $value ) { 432 $return[] = sprintf( '<option value="%1$s"%2$s>%3$s</option>', $key, selected( $key, $selected, false ), $value);689 $return[] = sprintf( '<option value="%1$s"%2$s>%3$s</option>', esc_attr( $key ), selected( (string) $key, (string) self::scalar( $selected ), false ), esc_html( $value ) ); 433 690 } 434 691 $return[] = '</select></label>'; 435 692 return implode( PHP_EOL, $return ); 693 } 694 695 /** 696 * Renders an input. 697 * 698 * @since 4.0.2 699 * 700 * @param array $args Field arguments, as returned by validate(). 701 * @param string $type Input type. 702 * @param mixed $value Value. 703 * @param string $extra Optional. Extra attributes, already escaped. Default empty. 704 * @return string The input. 705 */ 706 private static function input( $args, $type, $value, $extra = '' ) { 707 return implode( 708 PHP_EOL, 709 array( 710 self::label( $args ), 711 sprintf( '<input name="%1$s" id="%2$s" type="%3$s" value="%4$s"%5$s%6$s />', esc_attr( $args['name'] ), esc_attr( $args['id'] ), esc_attr( $type ), esc_attr( self::scalar( $value ) ), $extra, self::aria_required( $args ) ), 712 '</label>', 713 ) 714 ); 436 715 } 437 716 … … 446 725 */ 447 726 public static function field_url( $args, $url ) { 448 $return = array(); 449 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 450 $return[] = sprintf( '<input name="mf2_%1s" id="mf2_%1$s" type="url" value="%2$s">', $args['name'], $url ); 451 $return[] = '</label>'; 452 return implode( PHP_EOL, $return ); 727 return self::input( $args, 'url', $url ); 453 728 } 454 729 455 730 /** 456 731 * Renders a number input. The step is in $args['step']. 732 * 733 * @since 3.3.4 734 * 735 * @param array $args Field arguments, as returned by validate(). 736 * @param int|string $value Value. 737 * @return string The input. 738 */ 739 public static function field_number( $args, $value ) { 740 return self::input( $args, 'number', $value, sprintf( ' step="%s"', esc_attr( $args['step'] ) ) ); 741 } 742 743 /** 744 * Renders a text input. 457 745 * 458 746 * @since 3.3.4 … … 462 750 * @return string The input. 463 751 */ 464 public static function field_number( $args, $value ) { 465 $return = array(); 466 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 467 $return[] = sprintf( '<input name="mf2_%1s" id="mf2_%1$s" type="number" step="%2$s" value="%3$s">', $args['name'], $args['step'], $value ); 468 $return[] = '</label>'; 469 return implode( PHP_EOL, $return ); 470 } 471 472 /** 473 * Renders a text input. 474 * 475 * @since 3.3.4 476 * 477 * @param array $args Field arguments, as returned by validate(). 478 * @param string $value Value. 752 public static function field_text( $args, $value ) { 753 return self::input( $args, 'text', $value ); 754 } 755 756 /** 757 * Renders a textarea. 758 * 759 * @since 3.3.4 760 * 761 * @param array $args Field arguments, as returned by validate(). 762 * @param string|array $value Value. For jf2 HTML values, the text ('value') is used. 479 763 * @return string The input. 480 764 */ 481 public static function field_text( $args, $value ) {482 $return = array();483 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] );484 $return[] = sprintf( '<input name="mf2_%1s" id="mf2_%1$s" type="text" value="%2$s">', $args['name'], $value );485 $return[] = '</label>';486 return implode( PHP_EOL, $return );487 }488 489 /**490 * Renders a textarea.491 *492 * @since 3.3.4493 *494 * @param array $args Field arguments, as returned by validate().495 * @param string $value Value.496 * @return string The input.497 */498 765 public static function field_textarea( $args, $value ) { 499 $return = array(); 500 $return[] = sprintf( '<label for="mf2_%1$s" class="%2$s">%3$s', $args['name'], $args['class'], $args['label'] ); 501 $return[] = sprintf( '<textarea name="mf2_%1s" id="mf2_%1$s">%2$s</textarea>', $args['name'], $value ); 502 $return[] = '</label>'; 503 return implode( PHP_EOL, $return ); 766 if ( is_array( $value ) && isset( $value['value'] ) ) { 767 $value = $value['value']; 768 } 769 return implode( 770 PHP_EOL, 771 array( 772 self::label( $args ), 773 sprintf( '<textarea name="%1$s" id="%2$s"%3$s>%4$s</textarea>', esc_attr( $args['name'] ), esc_attr( $args['id'] ), self::aria_required( $args ), esc_textarea( self::scalar( $value ) ) ), 774 '</label>', 775 ) 776 ); 504 777 } 505 778 … … 515 788 public static function field_list( $args, $value ) { 516 789 if ( is_array( $value ) ) { 517 $value = implode( ';', $value);790 $value = implode( ';', array_filter( $value, 'is_scalar' ) ); 518 791 } 519 792 return self::field_textarea( $args, $value ); … … 521 794 522 795 /** 523 * Renders the inputs for a venue's properties .524 * 525 * @since 3.3.4 526 * 527 * @param array $args Field arguments, as returned by validate(), including 'properties'.528 * @param array $value Values, keyed by property.796 * Renders the inputs for a venue's properties, in $args['properties']. 797 * 798 * @since 3.3.4 799 * 800 * @param array $args Field arguments, as returned by validate(), including 'properties'. 801 * @param array|string $value Values as jf2 or mf2, keyed by property. 529 802 * @return string The inputs. 530 803 */ 531 804 public static function field_venue( $args, $value ) { 532 return self:: render($args['properties'], $value );533 } 534 535 /** 536 * Renders the inputs for a citation's properties .537 * 538 * @since 3.3.4 539 * 540 * @param array $args Field arguments, as returned by validate(), including 'properties'.541 * @param array $value Values, keyed by property.805 return self::fieldset( $args, $args['properties'], $value ); 806 } 807 808 /** 809 * Renders the inputs for a citation's properties, in $args['properties']. 810 * 811 * @since 3.3.4 812 * 813 * @param array $args Field arguments, as returned by validate(), including 'properties'. 814 * @param array|string $value Values as jf2 or mf2, keyed by property. A URL is read as the citation's URL. 542 815 * @return string The inputs. 543 816 */ 544 817 public static function field_cite( $args, $value ) { 545 return self::render( $args['properties'], $value ); 818 return self::fieldset( $args, $args['properties'], $value ); 819 } 820 821 /** 822 * Renders nested fields in a fieldset, with the field's label as its legend. 823 * 824 * @since 4.0.2 825 * 826 * @param array $args Field arguments, as returned by validate(). 827 * @param array $properties Field definitions of the nested fields. 828 * @param array|string $value Values as jf2 or mf2, keyed by property. 829 * @return string The fieldset. 830 */ 831 private static function fieldset( $args, $properties, $value ) { 832 if ( is_string( $value ) ) { 833 $value = wp_http_validate_url( $value ) ? array( 'url' => $value ) : array( 'name' => $value ); 834 } 835 if ( is_array( $value ) && wp_is_numeric_array( $value ) ) { 836 $value = reset( $value ); 837 } 838 if ( is_array( $value ) && isset( $value['properties'] ) && function_exists( '\\ParseThis\\mf2_to_jf2' ) ) { 839 $value = \ParseThis\mf2_to_jf2( $value ); 840 } 841 return sprintf( 842 '<fieldset id="%1$s" class="%2$s"><legend>%3$s</legend>%4$s</fieldset>', 843 esc_attr( $args['id'] ), 844 esc_attr( self::classes( $args, 'kind-field-' . $args['type'] ) ), 845 esc_html( $args['label'] ), 846 self::render( $properties, is_array( $value ) ? $value : array(), $args['name'] ) 847 ); 848 } 849 850 /** 851 * Returns a value as a string for a single input. Lists use their first value. 852 * 853 * @since 4.0.2 854 * 855 * @param mixed $value Value. 856 * @return string 857 */ 858 private static function scalar( $value ) { 859 while ( is_array( $value ) && ! empty( $value ) && wp_is_numeric_array( $value ) ) { 860 $value = reset( $value ); 861 } 862 return is_scalar( $value ) ? (string) $value : ''; 546 863 } 547 864 … … 581 898 * Checks a field definition and fills in defaults. 582 899 * 583 * @since 3.3.4 900 * A field needs a type, and a name or a label; each defaults to the other. 901 * A type with no renderer is treated as text. Cite and venue fields need 902 * 'properties', and select fields 'options'. 903 * 904 * @since 3.3.4 905 * @since 4.0.2 A label is no longer required, and unsupported types become text. 584 906 * 585 907 * @param array $element Field definition. … … 587 909 */ 588 910 private static function validate( $element ) { 589 // Everything must have a type. 590 if ( ! self::get( 'type', $element ) ) { 911 if ( ! is_array( $element ) || ! self::get( 'type', $element ) ) { 591 912 return false; 592 913 } 593 // Everything must have a label.594 if ( ! self::get( 'label', $element ) ) {595 return false;596 }597 // If no name property then the label property copies over.598 914 if ( ! self::get( 'name', $element ) ) { 915 if ( ! self::get( 'label', $element ) ) { 916 return false; 917 } 599 918 $element['name'] = sanitize_title( $element['label'] ); 600 919 } 601 // If no label property then the name property copies over.602 920 if ( ! self::get( 'label', $element ) ) { 603 921 $element['label'] = $element['name']; 604 922 } 605 // If no class property then the class property is set to empty. 923 if ( ! self::get( 'id', $element ) ) { 924 $element['id'] = self::field_id( $element['name'] ); 925 } 606 926 if ( ! self::get( 'class', $element ) ) { 607 927 $element['class'] = ''; 608 928 } 609 // Class can be an array.610 929 if ( is_array( $element['class'] ) ) { 611 930 $element['class'] = implode( ' ', $element['class'] ); 612 931 } 613 $type = self::get( 'type', $element ); 614 // Any non supported type should be considered to be text. 615 if ( ! self::supported_type( $type ) ) { 616 $type = 'text'; 617 } 618 // Type Specific Conditions. 932 $element['required'] = ! empty( $element['required'] ); 933 if ( ! self::supported_type( $element['type'] ) ) { 934 $element['type'] = 'text'; 935 } 936 switch ( $element['type'] ) { 937 case 'cite': 938 case 'venue': 939 if ( ! is_array( self::get( 'properties', $element ) ) ) { 940 return false; 941 } 942 break; 943 case 'number': 944 if ( ! array_key_exists( 'step', $element ) ) { 945 $element['step'] = 1; 946 } 947 break; 948 case 'select': 949 if ( ! is_array( self::get( 'options', $element ) ) ) { 950 return false; 951 } 952 break; 953 case 'duration': 954 $pieces = is_array( self::get( 'pieces', $element ) ) ? $element['pieces'] : array( 'H', 'I', 'S' ); 955 $element['pieces'] = array_values( array_intersect( array( 'Y', 'M', 'D', 'H', 'I', 'S' ), $pieces ) ); 956 if ( empty( $element['pieces'] ) ) { 957 $element['pieces'] = array( 'H', 'I', 'S' ); 958 } 959 break; 960 } 961 return $element; 962 } 963 964 /** 965 * Whether a field type is supported: whether there is a field_{type}() renderer for it. 966 * 967 * @since 3.3.4 968 * @since 4.0.2 Derived from the field_*() methods. 969 * 970 * @param string $type Field type. 971 * @return bool 972 */ 973 public static function supported_type( $type ) { 974 return is_string( $type ) && 1 === preg_match( '/^[a-z]+$/', $type ) && method_exists( static::class, 'field_' . $type ); 975 } 976 977 /** 978 * Renders form fields from a field schema. 979 * 980 * Fields are named mf2_{property}. Nested fields (an author, citation or 981 * venue) and the parts of a date or duration are named with sub-keys, such 982 * as mf2_in-reply-to[author][name], so form data arrives structured. 983 * Invalid field definitions are skipped. 984 * 985 * @since 3.3.4 986 * @since 4.0.2 Added the $parent parameter; fields are named with sub-keys and escaped. 987 * 988 * @param array $schema Field definitions, keyed by property. 989 * @param array $values Optional. Values as jf2, keyed by property. Default empty array. 990 * @param string $parent Optional. Name of the field these are nested in. Default empty, for top-level fields. 991 * @return string The fields. 992 */ 993 public static function render( $schema, $values = array(), $parent = '' ) { 994 $return = array(); 995 foreach ( (array) $schema as $key => $args ) { 996 if ( ! is_array( $args ) ) { 997 continue; 998 } 999 $key = sanitize_key( $key ); 1000 $args['name'] = '' === $parent ? 'mf2_' . $key : $parent . '[' . $key . ']'; 1001 unset( $args['id'] ); 1002 // A field without a label is labelled with its property, not its field name. 1003 if ( ! self::get( 'label', $args ) ) { 1004 $args['label'] = $key; 1005 } 1006 $args = self::validate( $args ); 1007 if ( ! $args ) { 1008 continue; 1009 } 1010 $return[] = call_user_func( array( static::class, 'field_' . $args['type'] ), $args, self::get( $key, $values ) ); 1011 } 1012 return implode( '<br />', $return ); 1013 } 1014 1015 /** 1016 * Extracts microformats properties from submitted form data. 1017 * 1018 * Reads the fields named mf2_{property}. Nested values arrive as arrays 1019 * (mf2_in-reply-to[name]); the older {property}_{part} form 1020 * (mf2_start_date) is read too. Date parts (date, time, offset) become an 1021 * ISO 8601 date, and duration parts (Y, M, D, H, I, S) an ISO 8601 1022 * duration. Empty values are dropped. 1023 * 1024 * With a schema, the values are also sanitized by field type and only the 1025 * schema's properties are kept; see sanitize(). Without one, values are 1026 * only reassembled, not sanitized. 1027 * 1028 * @since 3.3.4 1029 * @since 4.0.2 Rewritten; added the $schema parameter. 1030 * 1031 * @param array $data Form data, unslashed, such as wp_unslash( $_POST ). 1032 * @param array|null $schema Optional. Field definitions, keyed by property. Default null. 1033 * @return array The properties as jf2-style values, keyed by property. 1034 */ 1035 public static function rebuild_data( $data, $schema = null ) { 1036 $raw = array(); 1037 foreach ( (array) $data as $key => $value ) { 1038 if ( ! is_string( $key ) || ! self::str_prefix( $key, 'mf2_' ) ) { 1039 continue; 1040 } 1041 $key = substr( $key, 4 ); 1042 // Property names use hyphens, so an underscore marks a part: start_date. 1043 $pieces = explode( '_', $key, 2 ); 1044 if ( 2 === count( $pieces ) && '' !== $pieces[0] && '' !== $pieces[1] ) { 1045 if ( ! isset( $raw[ $pieces[0] ] ) || ! is_array( $raw[ $pieces[0] ] ) ) { 1046 $raw[ $pieces[0] ] = array(); 1047 } 1048 $raw[ $pieces[0] ][ $pieces[1] ] = $value; 1049 continue; 1050 } 1051 if ( isset( $raw[ $key ] ) && is_array( $raw[ $key ] ) && is_array( $value ) ) { 1052 $value = array_merge( $raw[ $key ], $value ); 1053 } 1054 $raw[ $key ] = $value; 1055 } 1056 if ( is_array( $schema ) ) { 1057 return self::sanitize( $schema, $raw ); 1058 } 1059 return self::assemble( $raw ); 1060 } 1061 1062 /** 1063 * Reassembles date and duration parts in nested values and drops empty values. 1064 * 1065 * @since 4.0.2 1066 * 1067 * @param array $values Values. 1068 * @return array 1069 */ 1070 private static function assemble( $values ) { 1071 foreach ( $values as $key => $value ) { 1072 if ( is_array( $value ) ) { 1073 if ( self::is_datetime_parts( $value ) ) { 1074 $value = self::datetime_from_parts( $value ); 1075 } elseif ( self::is_duration_parts( $value ) ) { 1076 $value = self::duration_from_parts( $value ); 1077 } else { 1078 $value = self::assemble( $value ); 1079 } 1080 } elseif ( is_string( $value ) ) { 1081 $value = trim( $value ); 1082 } 1083 if ( self::is_empty( $value ) ) { 1084 unset( $values[ $key ] ); 1085 } else { 1086 $values[ $key ] = $value; 1087 } 1088 } 1089 return $values; 1090 } 1091 1092 /** 1093 * Sanitizes values by the type of their field definitions. 1094 * 1095 * This is the shared validation for every editor: form data rebuilt by 1096 * rebuild_data(), or values sent by a block editor or another client. 1097 * Only properties in the schema are kept, and empty or invalid values are 1098 * dropped. By type: 1099 * - text, textarea: sanitize_text_field() and sanitize_textarea_field(). 1100 * - url: sanitize_url(); unsafe URLs are dropped. 1101 * - number: a number; anything else is dropped. 1102 * - select: one of the option values. 1103 * - list: a list of text, from an array or a semicolon-separated string. 1104 * - datetime: an ISO 8601 date, from a date string or date, time and offset parts. 1105 * - duration: an ISO 8601 duration, from a duration string or Y, M, D, H, I and S parts. 1106 * - author: name, url and photo. 1107 * - cite, venue: their nested properties. A string is read as the URL (or name). 1108 * Values that are lists of the type are sanitized item by item. 1109 * 1110 * @since 4.0.2 1111 * 1112 * @param array $schema Field definitions, keyed by property. 1113 * @param array $values Values, keyed by property. 1114 * @return array The sanitized values, keyed by property. 1115 */ 1116 public static function sanitize( $schema, $values ) { 1117 $return = array(); 1118 if ( ! is_array( $schema ) || ! is_array( $values ) ) { 1119 return $return; 1120 } 1121 foreach ( $schema as $key => $args ) { 1122 if ( ! is_array( $args ) || ! array_key_exists( $key, $values ) ) { 1123 continue; 1124 } 1125 $args['name'] = $key; 1126 if ( ! self::get( 'label', $args ) ) { 1127 $args['label'] = $key; 1128 } 1129 $args = self::validate( $args ); 1130 if ( ! $args ) { 1131 continue; 1132 } 1133 $value = self::sanitize_field( $args, $values[ $key ] ); 1134 if ( ! self::is_empty( $value ) ) { 1135 $return[ $key ] = $value; 1136 } 1137 } 1138 return $return; 1139 } 1140 1141 /** 1142 * Sanitizes one value by its field definition. 1143 * 1144 * @since 4.0.2 1145 * 1146 * @param array $args Field definition, as returned by validate(). 1147 * @param mixed $value Value. 1148 * @return mixed The sanitized value, or null if it is empty or invalid. 1149 */ 1150 private static function sanitize_field( $args, $value ) { 1151 $type = $args['type']; 1152 // A list of values of this type, such as several URLs. Lists, dates and durations have their own shapes. 1153 if ( is_array( $value ) && wp_is_numeric_array( $value ) && ! in_array( $type, array( 'list', 'datetime', 'duration' ), true ) ) { 1154 $items = array(); 1155 foreach ( $value as $item ) { 1156 $item = self::sanitize_field( $args, $item ); 1157 if ( ! self::is_empty( $item ) ) { 1158 $items[] = $item; 1159 } 1160 } 1161 if ( empty( $items ) ) { 1162 return null; 1163 } 1164 return 1 === count( $items ) ? $items[0] : $items; 1165 } 619 1166 switch ( $type ) { 620 1167 case 'cite': 621 1168 case 'venue': 622 if ( ! array_key_exists( 'properties', $element ) ) { 623 return false; 624 } 625 break; 1169 case 'author': 1170 $properties = 'author' === $type ? self::author_properties() : $args['properties']; 1171 if ( is_string( $value ) ) { 1172 $value = trim( $value ); 1173 $url = '' !== $value && wp_http_validate_url( $value ) ? sanitize_url( $value ) : ''; 1174 if ( $url ) { 1175 return array_key_exists( 'url', $properties ) ? array( 'url' => $url ) : null; 1176 } 1177 return array_key_exists( 'name', $properties ) ? self::sanitize( $properties, array( 'name' => $value ) ) : null; 1178 } 1179 if ( is_array( $value ) && isset( $value['properties'] ) && function_exists( '\\ParseThis\\mf2_to_jf2' ) ) { 1180 $value = \ParseThis\mf2_to_jf2( $value ); 1181 } 1182 return is_array( $value ) ? self::sanitize( $properties, $value ) : null; 1183 case 'datetime': 1184 if ( is_array( $value ) && self::is_datetime_parts( $value ) ) { 1185 return self::datetime_from_parts( self::text_parts( $value ) ); 1186 } 1187 $datetime = is_string( $value ) ? kind_safe_datetime( trim( $value ) ) : kind_safe_datetime( $value ); 1188 return $datetime ? $datetime->format( DATE_W3C ) : null; 1189 case 'duration': 1190 if ( is_array( $value ) && self::is_duration_parts( $value ) ) { 1191 return self::duration_from_parts( $value ); 1192 } 1193 $interval = kind_safe_interval( is_string( $value ) ? trim( $value ) : $value ); 1194 $interval = $interval ? date_interval_to_iso8601( $interval ) : ''; 1195 return 'P' === $interval ? null : $interval; 1196 case 'list': 1197 if ( is_string( $value ) ) { 1198 $value = explode( ';', $value ); 1199 } 1200 if ( ! is_array( $value ) ) { 1201 return null; 1202 } 1203 $items = array_values( array_filter( array_map( 'sanitize_text_field', array_filter( $value, 'is_scalar' ) ), 'strlen' ) ); 1204 return $items ? $items : null; 626 1205 case 'number': 627 if ( ! array_key_exists( 'step', $element ) ) { 628 $element['step'] = 1; // Defaults to Even Numbers. 629 } 630 break; 1206 return is_numeric( $value ) ? $value + 0 : null; 631 1207 case 'select': 632 if ( ! array_key_exists( 'options', $element ) ) {633 return false;634 }635 break;636 case 'duration':637 if ( array_key_exists( 'pieces', $element ) ) {638 // Ensure only valid options.639 $ element['pieces'] = array_intersect( array( 'Y', 'M', 'D', 'H', 'I', 'S' ), $element['pieces'] );640 } else {641 // By default only show hours, minutes, seconds.642 $element['pieces'] = array( 'H', 'I', 'S' );643 }644 break;645 }646 return $element;647 } 648 649 /** 650 * Whether a field type is supported.651 * 652 * @since 3.3.4653 * 654 * @param string $type Field type.1208 $value = is_scalar( $value ) ? (string) $value : ''; 1209 return '' !== $value && array_key_exists( $value, $args['options'] ) ? $value : null; 1210 case 'url': 1211 $value = is_string( $value ) ? sanitize_url( trim( $value ) ) : ''; 1212 return '' === $value ? null : $value; 1213 case 'textarea': 1214 if ( is_array( $value ) && isset( $value['value'] ) ) { 1215 $value = $value['value']; 1216 } 1217 $value = is_scalar( $value ) ? sanitize_textarea_field( (string) $value ) : ''; 1218 return '' === trim( $value ) ? null : $value; 1219 default: 1220 $value = is_scalar( $value ) ? sanitize_text_field( (string) $value ) : ''; 1221 return '' === $value ? null : $value; 1222 } 1223 } 1224 1225 /** 1226 * Whether an array holds date parts: only date, time and offset keys. 1227 * 1228 * @since 4.0.2 1229 * 1230 * @param array $value Value. 655 1231 * @return bool 656 1232 */ 657 public static function supported_type( $type ) { 658 return in_array( $type, array( 'cite', 'venue', 'coordinate', 'author', 'datetime', 'duration', 'text', 'url', 'textarea', 'list', 'section' ), true ); 659 } 660 661 662 /** 663 * Returns the properties stored in mf2_ prefixed post meta, without the prefix. 664 * 665 * Reads the current post; the $post argument is not used. 666 * 667 * @since 3.3.4 668 * 669 * @param int|WP_Post $post Not used. 670 * @return array|false The properties, or false if there is no current post. 671 */ 672 private function get_mf2meta( $post ) { 673 $post = get_post(); 674 if ( ! $post ) { 675 return false; 676 } 677 $meta = get_post_meta( $post->ID ); 678 if ( ! $meta ) { 679 return array(); 680 } 681 foreach ( $meta as $key => $value ) { 682 if ( ! self::str_prefix( $key, 'mf2_' ) ) { 683 unset( $meta[ $key ] ); 684 } else { 685 unset( $meta[ $key ] ); 686 $key = str_replace( 'mf2_', '', $key ); 687 // Do not save microput prefixed instructions. 688 if ( self::str_prefix( $key, 'mp-' ) ) { 689 continue; 690 } 691 $value = array_map( 'maybe_unserialize', $value ); 692 if ( 1 === count( $value ) ) { 693 $value = array_shift( $value ); 694 } 695 if ( is_string( $value ) ) { 696 $meta[ $key ] = array( $value ); 697 } else { 698 $meta[ $key ] = $value; 699 } 700 } 701 } 702 return array_filter( $meta ); 703 } 704 705 /** 706 * Renders a form from a field schema. 707 * 708 * @since 3.3.4 709 * 710 * @param array $schema Field definitions, keyed by property. 711 * @param array $values Optional. Values, keyed by property. Default empty array. 712 * @return string The form. 713 */ 714 public static function render( $schema, $values = array() ) { 715 $return = array(); 1233 private static function is_datetime_parts( $value ) { 1234 return ! empty( $value ) && ! array_diff( array_keys( $value ), array( 'date', 'time', 'offset' ) ) && ( isset( $value['date'] ) || isset( $value['time'] ) ); 1235 } 1236 1237 /** 1238 * Whether an array holds duration parts: only Y, M, D, H, I and S keys. 1239 * 1240 * @since 4.0.2 1241 * 1242 * @param array $value Value. 1243 * @return bool 1244 */ 1245 private static function is_duration_parts( $value ) { 1246 return ! empty( $value ) && ! array_diff( array_keys( $value ), array( 'Y', 'M', 'D', 'H', 'I', 'S' ) ); 1247 } 1248 1249 /** 1250 * Sanitizes date parts as text. 1251 * 1252 * @since 4.0.2 1253 * 1254 * @param array $parts Date parts. 1255 * @return array 1256 */ 1257 private static function text_parts( $parts ) { 1258 return array_map( 1259 function ( $part ) { 1260 return is_scalar( $part ) ? sanitize_text_field( (string) $part ) : ''; 1261 }, 1262 $parts 1263 ); 1264 } 1265 1266 /** 1267 * Builds an ISO 8601 date from date, time and offset parts. 1268 * 1269 * A date without a time is midnight; a time without a date is not a date. 1270 * Without an offset, the site's time zone is used. 1271 * 1272 * @since 4.0.2 1273 * 1274 * @param array $parts Date parts. 1275 * @return string|null The date, or null if there is none. 1276 */ 1277 private static function datetime_from_parts( $parts ) { 1278 $date = isset( $parts['date'] ) && is_string( $parts['date'] ) ? trim( $parts['date'] ) : ''; 1279 $time = isset( $parts['time'] ) && is_string( $parts['time'] ) ? trim( $parts['time'] ) : ''; 1280 if ( '' === $date ) { 1281 return null; 1282 } 1283 $offset = isset( $parts['offset'] ) && is_string( $parts['offset'] ) ? trim( $parts['offset'] ) : null; 1284 $datetime = Kind_Time::build_datetime( $date, '' === $time ? '00:00:00' : $time, $offset ); 1285 return $datetime ? $datetime->format( DATE_W3C ) : null; 1286 } 1287 1288 /** 1289 * Builds an ISO 8601 duration from Y, M, D, H, I (minutes) and S parts. 1290 * 1291 * @since 4.0.2 1292 * 1293 * @param array $parts Duration parts. 1294 * @return string|null The duration, or null if every part is empty or zero. 1295 */ 1296 private static function duration_from_parts( $parts ) { 1297 $parts = array_map( 1298 function ( $part ) { 1299 return is_numeric( $part ) ? absint( $part ) : 0; 1300 }, 1301 $parts 1302 ); 1303 $spec = Kind_Time::build_interval( $parts ); 1304 return '' === $spec ? null : $spec; 1305 } 1306 1307 /** 1308 * Returns the required fields that have no value. 1309 * 1310 * Pass values as returned by sanitize(), so invalid values count as 1311 * missing. A required cite, venue or author is filled in when it has at 1312 * least one property, such as a URL or a name. Required fields nested in 1313 * a cite or venue are checked only when it has a value. 1314 * 1315 * @since 4.0.2 1316 * 1317 * @param array $schema Field definitions, keyed by property. 1318 * @param array $values Values, keyed by property. 1319 * @param string $parent Optional. Path of the field these are nested in. Default empty. 1320 * @return string[] Paths of the missing fields, such as 'in-reply-to' or 'in-reply-to.url'. 1321 */ 1322 public static function missing( $schema, $values, $parent = '' ) { 1323 $missing = array(); 1324 if ( ! is_array( $schema ) ) { 1325 return $missing; 1326 } 1327 $values = is_array( $values ) ? $values : array(); 716 1328 foreach ( $schema as $key => $args ) { 717 $args['name'] = sanitize_title( $key ); 718 $args = self::validate( $args ); 1329 if ( ! is_array( $args ) ) { 1330 continue; 1331 } 1332 $args['name'] = $key; 1333 if ( ! self::get( 'label', $args ) ) { 1334 $args['label'] = $key; 1335 } 1336 $args = self::validate( $args ); 719 1337 if ( ! $args ) { 720 break; 721 } 722 $type = self::get( 'type', $args ); 723 if ( $type ) { 724 $return[] = call_user_func( array( get_called_class(), 'field_' . $type ), $args, self::get( $key, $values ) ); 725 } 726 } 727 return implode( '<br />', $return ); 728 } 729 730 /** 731 * Extracts microformats properties from submitted form data. 732 * 733 * Properties are prefixed by mf2_. After that, an underscore marks the 734 * pieces of a property that need to be put back together. 735 * 736 * @since 3.3.4 737 * 738 * @param array $data Form data, such as $_POST. 739 * @return array The properties. 740 */ 741 public static function rebuild_data( $data ) { 742 $raw = array(); 743 foreach ( $data as $key => $value ) { 744 if ( self::str_prefix( $key, 'mf2_' ) ) { 745 $key = str_replace( 'mf2_', '', $key ); 746 $raw[ $key ] = $value; 747 } 748 } 749 foreach ( $raw as $key => $value ) { 750 $pieces = explode( '_', $key ); 751 if ( 2 === count( $pieces ) ) { 752 if ( ! array_key_exists( $pieces[0], $raw ) ) { 753 $raw[ $pieces[0] ] = array(); 754 } 755 $raw[ $pieces[0] ] = $pieces[1]; 756 unset( $raw[ $key ] ); 757 // If this has the elements of a duration. 758 if ( ! empty( array_intersect( array( 'Y', 'M', 'D', 'H', 'I', 'S' ), $raw[ $pieces[0] ] ) ) ) { 759 $interval = Kind_Time::build_interval( $raw[ $pieces[0] ] ); 760 $raw[ $pieces[0] ] = date_interval_to_iso8601( $interval ); 761 } 762 // If this has the elements of a datetime. 763 if ( ! empty( array_intersect( array( 'date', 'time', 'offset' ), $raw[ $pieces[0] ] ) ) ) { 764 $datetime = Kind_Time::build_datetime( $raw[ $pieces[0] ] ); 765 $raw[ $pieces[0] ] = $datetime->format( DATE_W3C ); 766 } 767 } 768 } 769 return array_filter( $raw ); 1338 continue; 1339 } 1340 $path = '' === $parent ? (string) $key : $parent . '.' . $key; 1341 $value = array_key_exists( $key, $values ) ? $values[ $key ] : null; 1342 if ( self::is_empty( $value ) ) { 1343 if ( $args['required'] ) { 1344 $missing[] = $path; 1345 } 1346 continue; 1347 } 1348 if ( in_array( $args['type'], array( 'cite', 'venue' ), true ) && is_array( $value ) ) { 1349 $items = wp_is_numeric_array( $value ) ? $value : array( $value ); 1350 foreach ( $items as $item ) { 1351 $missing = array_merge( $missing, self::missing( $args['properties'], $item, $path ) ); 1352 } 1353 } 1354 } 1355 return array_values( array_unique( $missing ) ); 1356 } 1357 1358 /** 1359 * Whether a value is empty: null, an empty or blank string, or an empty array. 1360 * 1361 * @since 4.0.2 1362 * 1363 * @param mixed $value Value. 1364 * @return bool 1365 */ 1366 private static function is_empty( $value ) { 1367 return null === $value || ( is_string( $value ) && '' === trim( $value ) ) || ( is_array( $value ) && empty( $value ) ); 770 1368 } 771 1369 } -
indieweb-post-kinds/trunk/includes/class-kind-media-metadata.php
r3738687 r3810578 340 340 341 341 /** 342 * Sanitizes metadata extracted from media files. 343 * https://core.trac.wordpress.org/ticket/46800 344 * Currently only binary strings are sanitized with focus on preventing propagation of 345 * bad character encodings from causing database calls and API endpoints to fail. 342 * Converts text in metadata extracted from media files to UTF-8. 343 * 344 * Text that isn't valid UTF-8, such as ISO-8859-1 from older ID3 tags, is 345 * converted so it doesn't break database writes or the REST API 346 * (https://core.trac.wordpress.org/ticket/46800). Valid UTF-8 is left 347 * alone. Nested arrays, such as image_meta, are converted too. 346 348 * 347 349 * @since 3.3.0 348 * 349 * @param array $metadata An existing array with data.350 * 351 * @return array Returns array of sanitizedmetadata.350 * @since 4.0.2 Valid UTF-8 is no longer converted again, and nested arrays are handled. 351 * 352 * @param array $metadata Attachment metadata. 353 * @return array The metadata. 352 354 */ 353 355 public static function wp_sanitize_media_metadata( $metadata ) { 354 356 if ( ! is_array( $metadata ) ) { 355 return $metadata;357 return $metadata; 356 358 } 357 359 foreach ( $metadata as $name => $value ) { 358 if ( ! is_string( $value ) ) {359 continue;360 }361 360 if ( is_array( $value ) ) { 362 $value = wp_sanitize_media_metadata( $value ); 363 } elseif ( is_string( $value ) && preg_match( '~[^\x20-\x7E\t\r\n]~', $value ) > 0 ) { 364 $encoding = mb_detect_encoding( $value, 'ISO-8859-1, UCS-2' ); 365 $value = $encoding ? mb_convert_encoding( $value, 'UTF-8', $encoding ) : $value; 366 } 367 $metadata[ $name ] = $value; 361 $metadata[ $name ] = self::wp_sanitize_media_metadata( $value ); 362 } elseif ( is_string( $value ) && '' !== $value && '' === wp_check_invalid_utf8( $value ) ) { 363 // Not valid UTF-8: read it as ISO-8859-1, the encoding of ID3v1 tags. 364 if ( function_exists( 'mb_convert_encoding' ) ) { 365 $metadata[ $name ] = mb_convert_encoding( $value, 'UTF-8', 'ISO-8859-1' ); 366 } elseif ( function_exists( 'iconv' ) ) { 367 $converted = iconv( 'ISO-8859-1', 'UTF-8', $value ); 368 $metadata[ $name ] = false === $converted ? wp_check_invalid_utf8( $value, true ) : $converted; 369 } else { 370 $metadata[ $name ] = wp_check_invalid_utf8( $value, true ); 371 } 372 } 368 373 } 369 374 return $metadata; -
indieweb-post-kinds/trunk/includes/class-kind-taxonomy.php
r3771941 r3810578 372 372 373 373 /** 374 * Filter template hierarchy to include our template files. 374 * Adds the post's kind to the embed template hierarchy. 375 * 376 * A post embedded on another site (WordPress post embeds) uses 377 * embed-{post_type}-{kind}.php from the theme if there is one, such as 378 * embed-post-like.php, before core's embed templates. 375 379 * 376 380 * @since 3.1.2 377 * 378 * @access public 379 * 380 * @param array $templates Array of template file names. 381 * @return mixed 381 * @since 4.0.2 Uses the kind's slug. The template named after the kind's 382 * translated name (embed-post-Like.php), used before, is still 383 * found, after it. 384 * 385 * @param string[] $templates Template file names. 386 * @return string[] 382 387 */ 383 388 public static function embed_template_hierarchy( $templates ) { 384 389 $object = get_queried_object(); 385 if ( ! empty( $object->post_type ) ) { 386 $post_kind = get_post_kind( $object ); 387 if ( $post_kind ) { 388 array_unshift( $templates, "embed-{$object->post_type}-{$post_kind}.php" ); 389 } 390 } 391 return $templates; 390 if ( empty( $object->post_type ) ) { 391 return $templates; 392 } 393 $slug = get_post_kind_slug( $object ); 394 if ( ! $slug ) { 395 return $templates; 396 } 397 $kind_templates = array( "embed-{$object->post_type}-{$slug}.php" ); 398 // Before 4.0.2 the template was named after the kind's translated singular name. 399 $name = get_post_kind( $object ); 400 if ( $name && $name !== $slug ) { 401 $kind_templates[] = "embed-{$object->post_type}-{$name}.php"; 402 } 403 return array_merge( $kind_templates, $templates ); 392 404 } 393 405 … … 1034 1046 1035 1047 /** 1036 * Fetch the current post kind terms from the current query. 1048 * Returns the terms the main query is for, such as the kinds of a kind archive. 1049 * 1050 * Terms are looked up by the field the query used: archives linked by ID 1051 * (?cat=5, ?tag_id=5) record term IDs, others slugs. Terms that don't 1052 * exist are left out. 1037 1053 * 1038 1054 * @since 3.0.3 1039 * 1040 * @access public 1041 * 1042 * @return array 1055 * @since 4.0.2 Uses the query's field, and returns only terms that exist. 1056 * 1057 * @return WP_Term[] The terms. 1043 1058 */ 1044 1059 public static function get_terms_from_query() { 1045 1060 global $wp_query; 1046 1061 $terms = array(); 1047 if ( ! empty( $wp_query->tax_query->queried_terms ) ) { 1048 $queried = wp_list_pluck( $wp_query->tax_query->queried_terms, 'terms' ); 1049 foreach ( $queried as $tax => $slugs ) { 1050 foreach ( $slugs as $slug ) { 1051 $terms[] = get_term_by( 'slug', $slug, $tax ); 1062 if ( empty( $wp_query->tax_query->queried_terms ) ) { 1063 return $terms; 1064 } 1065 foreach ( $wp_query->tax_query->queried_terms as $tax => $queried ) { 1066 if ( empty( $queried['terms'] ) || ! is_array( $queried['terms'] ) ) { 1067 continue; 1068 } 1069 $field = isset( $queried['field'] ) && in_array( $queried['field'], array( 'slug', 'name', 'term_id', 'term_taxonomy_id' ), true ) ? $queried['field'] : 'slug'; 1070 foreach ( $queried['terms'] as $value ) { 1071 $term = get_term_by( $field, $value, $tax ); 1072 if ( $term instanceof WP_Term ) { 1073 $terms[] = $term; 1052 1074 } 1053 1075 } … … 1069 1091 public static function kind_archive_prefix( $prefix ) { 1070 1092 if ( is_tax() || is_category() || is_tag() ) { 1071 $terms = self::get_terms_from_query(); 1072 $tax = get_taxonomy( reset( $terms )->taxonomy ); 1073 $plural = ( count( $terms ) === 1 ); 1074 return ( $plural ? $tax->labels->singular_name : $tax->labels->name ) . ':'; 1093 $terms = self::get_terms_from_query(); 1094 $tax = $terms ? get_taxonomy( $terms[0]->taxonomy ) : false; 1095 if ( ! $tax ) { 1096 return $prefix; 1097 } 1098 return ( 1 === count( $terms ) ? $tax->labels->singular_name : $tax->labels->name ) . ':'; 1075 1099 } 1076 1100 return $prefix; … … 1287 1311 * @type string $verb The verb or action, such as 'Liked'. Default the slug. 1288 1312 * @type string $property Microformats 2 property, such as 'like-of'. Default empty. 1289 * @type array $properties The fields for the kind. See Kind_Fields. 1313 * @type array $properties The fields for the kind, keyed by property. See Kind_Fields. A 1314 * 'name' field means the kind has a title. 1290 1315 * @type string $format Post format that maps to this kind. Default 'standard'. 1291 1316 * @type string $icon Icon name. Default the slug. … … 1293 1318 * @type string $description_url Link to more information. 1294 1319 * @type string $shortlink Shortlink code for the kind. 1295 * @type bool $title Whether the kind should have an explicit title. 1320 * @type bool $title Deprecated since 4.0.2: add a name field to the properties 1321 * instead (Kind_Fields::title_field()). True adds one. 1296 1322 * @type bool $show Whether to show the kind in Settings. Default false. 1297 1323 * } -
indieweb-post-kinds/trunk/includes/class-post-kind.php
r3738687 r3810578 88 88 89 89 /** 90 * Whether the kind should have an explicit title. 91 * 92 * @since 3.1.0 90 * Whether the kind has a title: whether its properties include a name field. 91 * 92 * @since 3.1.0 93 * @deprecated 4.0.2 A kind has a title when its properties include 'name'. 94 * Read for compatibility; it reflects the properties. 93 95 * @var bool 94 96 */ … … 170 172 ); 171 173 $args = wp_parse_args( $args, $defaults ); 174 if ( ! is_array( $args['properties'] ?? null ) ) { 175 $args['properties'] = array(); 176 } 177 if ( array_key_exists( 'title', $args ) ) { 178 _deprecated_argument( 179 'register_post_kind', 180 '4.0.2', 181 esc_html__( 'The title argument is deprecated. A kind has a title when its properties include a name field, such as Kind_Fields::title_field().', 'indieweb-post-kinds' ) 182 ); 183 if ( $args['title'] && ! isset( $args['properties']['name'] ) ) { 184 $args['properties'] = array_merge( array( 'name' => Kind_Fields::title_field() ), $args['properties'] ); 185 } 186 unset( $args['title'] ); 187 } 172 188 foreach ( $args as $property_name => $property_value ) { 173 189 if ( 'extra' !== $property_name && property_exists( $this, $property_name ) ) { … … 177 193 } 178 194 } 195 $this->title = isset( $this->properties['name'] ); 179 196 } 180 197 -
indieweb-post-kinds/trunk/includes/register-kinds.php
r3738687 r3810578 19 19 'verb' => ' ', 20 20 'property' => '', 21 'properties' => array(), 21 'properties' => array( 22 'name' => Kind_Fields::title_field(), 23 ), 22 24 'format' => '', 23 25 'description' => __( 'traditional long form content: a post with an explicit title and body', 'indieweb-post-kinds' ), 24 26 'description_url' => 'http://indieweb.org/article', 25 27 'shortlink' => 'b', 26 'title' => true,27 28 'show' => true, 28 29 ) … … 41 42 'description_url' => 'http://indieweb.org/note', 42 43 'shortlink' => 't', 43 'title' => false,44 44 'show' => false, 45 45 ) … … 54 54 'property' => 'in-reply-to', 55 55 'properties' => array( 56 'in-reply-to' => array( 57 'type' => 'cite', 58 'label' => __( 'In Reply To', 'indieweb-post-kinds' ), 59 'properties' => array( 60 'name' => array( 61 'type' => 'text', 62 'label' => __( 'Name', 'indieweb-post-kinds' ), 63 ), 64 'url' => array( 65 'type' => 'url', 66 'label' => __( 'URL', 'indieweb-post-kinds' ), 67 ), 68 'author' => array( 69 'type' => 'author', 70 'label' => __( 71 'Author', 72 'indieweb-post-kinds' 73 ), 74 ), 75 'summary' => array( 76 'type' => 'textarea', 77 'label' => __( 'Summary', 'indieweb-post-kinds' ), 78 ), 79 'publication' => array( 80 'type' => 'text', 81 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 82 ), 83 'published' => array( 84 'type' => 'datetime', 85 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 86 ), 87 'updated' => array( 88 'type' => 'datetime', 89 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 90 ), 91 'category' => array( 92 'type' => 'list', 93 'label' => __( 94 'Tags', 95 'indieweb-post-kinds' 96 ), 97 ), 98 'featured' => array( 99 'type' => 'url', 100 'label' => __( 101 'Featured Media', 102 'indieweb-post-kinds' 103 ), 104 ), 105 ), 106 ), 56 'in-reply-to' => Kind_Fields::cite_field( __( 'In Reply To', 'indieweb-post-kinds' ) ), 107 57 ), 108 58 'format' => 'link', … … 110 60 'description_url' => 'http://indieweb.org/reply', 111 61 'shortlink' => 't', 112 'title' => false,113 62 'show' => true, 114 63 ) … … 123 72 'property' => 'repost-of', 124 73 'properties' => array( 125 'repost-of' => array( 126 'type' => 'cite', 127 'label' => __( 'Repost', 'indieweb-post-kinds' ), 128 'properties' => array( 129 'name' => array( 130 'type' => 'text', 131 'label' => __( 'Name', 'indieweb-post-kinds' ), 132 ), 133 'url' => array( 134 'type' => 'url', 135 'label' => __( 'URL', 'indieweb-post-kinds' ), 136 ), 137 'author' => array( 138 'type' => 'author', 139 'label' => __( 140 'Author', 141 'indieweb-post-kinds' 142 ), 143 ), 144 'summary' => array( 145 'type' => 'textarea', 146 'label' => __( 'Summary', 'indieweb-post-kinds' ), 147 ), 148 'publication' => array( 149 'type' => 'text', 150 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 151 ), 152 'published' => array( 153 'type' => 'datetime', 154 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 155 ), 156 'updated' => array( 157 'type' => 'datetime', 158 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 159 ), 160 'category' => array( 161 'type' => 'list', 162 'label' => __( 163 'Tags', 164 'indieweb-post-kinds' 165 ), 166 ), 167 'featured' => array( 168 'type' => 'url', 169 'label' => __( 170 'Featured Media', 171 'indieweb-post-kinds' 172 ), 173 ), 174 ), 175 ), 74 'repost-of' => Kind_Fields::cite_field( __( 'Repost', 'indieweb-post-kinds' ) ), 176 75 ), 177 76 'format' => '', … … 179 78 'description_url' => 'http://indieweb.org/repost', 180 79 'shortlink' => 'b', 181 'title' => true,182 80 'show' => true, 183 81 ) … … 192 90 'property' => 'like-of', 193 91 'properties' => array( 194 'like-of' => array( 195 'type' => 'cite', 196 'label' => __( 'Like', 'indieweb-post-kinds' ), 197 'properties' => array( 198 'name' => array( 199 'type' => 'text', 200 'label' => __( 'Name', 'indieweb-post-kinds' ), 201 ), 202 'url' => array( 203 'type' => 'url', 204 'label' => __( 'URL', 'indieweb-post-kinds' ), 205 ), 206 'author' => array( 207 'type' => 'author', 208 'label' => __( 209 'Author', 210 'indieweb-post-kinds' 211 ), 212 ), 213 'summary' => array( 214 'type' => 'textarea', 215 'label' => __( 'Summary', 'indieweb-post-kinds' ), 216 ), 217 'publication' => array( 218 'type' => 'text', 219 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 220 ), 221 'published' => array( 222 'type' => 'datetime', 223 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 224 ), 225 'updated' => array( 226 'type' => 'datetime', 227 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 228 ), 229 'category' => array( 230 'type' => 'list', 231 'label' => __( 232 'Tags', 233 'indieweb-post-kinds' 234 ), 235 ), 236 'featured' => array( 237 'type' => 'url', 238 'label' => __( 239 'Featured Media', 240 'indieweb-post-kinds' 241 ), 242 ), 243 ), 244 ), 92 'like-of' => Kind_Fields::cite_field( __( 'Like', 'indieweb-post-kinds' ) ), 245 93 ), 246 94 'format' => 'link', … … 248 96 'description_url' => 'http://indieweb.org/like', 249 97 'shortlink' => 'f', 250 'title' => false,251 98 'show' => true, 252 99 ) … … 261 108 'property' => 'favorite-of', 262 109 'properties' => array( 263 'favorite-of' => array( 264 'type' => 'cite', 265 'label' => __( 'Favorited', 'indieweb-post-kinds' ), 266 'properties' => array( 267 'name' => array( 268 'type' => 'text', 269 'label' => __( 'Name', 'indieweb-post-kinds' ), 270 ), 271 'url' => array( 272 'type' => 'url', 273 'label' => __( 'URL', 'indieweb-post-kinds' ), 274 ), 275 'author' => array( 276 'type' => 'author', 277 'label' => __( 278 'Author', 279 'indieweb-post-kinds' 280 ), 281 ), 282 'summary' => array( 283 'type' => 'textarea', 284 'label' => __( 'Summary', 'indieweb-post-kinds' ), 285 ), 286 'publication' => array( 287 'type' => 'text', 288 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 289 ), 290 'published' => array( 291 'type' => 'datetime', 292 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 293 ), 294 'updated' => array( 295 'type' => 'datetime', 296 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 297 ), 298 'category' => array( 299 'type' => 'list', 300 'label' => __( 301 'Tags', 302 'indieweb-post-kinds' 303 ), 304 ), 305 'featured' => array( 306 'type' => 'url', 307 'label' => __( 308 'Featured Media', 309 'indieweb-post-kinds' 310 ), 311 ), 312 ), 313 ), 110 'favorite-of' => Kind_Fields::cite_field( __( 'Favorited', 'indieweb-post-kinds' ) ), 314 111 ), 315 112 'format' => 'link', … … 317 114 'description_url' => 'http://indieweb.org/favorite', 318 115 'shortlink' => 'f', 319 'title' => false,320 116 'show' => true, 321 117 ) … … 330 126 'property' => 'bookmark-of', 331 127 'properties' => array( 332 'bookmark-of' => array( 333 'type' => 'cite', 334 'label' => __( 'Bookmark', 'indieweb-post-kinds' ), 335 'properties' => array( 336 'name' => array( 337 'type' => 'text', 338 'label' => __( 'Name', 'indieweb-post-kinds' ), 339 ), 340 'url' => array( 341 'type' => 'url', 342 'label' => __( 'URL', 'indieweb-post-kinds' ), 343 ), 344 'author' => array( 345 'type' => 'author', 346 'label' => __( 347 'Author', 348 'indieweb-post-kinds' 349 ), 350 ), 351 'summary' => array( 352 'type' => 'textarea', 353 'label' => __( 'Summary', 'indieweb-post-kinds' ), 354 ), 355 'publication' => array( 356 'type' => 'text', 357 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 358 ), 359 'published' => array( 360 'type' => 'datetime', 361 'label' => __( 'Publish Date', 'indieweb-post-kinds' ), 362 ), 363 'updated' => array( 364 'type' => 'datetime', 365 'label' => __( 'Updated Time', 'indieweb-post-kinds' ), 366 ), 367 'category' => array( 368 'type' => 'list', 369 'label' => __( 370 'Tags', 371 'indieweb-post-kinds' 372 ), 373 ), 374 'featured' => array( 375 'type' => 'url', 376 'label' => __( 377 'Featured Media', 378 'indieweb-post-kinds' 379 ), 380 ), 381 ), 382 ), 128 'bookmark-of' => Kind_Fields::cite_field( __( 'Bookmark', 'indieweb-post-kinds' ) ), 383 129 ), 384 130 'format' => 'link', … … 386 132 'description_url' => 'http://indieweb.org/bookmark', 387 133 'shortlink' => 'h', 388 'title' => false,389 134 'show' => true, 390 135 ) … … 402 147 'description_url' => 'http://indieweb.org/photo', 403 148 'shortlink' => 'p', 404 'title' => false,405 149 'show' => true, 406 150 ) … … 418 162 'description_url' => 'http://indieweb.org/video', 419 163 'shortlink' => 'a', 420 'title' => false,421 164 'show' => true, 422 165 ) … … 434 177 'description_url' => 'http://indieweb.org/audio', 435 178 'shortlink' => 'a', 436 'title' => false,437 179 'show' => true, 438 180 ) … … 450 192 'description_url' => 'http://indieweb.org/tag', 451 193 'shortlink' => 'd', 452 'title' => false,453 194 'show' => false, 454 195 ) … … 463 204 'property' => 'in-reply-to', 464 205 'properties' => array( 465 'rsvp' => array( 466 'type' => 'select', 467 'options' => array( 468 'yes' => __( 'Yes', 'indieweb-post-kinds' ), 469 'no' => __( 'No', 'indieweb-post-kinds' ), 470 'maybe' => __( 'Maybe', 'indieweb-post-kinds' ), 471 'interested' => __( 'Interested', 'indieweb-post-kinds' ), 472 'remote' => __( 'Remote', 'indieweb-post-kinds' ), 473 ), 474 ), 475 'in-reply-to' => array( 476 'type' => 'cite', 477 'label' => __( 'Event Details', 'indieweb-post-kinds' ), 478 'properties' => array( 479 'name' => array( 480 'type' => 'text', 481 'label' => __( 'Name', 'indieweb-post-kinds' ), 482 ), 483 'url' => array( 484 'type' => 'url', 485 'label' => __( 'URL', 'indieweb-post-kinds' ), 486 ), 487 'summary' => array( 488 'type' => 'textarea', 489 'label' => __( 'Summary', 'indieweb-post-kinds' ), 490 ), 491 'publication' => array( 492 'type' => 'text', 493 'label' => __( 'Publication/Website', 'indieweb-post-kinds' ), 494 ), 495 'start' => array( 206 'rsvp' => Kind_Fields::rsvp_field(), 207 'in-reply-to' => Kind_Fields::cite_field( 208 __( 'Event Details', 'indieweb-post-kinds' ), 209 array( 210 'author' => false, 211 'published' => false, 212 'updated' => false, 213 'start' => array( 496 214 'type' => 'datetime', 497 215 'label' => __( 'Start Date', 'indieweb-post-kinds' ), 498 216 ), 499 'end' => array(217 'end' => array( 500 218 'type' => 'datetime', 501 219 'label' => __( 'End Date', 'indieweb-post-kinds' ), 502 220 ), 503 'category' => array( 504 'type' => 'list', 505 'label' => __( 506 'Tags', 507 'indieweb-post-kinds' 508 ), 509 ), 510 'featured' => array( 511 'type' => 'url', 512 'label' => __( 513 'Featured Media', 514 'indieweb-post-kinds' 515 ), 516 ), 517 ), 221 ) 518 222 ), 519 223 ), … … 522 226 'description_url' => 'http://indieweb.org/rsvp', 523 227 'shortlink' => 't', 524 'title' => false,525 228 'show' => true, 526 229 ) … … 534 237 'verb' => __( 'Listened', 'indieweb-post-kinds' ), 535 238 'property' => 'listen-of', 536 'properties' => array( 537 'listen-of' => array( 538 'type' => 'cite', 539 'label' => __( 'Listen To', 'indieweb-post-kinds' ), 540 'properties' => array( 541 'name' => array( 542 'type' => 'text', 543 'label' => __( 'Name', 'indieweb-post-kinds' ), 544 ), 545 'url' => array( 546 'type' => 'url', 547 'label' => __( 'URL', 'indieweb-post-kinds' ), 548 ), 549 'author' => array( 550 'type' => 'author', 551 'label' => __( 552 'Artist', 553 'indieweb-post-kinds' 554 ), 555 ), 556 'summary' => array( 557 'type' => 'textarea', 558 'label' => __( 'Summary', 'indieweb-post-kinds' ), 559 ), 560 'publication' => array( 561 'type' => 'text', 562 'label' => __( 'Album', 'indieweb-post-kinds' ), 563 ), 564 'published' => array( 565 'type' => 'datetime', 566 'label' => __( 'Release Date', 'indieweb-post-kinds' ), 567 ), 568 'category' => array( 569 'type' => 'list', 570 'label' => __( 571 'Tags', 572 'indieweb-post-kinds' 573 ), 574 ), 575 'featured' => array( 576 'type' => 'url', 577 'label' => __( 578 'Album Art', 579 'indieweb-post-kinds' 580 ), 581 ), 239 'properties' => array_merge( 240 array( 241 'listen-of' => Kind_Fields::cite_field( 242 __( 'Listen To', 'indieweb-post-kinds' ), 243 array( 244 'author' => array( 'label' => __( 'Artist', 'indieweb-post-kinds' ) ), 245 'publication' => array( 'label' => __( 'Album', 'indieweb-post-kinds' ) ), 246 'published' => array( 'label' => __( 'Release Date', 'indieweb-post-kinds' ) ), 247 'updated' => false, 248 'featured' => array( 'label' => __( 'Album Art', 'indieweb-post-kinds' ) ), 249 ) 582 250 ), 251 'rating' => Kind_Fields::rating_field(), 583 252 ), 253 Kind_Fields::time_fields() 584 254 ), 585 255 'format' => 'audio', … … 587 257 'description_url' => 'http://indieweb.org/listen', 588 258 'shortlink' => 'x', 589 'title' => false,590 259 'show' => true, 591 260 ) … … 599 268 'verb' => __( 'Watched', 'indieweb-post-kinds' ), 600 269 'property' => 'watch-of', 601 'properties' => array( 602 'watch-of' => array( 603 'type' => 'cite', 604 'label' => __( 'Watching To', 'indieweb-post-kinds' ), 605 'properties' => array( 606 'name' => array( 607 'type' => 'text', 608 'label' => __( 'Name', 'indieweb-post-kinds' ), 609 ), 610 'url' => array( 611 'type' => 'url', 612 'label' => __( 'URL', 'indieweb-post-kinds' ), 613 ), 614 'author' => array( 615 'type' => 'author', 616 'label' => __( 617 'Artist', 618 'indieweb-post-kinds' 619 ), 620 ), 621 'summary' => array( 622 'type' => 'textarea', 623 'label' => __( 'Summary', 'indieweb-post-kinds' ), 624 ), 625 'publication' => array( 626 'type' => 'text', 627 'label' => __( 'Series', 'indieweb-post-kinds' ), 628 ), 629 'published' => array( 630 'type' => 'datetime', 631 'label' => __( 'Release Date', 'indieweb-post-kinds' ), 632 ), 633 'category' => array( 634 'type' => 'list', 635 'label' => __( 636 'Tags', 637 'indieweb-post-kinds' 638 ), 639 ), 640 'featured' => array( 641 'type' => 'url', 642 'label' => __( 643 'Poster', 644 'indieweb-post-kinds' 645 ), 646 ), 270 'properties' => array_merge( 271 array( 272 'watch-of' => Kind_Fields::cite_field( 273 __( 'Watching To', 'indieweb-post-kinds' ), 274 array( 275 'author' => array( 'label' => __( 'Artist', 'indieweb-post-kinds' ) ), 276 'publication' => array( 'label' => __( 'Series', 'indieweb-post-kinds' ) ), 277 'published' => array( 'label' => __( 'Release Date', 'indieweb-post-kinds' ) ), 278 'updated' => false, 279 'featured' => array( 'label' => __( 'Poster', 'indieweb-post-kinds' ) ), 280 ) 647 281 ), 282 'rating' => Kind_Fields::rating_field(), 648 283 ), 284 Kind_Fields::time_fields() 649 285 ), 650 286 'format' => 'video', … … 652 288 'description_url' => 'http://indieweb.org/watch', 653 289 'shortlink' => 'x', 654 'title' => false,655 290 'show' => true, 656 291 ) … … 664 299 'verb' => __( 'Checked into', 'indieweb-post-kinds' ), 665 300 'property' => 'checkin', 301 // A place reference, like a citation. Location details are left to Simple Location when it's active (#553). 666 302 'properties' => array( 667 303 'checkin' => array( 668 304 'type' => 'venue', 669 305 'label' => __( 'Checked In', 'indieweb-post-kinds' ), 670 'properties' => array( 671 'name' => array( 672 'type' => 'name', 673 'label' => __( 'Name', 'indieweb-post-kinds' ), 674 ), 675 'url' => array( 676 'type' => 'url', 677 'label' => __( 'URL', 'indieweb-post-kinds' ), 678 ), 679 'latitude' => array( 680 'type' => 'number', 681 'label' => __( 682 'Latitude', 683 'indieweb-post-kinds' 684 ), 685 'step' => 0.0000001, 686 ), 687 'longitude' => array( 688 'type' => 'number', 689 'label' => __( 690 'Longitude', 691 'indieweb-post-kinds' 692 ), 693 'step' => 0.0000001, 694 ), 695 'street-address' => array( 696 'type' => 'text', 697 'label' => __( 'Street Address', 'indieweb-post-kinds' ), 698 ), 699 'locality' => array( 700 'type' => 'text', 701 'label' => __( 'Locality', 'indieweb-post-kinds' ), 702 ), 703 'region' => array( 704 'type' => 'text', 705 'label' => __( 'Region', 'indieweb-post-kinds' ), 706 ), 707 'country-name' => array( 708 'type' => 'text', 709 'label' => __( 'Country Name', 'indieweb-post-kinds' ), 710 ), 711 'postal-code' => array( 712 'type' => 'text', 713 'label' => __( 'Postal Code', 'indieweb-post-kinds' ), 714 ), 715 ), 306 'required' => true, 307 'properties' => wp_array_slice_assoc( Kind_Fields::cite_properties(), array( 'name', 'url' ) ), 716 308 ), 717 309 ), … … 720 312 'description_url' => 'http://indieweb.org/checkin', 721 313 'shortlink' => 'g', 722 'title' => false,723 314 'show' => true, 724 315 ) … … 736 327 'description_url' => '', 737 328 'shortlink' => 'f', 738 'title' => false,739 329 'show' => false, 740 330 ) … … 748 338 'verb' => __( 'Played', 'indieweb-post-kinds' ), 749 339 'property' => 'play-of', 340 'properties' => array_merge( 341 array( 342 'play-of' => Kind_Fields::cite_field( __( 'Played', 'indieweb-post-kinds' ) ), 343 'rating' => Kind_Fields::rating_field(), 344 ), 345 Kind_Fields::time_fields() 346 ), 750 347 'format' => 'status', 751 348 'description' => __( 'playing a game', 'indieweb-post-kinds' ), 752 349 'description_url' => 'https://indieweb.org/game_play', 753 350 'shortlink' => 'x', 754 'title' => false,755 351 'show' => true, 756 352 ) … … 768 364 'description_url' => 'https://indieweb.org/weather', 769 365 'shortlink' => 'u', 770 'title' => false,771 366 'show' => false, 772 367 ) … … 784 379 'description_url' => 'https://indieweb.org/exercise', 785 380 'shortlink' => 'm', 786 'title' => false,787 381 'show' => false, 788 382 ) … … 800 394 'description_url' => 'https://indieweb.org/trip', 801 395 'shortlink' => 'e', 802 'title' => false,803 396 'show' => false, 804 397 ) … … 816 409 'description_url' => 'https://indieweb.org/trip', 817 410 'shortlink' => 'e', 818 'title' => false,819 411 'show' => false, 820 412 ) … … 829 421 'verb' => __( 'Ate', 'indieweb-post-kinds' ), 830 422 'property' => 'ate', 423 'properties' => array( 424 'ate' => Kind_Fields::cite_field( __( 'Ate', 'indieweb-post-kinds' ) ), 425 'rating' => Kind_Fields::rating_field(), 426 ), 831 427 'format' => 'status', 832 428 'description' => __( 'what you are eating, perhaps for a food diary', 'indieweb-post-kinds' ), 833 429 'description_url' => 'https://indieweb.org/food', 834 430 'shortlink' => 'u', 835 'title' => false,836 431 'show' => true, 837 432 ) … … 846 441 'verb' => __( 'Drank', 'indieweb-post-kinds' ), 847 442 'property' => 'drank', 443 'properties' => array( 444 'drank' => Kind_Fields::cite_field( __( 'Drank', 'indieweb-post-kinds' ) ), 445 'rating' => Kind_Fields::rating_field(), 446 ), 848 447 'format' => 'status', 849 448 'description' => __( 'what you are drinking, perhaps for a food dairy', 'indieweb-post-kinds' ), 850 449 'description_url' => 'https://indieweb.org/food', 851 450 'shortlink' => 'u', 852 'title' => false,853 451 'show' => true, 854 452 ) … … 867 465 'description_url' => 'https://indieweb.org/follow', 868 466 'shortlink' => 'f', 869 'title' => false,870 467 'show' => false, 871 468 ) … … 880 477 'verb' => __( 'Listened to', 'indieweb-post-kinds' ), 881 478 'property' => 'jam-of', 479 'properties' => array_merge( 480 array( 481 'jam-of' => Kind_Fields::cite_field( 482 __( 'Listened to', 'indieweb-post-kinds' ), 483 array( 484 'author' => array( 'label' => __( 'Artist', 'indieweb-post-kinds' ) ), 485 'publication' => array( 'label' => __( 'Album', 'indieweb-post-kinds' ) ), 486 'published' => array( 'label' => __( 'Release Date', 'indieweb-post-kinds' ) ), 487 'updated' => false, 488 'featured' => array( 'label' => __( 'Album Art', 'indieweb-post-kinds' ) ), 489 ) 490 ), 491 'rating' => Kind_Fields::rating_field(), 492 ), 493 Kind_Fields::time_fields() 494 ), 882 495 'format' => 'audio', 883 496 'description' => __( 'a particularly personally meaningful song (a listen with added emphasis)', 'indieweb-post-kinds' ), 884 497 'description_url' => 'https://indieweb.org/jam', 885 498 'shortlink' => 'f', 886 'title' => false,887 499 'show' => true, 888 500 ) … … 897 509 'verb' => __( 'Read', 'indieweb-post-kinds' ), 898 510 'property' => 'read-of', 511 'properties' => array_merge( 512 array( 513 'read-of' => Kind_Fields::cite_field( __( 'Read', 'indieweb-post-kinds' ) ), 514 'read-status' => Kind_Fields::read_status_field(), 515 'rating' => Kind_Fields::rating_field(), 516 ), 517 Kind_Fields::time_fields() 518 ), 899 519 'format' => 'status', 900 520 'description' => __( 'reading a book, magazine, newspaper, other physical document, or online post', 'indieweb-post-kinds' ), 901 521 'description_url' => 'https://indieweb.org/read', 902 522 'shortlink' => 'x', 903 'title' => false,904 523 'show' => true, 905 524 ) … … 914 533 'verb' => __( 'Quoted', 'indieweb-post-kinds' ), 915 534 'property' => 'quotation-of', 535 'properties' => array( 536 'quotation-of' => Kind_Fields::cite_field( __( 'Quoted', 'indieweb-post-kinds' ) ), 537 ), 916 538 'format' => 'quote', 917 539 'description' => __( 'quoted content', 'indieweb-post-kinds' ), 918 540 'description_url' => 'https://indieweb.org/quote', 919 541 'shortlink' => 't', 920 'title' => false,921 542 'show' => true, 922 543 ) … … 935 556 'description_url' => 'https://indieweb.org/mood', 936 557 'shortlink' => 't', 937 'title' => false,938 558 'show' => false, 939 559 ) … … 948 568 'verb' => __( 'Cooked', 'indieweb-post-kinds' ), 949 569 'property' => 'recipe', 570 'properties' => array( 571 'name' => Kind_Fields::title_field(), 572 ), 950 573 'format' => '', 951 574 'description' => __( 'list of ingredients and directions for making food or drink', 'indieweb-post-kinds' ), 952 575 'description_url' => 'https://indieweb.org/recipe', 953 576 'shortlink' => 'b', 954 'title' => true,955 577 'show' => false, 956 578 ) … … 965 587 'verb' => __( 'Filed an Issue', 'indieweb-post-kinds' ), 966 588 'property' => 'in-reply-to', 589 'properties' => array( 590 'name' => Kind_Fields::title_field(), 591 'in-reply-to' => Kind_Fields::cite_field( __( 'In Reply To', 'indieweb-post-kinds' ) ), 592 ), 967 593 'format' => '', 968 594 'description' => __( 'Issue is a special kind of article post that is a reply to typically some source code, though potentially anything at a source control repository.', 'indieweb-post-kinds' ), 969 595 'description_url' => 'https://indieweb.org/issue', 970 596 'shortlink' => 't', 971 'title' => true,972 597 'show' => true, 973 598 ) … … 986 611 'description_url' => 'https://indieweb.org/question', 987 612 'shortlink' => 'q', 988 'title' => false,989 613 'show' => false, 990 614 ) … … 1003 627 'description_url' => 'https://indieweb.org/sleep', 1004 628 'shortlink' => 'm', 1005 'title' => false,1006 629 'show' => false, 1007 630 ) … … 1016 639 'verb' => __( 'Planned', 'indieweb-post-kinds' ), 1017 640 'property' => 'event', 641 'properties' => array( 642 'name' => Kind_Fields::title_field(), 643 ), 1018 644 'format' => '', 1019 645 'description' => __( 'An event is a type of post that in addition to a post name (event title) has a start datetime (likely end datetime), and a location.', 'indieweb-post-kinds' ), 1020 646 'description_url' => 'https://indieweb.org/event', 1021 647 'shortlink' => 'e', 1022 'title' => true,1023 648 'show' => false, 1024 649 ) … … 1032 657 'verb' => __( 'Reviewed', 'indieweb-post-kinds' ), 1033 658 'property' => 'review-of', 659 'properties' => array( 660 'review-of' => Kind_Fields::cite_field( __( 'Reviewed', 'indieweb-post-kinds' ) ), 661 'rating' => Kind_Fields::rating_field(), 662 ), 1034 663 'format' => '', 1035 664 'description' => __( 'A review is a post evaluating a product or service, usually involving a written description, sometimes with summary numerical evaluations, also known as just a rating.', 'indieweb-post-kinds' ), 1036 665 'description_url' => 'https://indieweb.org/review', 1037 666 'shortlink' => 't', 1038 'title' => false,1039 667 'show' => true, 1040 668 ) … … 1053 681 'description_url' => 'http://indieweb.org/acquisition', 1054 682 'shortlink' => 'f', 1055 'title' => false,1056 683 'show' => false, 1057 684 ) … … 1065 692 'verb' => __( 'Crafted', 'indieweb-post-kinds' ), 1066 693 'property' => 'craft-of', 694 'properties' => array( 695 'craft-of' => Kind_Fields::cite_field( __( 'Crafted', 'indieweb-post-kinds' ) ), 696 ), 1067 697 'format' => 'status', 1068 698 'description' => __( 'Activities like knitting, crocheting, cross stitch, wood working, restoration, 3d printing...the activity of building something.', 'indieweb-post-kinds' ), 1069 699 'description_url' => 'https://indieweb.org/crafts', 1070 700 'shortlink' => 'x', 1071 'title' => false, 1072 'show' => true, 1073 ) 1074 ); 701 'show' => true, 702 ) 703 ); -
indieweb-post-kinds/trunk/includes/time-functions.php
r3738687 r3810578 123 123 if ( ! function_exists( 'tz_timezone_to_seconds' ) ) { 124 124 /** 125 * Returns a time zone's UTC offset in seconds. 125 * Returns a time zone's current UTC offset in seconds. 126 * 127 * The offset of a named time zone depends on the date, because of daylight 128 * saving time, so it is the offset now. 126 129 * 127 130 * @since 3.2.2 128 * 129 * @param string $timezone Time zone name or offset string. 131 * @since 4.0.2 Works: it used to fail on every call. 132 * 133 * @param string $timezone Time zone name or offset string, such as 'America/New_York' or '-05:00'. 130 134 * @return int|false Offset in seconds, or false if the time zone is not valid. 131 135 */ 132 136 function tz_timezone_to_seconds( $timezone ) { 133 $tz = timezone_open( $timezone ); 134 if ( $tz ) { 135 return $tz->getOffset(); 136 } 137 return false; 137 if ( ! is_string( $timezone ) || '' === trim( $timezone ) ) { 138 return false; 139 } 140 try { 141 $tz = new DateTimeZone( trim( $timezone ) ); 142 } catch ( Exception $e ) { 143 return false; 144 } 145 return $tz->getOffset( new DateTime( 'now', $tz ) ); 138 146 } 139 147 } -
indieweb-post-kinds/trunk/indieweb-post-kinds.php
r3771941 r3810578 8 8 * Plugin URI: https://wordpress.org/plugins/indieweb-post-kinds/ 9 9 * Description: Ever want to reply to someone else's post with a post on your own site? Or to "like" someone else's post, but with your own site? 10 * Version: 4.0. 110 * Version: 4.0.2 11 11 * Requires at least: 6.2 12 12 * Requires PHP: 7.4 -
indieweb-post-kinds/trunk/languages/indieweb-post-kinds.pot
r3771941 r3810578 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Post Kinds 4.0. 1\n"5 "Project-Id-Version: Post Kinds 4.0.2\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieweb-post-kinds\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2026-1 0-29T01:48:12+00:00\n"12 "POT-Creation-Date: 2026-11-19T03:09:43+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.12.0\n" … … 147 147 msgstr "" 148 148 149 #: includes/class-kind-fields.php: 39149 #: includes/class-kind-fields.php:49 150 150 msgid "(GMT-11:00) Niue" 151 151 msgstr "" 152 152 153 #: includes/class-kind-fields.php: 40153 #: includes/class-kind-fields.php:50 154 154 msgid "(GMT-11:00) Pago Pago" 155 155 msgstr "" 156 156 157 #: includes/class-kind-fields.php: 41157 #: includes/class-kind-fields.php:51 158 158 msgid "(GMT-10:00) Hawaii Time" 159 159 msgstr "" 160 160 161 #: includes/class-kind-fields.php: 42161 #: includes/class-kind-fields.php:52 162 162 msgid "(GMT-10:00) Rarotonga" 163 163 msgstr "" 164 164 165 #: includes/class-kind-fields.php: 43165 #: includes/class-kind-fields.php:53 166 166 msgid "(GMT-10:00) Tahiti" 167 167 msgstr "" 168 168 169 #: includes/class-kind-fields.php: 44169 #: includes/class-kind-fields.php:54 170 170 msgid "(GMT-09:30) Marquesas" 171 171 msgstr "" 172 172 173 #: includes/class-kind-fields.php: 45173 #: includes/class-kind-fields.php:55 174 174 msgid "(GMT-09:00) Alaska Time" 175 175 msgstr "" 176 176 177 #: includes/class-kind-fields.php: 46177 #: includes/class-kind-fields.php:56 178 178 msgid "(GMT-09:00) Gambier" 179 179 msgstr "" 180 180 181 #: includes/class-kind-fields.php: 47181 #: includes/class-kind-fields.php:57 182 182 msgid "(GMT-08:00) Pacific Time" 183 183 msgstr "" 184 184 185 #: includes/class-kind-fields.php: 48185 #: includes/class-kind-fields.php:58 186 186 msgid "(GMT-08:00) Pacific Time - Tijuana" 187 187 msgstr "" 188 188 189 #: includes/class-kind-fields.php: 49189 #: includes/class-kind-fields.php:59 190 190 msgid "(GMT-08:00) Pacific Time - Vancouver" 191 191 msgstr "" 192 192 193 #: includes/class-kind-fields.php: 50193 #: includes/class-kind-fields.php:60 194 194 msgid "(GMT-08:00) Pacific Time - Whitehorse" 195 195 msgstr "" 196 196 197 #: includes/class-kind-fields.php: 51197 #: includes/class-kind-fields.php:61 198 198 msgid "(GMT-08:00) Pitcairn" 199 199 msgstr "" 200 200 201 #: includes/class-kind-fields.php: 52201 #: includes/class-kind-fields.php:62 202 202 msgid "(GMT-07:00) Mountain Time - Dawson Creek" 203 203 msgstr "" 204 204 205 #: includes/class-kind-fields.php: 53205 #: includes/class-kind-fields.php:63 206 206 msgid "(GMT-07:00) Mountain Time" 207 207 msgstr "" 208 208 209 #: includes/class-kind-fields.php: 54209 #: includes/class-kind-fields.php:64 210 210 msgid "(GMT-07:00) Mountain Time - Edmonton" 211 211 msgstr "" 212 212 213 #: includes/class-kind-fields.php: 55213 #: includes/class-kind-fields.php:65 214 214 msgid "(GMT-07:00) Mountain Time - Hermosillo" 215 215 msgstr "" 216 216 217 #: includes/class-kind-fields.php: 56217 #: includes/class-kind-fields.php:66 218 218 msgid "(GMT-07:00) Mountain Time - Chihuahua, Mazatlan" 219 219 msgstr "" 220 220 221 #: includes/class-kind-fields.php: 57221 #: includes/class-kind-fields.php:67 222 222 msgid "(GMT-07:00) Mountain Time - Arizona" 223 223 msgstr "" 224 224 225 #: includes/class-kind-fields.php: 58225 #: includes/class-kind-fields.php:68 226 226 msgid "(GMT-07:00) Mountain Time - Yellowknife" 227 227 msgstr "" 228 228 229 #: includes/class-kind-fields.php: 59229 #: includes/class-kind-fields.php:69 230 230 msgid "(GMT-06:00) Belize" 231 231 msgstr "" 232 232 233 #: includes/class-kind-fields.php: 60233 #: includes/class-kind-fields.php:70 234 234 msgid "(GMT-06:00) Central Time" 235 235 msgstr "" 236 236 237 #: includes/class-kind-fields.php: 61237 #: includes/class-kind-fields.php:71 238 238 msgid "(GMT-06:00) Costa Rica" 239 239 msgstr "" 240 240 241 #: includes/class-kind-fields.php: 62241 #: includes/class-kind-fields.php:72 242 242 msgid "(GMT-06:00) El Salvador" 243 243 msgstr "" 244 244 245 #: includes/class-kind-fields.php: 63245 #: includes/class-kind-fields.php:73 246 246 msgid "(GMT-06:00) Guatemala" 247 247 msgstr "" 248 248 249 #: includes/class-kind-fields.php: 64249 #: includes/class-kind-fields.php:74 250 250 msgid "(GMT-06:00) Managua" 251 251 msgstr "" 252 252 253 #: includes/class-kind-fields.php: 65253 #: includes/class-kind-fields.php:75 254 254 msgid "(GMT-06:00) Central Time - Mexico City" 255 255 msgstr "" 256 256 257 #: includes/class-kind-fields.php: 66257 #: includes/class-kind-fields.php:76 258 258 msgid "(GMT-06:00) Central Time - Regina" 259 259 msgstr "" 260 260 261 #: includes/class-kind-fields.php: 67261 #: includes/class-kind-fields.php:77 262 262 msgid "(GMT-06:00) Central Time - Tegucigalpa" 263 263 msgstr "" 264 264 265 #: includes/class-kind-fields.php: 68265 #: includes/class-kind-fields.php:78 266 266 msgid "(GMT-06:00) Central Time - Winnipeg" 267 267 msgstr "" 268 268 269 #: includes/class-kind-fields.php: 69269 #: includes/class-kind-fields.php:79 270 270 msgid "(GMT-06:00) Galapagos" 271 271 msgstr "" 272 272 273 #: includes/class-kind-fields.php: 70273 #: includes/class-kind-fields.php:80 274 274 msgid "(GMT-05:00) Bogota" 275 275 msgstr "" 276 276 277 #: includes/class-kind-fields.php: 71277 #: includes/class-kind-fields.php:81 278 278 msgid "(GMT-05:00) America Cancun" 279 279 msgstr "" 280 280 281 #: includes/class-kind-fields.php: 72281 #: includes/class-kind-fields.php:82 282 282 msgid "(GMT-05:00) Cayman" 283 283 msgstr "" 284 284 285 #: includes/class-kind-fields.php: 73285 #: includes/class-kind-fields.php:83 286 286 msgid "(GMT-05:00) Guayaquil" 287 287 msgstr "" 288 288 289 #: includes/class-kind-fields.php: 74289 #: includes/class-kind-fields.php:84 290 290 msgid "(GMT-05:00) Havana" 291 291 msgstr "" 292 292 293 #: includes/class-kind-fields.php: 75293 #: includes/class-kind-fields.php:85 294 294 msgid "(GMT-05:00) Eastern Time - Iqaluit" 295 295 msgstr "" 296 296 297 #: includes/class-kind-fields.php: 76297 #: includes/class-kind-fields.php:86 298 298 msgid "(GMT-05:00) Jamaica" 299 299 msgstr "" 300 300 301 #: includes/class-kind-fields.php: 77301 #: includes/class-kind-fields.php:87 302 302 msgid "(GMT-05:00) Lima" 303 303 msgstr "" 304 304 305 #: includes/class-kind-fields.php: 78305 #: includes/class-kind-fields.php:88 306 306 msgid "(GMT-05:00) Nassau" 307 307 msgstr "" 308 308 309 #: includes/class-kind-fields.php: 79309 #: includes/class-kind-fields.php:89 310 310 msgid "(GMT-05:00) Eastern Time" 311 311 msgstr "" 312 312 313 #: includes/class-kind-fields.php: 80313 #: includes/class-kind-fields.php:90 314 314 msgid "(GMT-05:00) Panama" 315 315 msgstr "" 316 316 317 #: includes/class-kind-fields.php: 81317 #: includes/class-kind-fields.php:91 318 318 msgid "(GMT-05:00) Port-au-Prince" 319 319 msgstr "" 320 320 321 #: includes/class-kind-fields.php: 82321 #: includes/class-kind-fields.php:92 322 322 msgid "(GMT-05:00) Rio Branco" 323 323 msgstr "" 324 324 325 #: includes/class-kind-fields.php: 83325 #: includes/class-kind-fields.php:93 326 326 msgid "(GMT-05:00) Eastern Time - Toronto" 327 327 msgstr "" 328 328 329 #: includes/class-kind-fields.php: 84329 #: includes/class-kind-fields.php:94 330 330 msgid "(GMT-05:00) Easter Island" 331 331 msgstr "" 332 332 333 #: includes/class-kind-fields.php: 85333 #: includes/class-kind-fields.php:95 334 334 msgid "(GMT-04:30) Caracas" 335 335 msgstr "" 336 336 337 #: includes/class-kind-fields.php: 86337 #: includes/class-kind-fields.php:96 338 338 msgid "(GMT-03:00) Asuncion" 339 339 msgstr "" 340 340 341 #: includes/class-kind-fields.php: 87341 #: includes/class-kind-fields.php:97 342 342 msgid "(GMT-04:00) Barbados" 343 343 msgstr "" 344 344 345 #: includes/class-kind-fields.php: 88345 #: includes/class-kind-fields.php:98 346 346 msgid "(GMT-04:00) Boa Vista" 347 347 msgstr "" 348 348 349 #: includes/class-kind-fields.php: 89349 #: includes/class-kind-fields.php:99 350 350 msgid "(GMT-03:00) Campo Grande" 351 351 msgstr "" 352 352 353 #: includes/class-kind-fields.php: 90353 #: includes/class-kind-fields.php:100 354 354 msgid "(GMT-03:00) Cuiaba" 355 355 msgstr "" 356 356 357 #: includes/class-kind-fields.php: 91357 #: includes/class-kind-fields.php:101 358 358 msgid "(GMT-04:00) Curacao" 359 359 msgstr "" 360 360 361 #: includes/class-kind-fields.php: 92361 #: includes/class-kind-fields.php:102 362 362 msgid "(GMT-04:00) Grand Turk" 363 363 msgstr "" 364 364 365 #: includes/class-kind-fields.php: 93365 #: includes/class-kind-fields.php:103 366 366 msgid "(GMT-04:00) Guyana" 367 367 msgstr "" 368 368 369 #: includes/class-kind-fields.php: 94369 #: includes/class-kind-fields.php:104 370 370 msgid "(GMT-04:00) Atlantic Time - Halifax" 371 371 msgstr "" 372 372 373 #: includes/class-kind-fields.php: 95373 #: includes/class-kind-fields.php:105 374 374 msgid "(GMT-04:00) La Paz" 375 375 msgstr "" 376 376 377 #: includes/class-kind-fields.php: 96377 #: includes/class-kind-fields.php:106 378 378 msgid "(GMT-04:00) Manaus" 379 379 msgstr "" 380 380 381 #: includes/class-kind-fields.php: 97381 #: includes/class-kind-fields.php:107 382 382 msgid "(GMT-04:00) Martinique" 383 383 msgstr "" 384 384 385 #: includes/class-kind-fields.php: 98385 #: includes/class-kind-fields.php:108 386 386 msgid "(GMT-04:00) Port of Spain" 387 387 msgstr "" 388 388 389 #: includes/class-kind-fields.php: 99389 #: includes/class-kind-fields.php:109 390 390 msgid "(GMT-04:00) Porto Velho" 391 391 msgstr "" 392 392 393 #: includes/class-kind-fields.php:1 00393 #: includes/class-kind-fields.php:110 394 394 msgid "(GMT-04:00) Puerto Rico" 395 395 msgstr "" 396 396 397 #: includes/class-kind-fields.php:1 01397 #: includes/class-kind-fields.php:111 398 398 msgid "(GMT-04:00) Santo Domingo" 399 399 msgstr "" 400 400 401 #: includes/class-kind-fields.php:1 02401 #: includes/class-kind-fields.php:112 402 402 msgid "(GMT-04:00) Thule" 403 403 msgstr "" 404 404 405 #: includes/class-kind-fields.php:1 03405 #: includes/class-kind-fields.php:113 406 406 msgid "(GMT-04:00) Bermuda" 407 407 msgstr "" 408 408 409 #: includes/class-kind-fields.php:1 04409 #: includes/class-kind-fields.php:114 410 410 msgid "(GMT-03:30) Newfoundland Time - St. Johns" 411 411 msgstr "" 412 412 413 #: includes/class-kind-fields.php:1 05413 #: includes/class-kind-fields.php:115 414 414 msgid "(GMT-03:00) Araguaina" 415 415 msgstr "" 416 416 417 #: includes/class-kind-fields.php:1 06417 #: includes/class-kind-fields.php:116 418 418 msgid "(GMT-03:00) Buenos Aires" 419 419 msgstr "" 420 420 421 #: includes/class-kind-fields.php:1 07421 #: includes/class-kind-fields.php:117 422 422 msgid "(GMT-03:00) Salvador" 423 423 msgstr "" 424 424 425 #: includes/class-kind-fields.php:1 08425 #: includes/class-kind-fields.php:118 426 426 msgid "(GMT-03:00) Belem" 427 427 msgstr "" 428 428 429 #: includes/class-kind-fields.php:1 09429 #: includes/class-kind-fields.php:119 430 430 msgid "(GMT-03:00) Cayenne" 431 431 msgstr "" 432 432 433 #: includes/class-kind-fields.php:1 10433 #: includes/class-kind-fields.php:120 434 434 msgid "(GMT-03:00) Fortaleza" 435 435 msgstr "" 436 436 437 #: includes/class-kind-fields.php:1 11438 msgid "(GMT-0 3:00) Godthab"439 msgstr "" 440 441 #: includes/class-kind-fields.php:1 12437 #: includes/class-kind-fields.php:121 438 msgid "(GMT-02:00) Nuuk" 439 msgstr "" 440 441 #: includes/class-kind-fields.php:122 442 442 msgid "(GMT-03:00) Maceio" 443 443 msgstr "" 444 444 445 #: includes/class-kind-fields.php:1 13445 #: includes/class-kind-fields.php:123 446 446 msgid "(GMT-03:00) Miquelon" 447 447 msgstr "" 448 448 449 #: includes/class-kind-fields.php:1 14449 #: includes/class-kind-fields.php:124 450 450 msgid "(GMT-03:00) Montevideo" 451 451 msgstr "" 452 452 453 #: includes/class-kind-fields.php:1 15453 #: includes/class-kind-fields.php:125 454 454 msgid "(GMT-03:00) Paramaribo" 455 455 msgstr "" 456 456 457 #: includes/class-kind-fields.php:1 16457 #: includes/class-kind-fields.php:126 458 458 msgid "(GMT-03:00) Recife" 459 459 msgstr "" 460 460 461 #: includes/class-kind-fields.php:1 17461 #: includes/class-kind-fields.php:127 462 462 msgid "(GMT-03:00) Santiago" 463 463 msgstr "" 464 464 465 #: includes/class-kind-fields.php:1 18465 #: includes/class-kind-fields.php:128 466 466 msgid "(GMT-02:00) Sao Paulo" 467 467 msgstr "" 468 468 469 #: includes/class-kind-fields.php:1 19469 #: includes/class-kind-fields.php:129 470 470 msgid "(GMT-03:00) Palmer" 471 471 msgstr "" 472 472 473 #: includes/class-kind-fields.php:1 20473 #: includes/class-kind-fields.php:130 474 474 msgid "(GMT-03:00) Rothera" 475 475 msgstr "" 476 476 477 #: includes/class-kind-fields.php:1 21477 #: includes/class-kind-fields.php:131 478 478 msgid "(GMT-03:00) Stanley" 479 479 msgstr "" 480 480 481 #: includes/class-kind-fields.php:1 22481 #: includes/class-kind-fields.php:132 482 482 msgid "(GMT-02:00) Noronha" 483 483 msgstr "" 484 484 485 #: includes/class-kind-fields.php:1 23485 #: includes/class-kind-fields.php:133 486 486 msgid "(GMT-02:00) South Georgia" 487 487 msgstr "" 488 488 489 #: includes/class-kind-fields.php:1 24489 #: includes/class-kind-fields.php:134 490 490 msgid "(GMT-01:00) Scoresbysund" 491 491 msgstr "" 492 492 493 #: includes/class-kind-fields.php:1 25493 #: includes/class-kind-fields.php:135 494 494 msgid "(GMT-01:00) Azores" 495 495 msgstr "" 496 496 497 #: includes/class-kind-fields.php:1 26497 #: includes/class-kind-fields.php:136 498 498 msgid "(GMT-01:00) Cape Verde" 499 499 msgstr "" 500 500 501 #: includes/class-kind-fields.php:1 27501 #: includes/class-kind-fields.php:137 502 502 msgid "(GMT+00:00) Abidjan" 503 503 msgstr "" 504 504 505 #: includes/class-kind-fields.php:1 28505 #: includes/class-kind-fields.php:138 506 506 msgid "(GMT+00:00) Accra" 507 507 msgstr "" 508 508 509 #: includes/class-kind-fields.php:1 29509 #: includes/class-kind-fields.php:139 510 510 msgid "(GMT+00:00) Bissau" 511 511 msgstr "" 512 512 513 #: includes/class-kind-fields.php:1 30513 #: includes/class-kind-fields.php:140 514 514 msgid "(GMT+00:00) Casablanca" 515 515 msgstr "" 516 516 517 #: includes/class-kind-fields.php:1 31517 #: includes/class-kind-fields.php:141 518 518 msgid "(GMT+00:00) El Aaiun" 519 519 msgstr "" 520 520 521 #: includes/class-kind-fields.php:1 32521 #: includes/class-kind-fields.php:142 522 522 msgid "(GMT+00:00) Monrovia" 523 523 msgstr "" 524 524 525 #: includes/class-kind-fields.php:1 33525 #: includes/class-kind-fields.php:143 526 526 msgid "(GMT+00:00) Danmarkshavn" 527 527 msgstr "" 528 528 529 #: includes/class-kind-fields.php:1 34529 #: includes/class-kind-fields.php:144 530 530 msgid "(GMT+00:00) Canary Islands" 531 531 msgstr "" 532 532 533 #: includes/class-kind-fields.php:1 35533 #: includes/class-kind-fields.php:145 534 534 msgid "(GMT+00:00) Faeroe" 535 535 msgstr "" 536 536 537 #: includes/class-kind-fields.php:1 36537 #: includes/class-kind-fields.php:146 538 538 msgid "(GMT+00:00) Reykjavik" 539 539 msgstr "" 540 540 541 #: includes/class-kind-fields.php:1 37541 #: includes/class-kind-fields.php:147 542 542 msgid "(GMT+00:00) GMT (no daylight saving)" 543 543 msgstr "" 544 544 545 #: includes/class-kind-fields.php:1 38545 #: includes/class-kind-fields.php:148 546 546 msgid "(GMT+00:00) Dublin" 547 547 msgstr "" 548 548 549 #: includes/class-kind-fields.php:1 39549 #: includes/class-kind-fields.php:149 550 550 msgid "(GMT+00:00) Lisbon" 551 551 msgstr "" 552 552 553 #: includes/class-kind-fields.php:1 40553 #: includes/class-kind-fields.php:150 554 554 msgid "(GMT+00:00) London" 555 555 msgstr "" 556 556 557 #: includes/class-kind-fields.php:1 41557 #: includes/class-kind-fields.php:151 558 558 msgid "(GMT+01:00) Algiers" 559 559 msgstr "" 560 560 561 #: includes/class-kind-fields.php:1 42561 #: includes/class-kind-fields.php:152 562 562 msgid "(GMT+01:00) Ceuta" 563 563 msgstr "" 564 564 565 #: includes/class-kind-fields.php:1 43565 #: includes/class-kind-fields.php:153 566 566 msgid "(GMT+01:00) Lagos" 567 567 msgstr "" 568 568 569 #: includes/class-kind-fields.php:1 44569 #: includes/class-kind-fields.php:154 570 570 msgid "(GMT+01:00) Ndjamena" 571 571 msgstr "" 572 572 573 #: includes/class-kind-fields.php:1 45573 #: includes/class-kind-fields.php:155 574 574 msgid "(GMT+01:00) Tunis" 575 575 msgstr "" 576 576 577 #: includes/class-kind-fields.php:1 46577 #: includes/class-kind-fields.php:156 578 578 msgid "(GMT+02:00) Windhoek" 579 579 msgstr "" 580 580 581 #: includes/class-kind-fields.php:1 47581 #: includes/class-kind-fields.php:157 582 582 msgid "(GMT+01:00) Amsterdam" 583 583 msgstr "" 584 584 585 #: includes/class-kind-fields.php:1 48585 #: includes/class-kind-fields.php:158 586 586 msgid "(GMT+01:00) Andorra" 587 587 msgstr "" 588 588 589 #: includes/class-kind-fields.php:1 49589 #: includes/class-kind-fields.php:159 590 590 msgid "(GMT+01:00) Central European Time - Belgrade" 591 591 msgstr "" 592 592 593 #: includes/class-kind-fields.php:1 50593 #: includes/class-kind-fields.php:160 594 594 msgid "(GMT+01:00) Berlin" 595 595 msgstr "" 596 596 597 #: includes/class-kind-fields.php:1 51597 #: includes/class-kind-fields.php:161 598 598 msgid "(GMT+01:00) Brussels" 599 599 msgstr "" 600 600 601 #: includes/class-kind-fields.php:1 52601 #: includes/class-kind-fields.php:162 602 602 msgid "(GMT+01:00) Budapest" 603 603 msgstr "" 604 604 605 #: includes/class-kind-fields.php:1 53605 #: includes/class-kind-fields.php:163 606 606 msgid "(GMT+01:00) Copenhagen" 607 607 msgstr "" 608 608 609 #: includes/class-kind-fields.php:1 54609 #: includes/class-kind-fields.php:164 610 610 msgid "(GMT+01:00) Gibraltar" 611 611 msgstr "" 612 612 613 #: includes/class-kind-fields.php:1 55613 #: includes/class-kind-fields.php:165 614 614 msgid "(GMT+01:00) Luxembourg" 615 615 msgstr "" 616 616 617 #: includes/class-kind-fields.php:1 56617 #: includes/class-kind-fields.php:166 618 618 msgid "(GMT+01:00) Madrid" 619 619 msgstr "" 620 620 621 #: includes/class-kind-fields.php:1 57621 #: includes/class-kind-fields.php:167 622 622 msgid "(GMT+01:00) Malta" 623 623 msgstr "" 624 624 625 #: includes/class-kind-fields.php:1 58625 #: includes/class-kind-fields.php:168 626 626 msgid "(GMT+01:00) Monaco" 627 627 msgstr "" 628 628 629 #: includes/class-kind-fields.php:1 59629 #: includes/class-kind-fields.php:169 630 630 msgid "(GMT+01:00) Oslo" 631 631 msgstr "" 632 632 633 #: includes/class-kind-fields.php:1 60633 #: includes/class-kind-fields.php:170 634 634 msgid "(GMT+01:00) Paris" 635 635 msgstr "" 636 636 637 #: includes/class-kind-fields.php:1 61637 #: includes/class-kind-fields.php:171 638 638 msgid "(GMT+01:00) Central European Time - Prague" 639 639 msgstr "" 640 640 641 #: includes/class-kind-fields.php:1 62641 #: includes/class-kind-fields.php:172 642 642 msgid "(GMT+01:00) Rome" 643 643 msgstr "" 644 644 645 #: includes/class-kind-fields.php:1 63645 #: includes/class-kind-fields.php:173 646 646 msgid "(GMT+01:00) Stockholm" 647 647 msgstr "" 648 648 649 #: includes/class-kind-fields.php:1 64649 #: includes/class-kind-fields.php:174 650 650 msgid "(GMT+01:00) Tirane" 651 651 msgstr "" 652 652 653 #: includes/class-kind-fields.php:1 65653 #: includes/class-kind-fields.php:175 654 654 msgid "(GMT+01:00) Vienna" 655 655 msgstr "" 656 656 657 #: includes/class-kind-fields.php:1 66657 #: includes/class-kind-fields.php:176 658 658 msgid "(GMT+01:00) Warsaw" 659 659 msgstr "" 660 660 661 #: includes/class-kind-fields.php:1 67661 #: includes/class-kind-fields.php:177 662 662 msgid "(GMT+01:00) Zurich" 663 663 msgstr "" 664 664 665 #: includes/class-kind-fields.php:1 68665 #: includes/class-kind-fields.php:178 666 666 msgid "(GMT+02:00) Cairo" 667 667 msgstr "" 668 668 669 #: includes/class-kind-fields.php:1 69669 #: includes/class-kind-fields.php:179 670 670 msgid "(GMT+02:00) Johannesburg" 671 671 msgstr "" 672 672 673 #: includes/class-kind-fields.php:1 70673 #: includes/class-kind-fields.php:180 674 674 msgid "(GMT+02:00) Maputo" 675 675 msgstr "" 676 676 677 #: includes/class-kind-fields.php:1 71677 #: includes/class-kind-fields.php:181 678 678 msgid "(GMT+02:00) Tripoli" 679 679 msgstr "" 680 680 681 #: includes/class-kind-fields.php:1 72681 #: includes/class-kind-fields.php:182 682 682 msgid "(GMT+02:00) Amman" 683 683 msgstr "" 684 684 685 #: includes/class-kind-fields.php:1 73685 #: includes/class-kind-fields.php:183 686 686 msgid "(GMT+02:00) Beirut" 687 687 msgstr "" 688 688 689 #: includes/class-kind-fields.php:1 74689 #: includes/class-kind-fields.php:184 690 690 msgid "(GMT+02:00) Damascus" 691 691 msgstr "" 692 692 693 #: includes/class-kind-fields.php:1 75693 #: includes/class-kind-fields.php:185 694 694 msgid "(GMT+02:00) Gaza" 695 695 msgstr "" 696 696 697 #: includes/class-kind-fields.php:1 76697 #: includes/class-kind-fields.php:186 698 698 msgid "(GMT+02:00) Jerusalem" 699 699 msgstr "" 700 700 701 #: includes/class-kind-fields.php:1 77701 #: includes/class-kind-fields.php:187 702 702 msgid "(GMT+02:00) Nicosia" 703 703 msgstr "" 704 704 705 #: includes/class-kind-fields.php:1 78705 #: includes/class-kind-fields.php:188 706 706 msgid "(GMT+02:00) Athens" 707 707 msgstr "" 708 708 709 #: includes/class-kind-fields.php:1 79709 #: includes/class-kind-fields.php:189 710 710 msgid "(GMT+02:00) Bucharest" 711 711 msgstr "" 712 712 713 #: includes/class-kind-fields.php:1 80713 #: includes/class-kind-fields.php:190 714 714 msgid "(GMT+02:00) Chisinau" 715 715 msgstr "" 716 716 717 #: includes/class-kind-fields.php:1 81717 #: includes/class-kind-fields.php:191 718 718 msgid "(GMT+02:00) Helsinki" 719 719 msgstr "" 720 720 721 #: includes/class-kind-fields.php:1 82721 #: includes/class-kind-fields.php:192 722 722 msgid "(GMT+02:00) Istanbul" 723 723 msgstr "" 724 724 725 #: includes/class-kind-fields.php:1 83725 #: includes/class-kind-fields.php:193 726 726 msgid "(GMT+02:00) Moscow-01 - Kaliningrad" 727 727 msgstr "" 728 728 729 #: includes/class-kind-fields.php:1 84730 msgid "(GMT+02:00) K iev"731 msgstr "" 732 733 #: includes/class-kind-fields.php:1 85729 #: includes/class-kind-fields.php:194 730 msgid "(GMT+02:00) Kyiv" 731 msgstr "" 732 733 #: includes/class-kind-fields.php:195 734 734 msgid "(GMT+02:00) Riga" 735 735 msgstr "" 736 736 737 #: includes/class-kind-fields.php:1 86737 #: includes/class-kind-fields.php:196 738 738 msgid "(GMT+02:00) Sofia" 739 739 msgstr "" 740 740 741 #: includes/class-kind-fields.php:1 87741 #: includes/class-kind-fields.php:197 742 742 msgid "(GMT+02:00) Tallinn" 743 743 msgstr "" 744 744 745 #: includes/class-kind-fields.php:1 88745 #: includes/class-kind-fields.php:198 746 746 msgid "(GMT+02:00) Vilnius" 747 747 msgstr "" 748 748 749 #: includes/class-kind-fields.php:1 89749 #: includes/class-kind-fields.php:199 750 750 msgid "(GMT+03:00) Khartoum" 751 751 msgstr "" 752 752 753 #: includes/class-kind-fields.php: 190753 #: includes/class-kind-fields.php:200 754 754 msgid "(GMT+03:00) Nairobi" 755 755 msgstr "" 756 756 757 #: includes/class-kind-fields.php: 191757 #: includes/class-kind-fields.php:201 758 758 msgid "(GMT+03:00) Syowa" 759 759 msgstr "" 760 760 761 #: includes/class-kind-fields.php: 192761 #: includes/class-kind-fields.php:202 762 762 msgid "(GMT+03:00) Baghdad" 763 763 msgstr "" 764 764 765 #: includes/class-kind-fields.php: 193765 #: includes/class-kind-fields.php:203 766 766 msgid "(GMT+03:00) Qatar" 767 767 msgstr "" 768 768 769 #: includes/class-kind-fields.php: 194769 #: includes/class-kind-fields.php:204 770 770 msgid "(GMT+03:00) Riyadh" 771 771 msgstr "" 772 772 773 #: includes/class-kind-fields.php: 195773 #: includes/class-kind-fields.php:205 774 774 msgid "(GMT+03:00) Minsk" 775 775 msgstr "" 776 776 777 #: includes/class-kind-fields.php: 196777 #: includes/class-kind-fields.php:206 778 778 msgid "(GMT+03:00) Moscow+00 - Moscow" 779 779 msgstr "" 780 780 781 #: includes/class-kind-fields.php: 197781 #: includes/class-kind-fields.php:207 782 782 msgid "(GMT+03:30) Tehran" 783 783 msgstr "" 784 784 785 #: includes/class-kind-fields.php: 198785 #: includes/class-kind-fields.php:208 786 786 msgid "(GMT+04:00) Baku" 787 787 msgstr "" 788 788 789 #: includes/class-kind-fields.php: 199789 #: includes/class-kind-fields.php:209 790 790 msgid "(GMT+04:00) Dubai" 791 791 msgstr "" 792 792 793 #: includes/class-kind-fields.php:2 00793 #: includes/class-kind-fields.php:210 794 794 msgid "(GMT+04:00) Tbilisi" 795 795 msgstr "" 796 796 797 #: includes/class-kind-fields.php:2 01797 #: includes/class-kind-fields.php:211 798 798 msgid "(GMT+04:00) Yerevan" 799 799 msgstr "" 800 800 801 #: includes/class-kind-fields.php:2 02801 #: includes/class-kind-fields.php:212 802 802 msgid "(GMT+04:00) Moscow+01 - Samara" 803 803 msgstr "" 804 804 805 #: includes/class-kind-fields.php:2 03805 #: includes/class-kind-fields.php:213 806 806 msgid "(GMT+04:00) Mahe" 807 807 msgstr "" 808 808 809 #: includes/class-kind-fields.php:2 04809 #: includes/class-kind-fields.php:214 810 810 msgid "(GMT+04:00) Mauritius" 811 811 msgstr "" 812 812 813 #: includes/class-kind-fields.php:2 05813 #: includes/class-kind-fields.php:215 814 814 msgid "(GMT+04:00) Reunion" 815 815 msgstr "" 816 816 817 #: includes/class-kind-fields.php:2 06817 #: includes/class-kind-fields.php:216 818 818 msgid "(GMT+04:30) Kabul" 819 819 msgstr "" 820 820 821 #: includes/class-kind-fields.php:2 07821 #: includes/class-kind-fields.php:217 822 822 msgid "(GMT+05:00) Mawson" 823 823 msgstr "" 824 824 825 #: includes/class-kind-fields.php:2 08825 #: includes/class-kind-fields.php:218 826 826 msgid "(GMT+05:00) Aqtau" 827 827 msgstr "" 828 828 829 #: includes/class-kind-fields.php:2 09829 #: includes/class-kind-fields.php:219 830 830 msgid "(GMT+05:00) Aqtobe" 831 831 msgstr "" 832 832 833 #: includes/class-kind-fields.php:2 10833 #: includes/class-kind-fields.php:220 834 834 msgid "(GMT+05:00) Ashgabat" 835 835 msgstr "" 836 836 837 #: includes/class-kind-fields.php:2 11837 #: includes/class-kind-fields.php:221 838 838 msgid "(GMT+05:00) Dushanbe" 839 839 msgstr "" 840 840 841 #: includes/class-kind-fields.php:2 12841 #: includes/class-kind-fields.php:222 842 842 msgid "(GMT+05:00) Karachi" 843 843 msgstr "" 844 844 845 #: includes/class-kind-fields.php:2 13845 #: includes/class-kind-fields.php:223 846 846 msgid "(GMT+05:00) Tashkent" 847 847 msgstr "" 848 848 849 #: includes/class-kind-fields.php:2 14849 #: includes/class-kind-fields.php:224 850 850 msgid "(GMT+05:00) Moscow+02 - Yekaterinburg" 851 851 msgstr "" 852 852 853 #: includes/class-kind-fields.php:2 15853 #: includes/class-kind-fields.php:225 854 854 msgid "(GMT+05:00) Kerguelen" 855 855 msgstr "" 856 856 857 #: includes/class-kind-fields.php:2 16857 #: includes/class-kind-fields.php:226 858 858 msgid "(GMT+05:00) Maldives" 859 859 msgstr "" 860 860 861 #: includes/class-kind-fields.php:2 17861 #: includes/class-kind-fields.php:227 862 862 msgid "(GMT+05:30) India Standard Time" 863 863 msgstr "" 864 864 865 #: includes/class-kind-fields.php:2 18865 #: includes/class-kind-fields.php:228 866 866 msgid "(GMT+05:30) Colombo" 867 867 msgstr "" 868 868 869 #: includes/class-kind-fields.php:2 19870 msgid "(GMT+05:45) Kat mandu"871 msgstr "" 872 873 #: includes/class-kind-fields.php:2 20869 #: includes/class-kind-fields.php:229 870 msgid "(GMT+05:45) Kathmandu" 871 msgstr "" 872 873 #: includes/class-kind-fields.php:230 874 874 msgid "(GMT+06:00) Vostok" 875 875 msgstr "" 876 876 877 #: includes/class-kind-fields.php:2 21877 #: includes/class-kind-fields.php:231 878 878 msgid "(GMT+06:00) Almaty" 879 879 msgstr "" 880 880 881 #: includes/class-kind-fields.php:2 22881 #: includes/class-kind-fields.php:232 882 882 msgid "(GMT+06:00) Bishkek" 883 883 msgstr "" 884 884 885 #: includes/class-kind-fields.php:2 23885 #: includes/class-kind-fields.php:233 886 886 msgid "(GMT+06:00) Dhaka" 887 887 msgstr "" 888 888 889 #: includes/class-kind-fields.php:2 24889 #: includes/class-kind-fields.php:234 890 890 msgid "(GMT+06:00) Moscow+03 - Omsk, Novosibirsk" 891 891 msgstr "" 892 892 893 #: includes/class-kind-fields.php:2 25893 #: includes/class-kind-fields.php:235 894 894 msgid "(GMT+06:00) Thimphu" 895 895 msgstr "" 896 896 897 #: includes/class-kind-fields.php:2 26897 #: includes/class-kind-fields.php:236 898 898 msgid "(GMT+06:00) Chagos" 899 899 msgstr "" 900 900 901 #: includes/class-kind-fields.php:2 27902 msgid "(GMT+06:30) Rangoon"903 msgstr "" 904 905 #: includes/class-kind-fields.php:2 28901 #: includes/class-kind-fields.php:237 902 msgid "(GMT+06:30) Yangon" 903 msgstr "" 904 905 #: includes/class-kind-fields.php:238 906 906 msgid "(GMT+06:30) Cocos" 907 907 msgstr "" 908 908 909 #: includes/class-kind-fields.php:2 29909 #: includes/class-kind-fields.php:239 910 910 msgid "(GMT+07:00) Davis" 911 911 msgstr "" 912 912 913 #: includes/class-kind-fields.php:2 30913 #: includes/class-kind-fields.php:240 914 914 msgid "(GMT+07:00) Bangkok" 915 915 msgstr "" 916 916 917 #: includes/class-kind-fields.php:2 31917 #: includes/class-kind-fields.php:241 918 918 msgid "(GMT+07:00) Hovd" 919 919 msgstr "" 920 920 921 #: includes/class-kind-fields.php:2 32921 #: includes/class-kind-fields.php:242 922 922 msgid "(GMT+07:00) Jakarta" 923 923 msgstr "" 924 924 925 #: includes/class-kind-fields.php:2 33925 #: includes/class-kind-fields.php:243 926 926 msgid "(GMT+07:00) Moscow+04 - Krasnoyarsk" 927 927 msgstr "" 928 928 929 #: includes/class-kind-fields.php:234 930 msgid "(GMT+07:00) Hanoi" 931 msgstr "" 932 933 #: includes/class-kind-fields.php:235 929 #: includes/class-kind-fields.php:244 934 930 msgid "(GMT+07:00) Ho Chi Minh" 935 931 msgstr "" 936 932 937 #: includes/class-kind-fields.php:2 36933 #: includes/class-kind-fields.php:245 938 934 msgid "(GMT+07:00) Christmas" 939 935 msgstr "" 940 936 941 #: includes/class-kind-fields.php:2 37937 #: includes/class-kind-fields.php:246 942 938 msgid "(GMT+08:00) Casey" 943 939 msgstr "" 944 940 945 #: includes/class-kind-fields.php:2 38941 #: includes/class-kind-fields.php:247 946 942 msgid "(GMT+08:00) Brunei" 947 943 msgstr "" 948 944 949 #: includes/class-kind-fields.php:239 950 msgid "(GMT+08:00) Choibalsan" 951 msgstr "" 952 953 #: includes/class-kind-fields.php:240 945 #: includes/class-kind-fields.php:248 954 946 msgid "(GMT+08:00) Hong Kong" 955 947 msgstr "" 956 948 957 #: includes/class-kind-fields.php:24 1949 #: includes/class-kind-fields.php:249 958 950 msgid "(GMT+08:00) Moscow+05 - Irkutsk" 959 951 msgstr "" 960 952 961 #: includes/class-kind-fields.php:2 42953 #: includes/class-kind-fields.php:250 962 954 msgid "(GMT+08:00) Kuala Lumpur" 963 955 msgstr "" 964 956 965 #: includes/class-kind-fields.php:2 43957 #: includes/class-kind-fields.php:251 966 958 msgid "(GMT+08:00) Macau" 967 959 msgstr "" 968 960 969 #: includes/class-kind-fields.php:2 44961 #: includes/class-kind-fields.php:252 970 962 msgid "(GMT+08:00) Makassar" 971 963 msgstr "" 972 964 973 #: includes/class-kind-fields.php:2 45965 #: includes/class-kind-fields.php:253 974 966 msgid "(GMT+08:00) Manila" 975 967 msgstr "" 976 968 977 #: includes/class-kind-fields.php:2 46969 #: includes/class-kind-fields.php:254 978 970 msgid "(GMT+08:00) China Time - Beijing" 979 971 msgstr "" 980 972 981 #: includes/class-kind-fields.php:2 47973 #: includes/class-kind-fields.php:255 982 974 msgid "(GMT+08:00) Singapore" 983 975 msgstr "" 984 976 985 #: includes/class-kind-fields.php:2 48977 #: includes/class-kind-fields.php:256 986 978 msgid "(GMT+08:00) Taipei" 987 979 msgstr "" 988 980 989 #: includes/class-kind-fields.php:2 49981 #: includes/class-kind-fields.php:257 990 982 msgid "(GMT+08:00) Ulaanbaatar" 991 983 msgstr "" 992 984 993 #: includes/class-kind-fields.php:25 0985 #: includes/class-kind-fields.php:258 994 986 msgid "(GMT+08:00) Western Time - Perth" 995 987 msgstr "" 996 988 997 #: includes/class-kind-fields.php:25 1989 #: includes/class-kind-fields.php:259 998 990 msgid "(GMT+08:30) Pyongyang" 999 991 msgstr "" 1000 992 1001 #: includes/class-kind-fields.php:2 52993 #: includes/class-kind-fields.php:260 1002 994 msgid "(GMT+09:00) Dili" 1003 995 msgstr "" 1004 996 1005 #: includes/class-kind-fields.php:2 53997 #: includes/class-kind-fields.php:261 1006 998 msgid "(GMT+09:00) Jayapura" 1007 999 msgstr "" 1008 1000 1009 #: includes/class-kind-fields.php:2 541001 #: includes/class-kind-fields.php:262 1010 1002 msgid "(GMT+09:00) Seoul" 1011 1003 msgstr "" 1012 1004 1013 #: includes/class-kind-fields.php:2 551005 #: includes/class-kind-fields.php:263 1014 1006 msgid "(GMT+09:00) Tokyo" 1015 1007 msgstr "" 1016 1008 1017 #: includes/class-kind-fields.php:2 561009 #: includes/class-kind-fields.php:264 1018 1010 msgid "(GMT+09:00) Moscow+06 - Yakutsk" 1019 1011 msgstr "" 1020 1012 1021 #: includes/class-kind-fields.php:2 571013 #: includes/class-kind-fields.php:265 1022 1014 msgid "(GMT+09:00) Palau" 1023 1015 msgstr "" 1024 1016 1025 #: includes/class-kind-fields.php:2 581017 #: includes/class-kind-fields.php:266 1026 1018 msgid "(GMT+10:30) Central Time - Adelaide" 1027 1019 msgstr "" 1028 1020 1029 #: includes/class-kind-fields.php:2 591021 #: includes/class-kind-fields.php:267 1030 1022 msgid "(GMT+09:30) Central Time - Darwin" 1031 1023 msgstr "" 1032 1024 1033 #: includes/class-kind-fields.php:26 11025 #: includes/class-kind-fields.php:269 1034 1026 msgid "(GMT+10:00) Moscow+07 - Magadan" 1035 1027 msgstr "" 1036 1028 1037 #: includes/class-kind-fields.php:2 621029 #: includes/class-kind-fields.php:270 1038 1030 msgid "(GMT+10:00) Moscow+07 - Yuzhno-Sakhalinsk" 1039 1031 msgstr "" 1040 1032 1041 #: includes/class-kind-fields.php:2 631033 #: includes/class-kind-fields.php:271 1042 1034 msgid "(GMT+10:00) Eastern Time - Brisbane" 1043 1035 msgstr "" 1044 1036 1045 #: includes/class-kind-fields.php:2 641037 #: includes/class-kind-fields.php:272 1046 1038 msgid "(GMT+11:00) Eastern Time - Hobart" 1047 1039 msgstr "" 1048 1040 1049 #: includes/class-kind-fields.php:2 651041 #: includes/class-kind-fields.php:273 1050 1042 msgid "(GMT+11:00) Eastern Time - Melbourne, Sydney" 1051 1043 msgstr "" 1052 1044 1053 #: includes/class-kind-fields.php:2 661045 #: includes/class-kind-fields.php:274 1054 1046 msgid "(GMT+10:00) Truk" 1055 1047 msgstr "" 1056 1048 1057 #: includes/class-kind-fields.php:2 671049 #: includes/class-kind-fields.php:275 1058 1050 msgid "(GMT+10:00) Guam" 1059 1051 msgstr "" 1060 1052 1061 #: includes/class-kind-fields.php:2 681053 #: includes/class-kind-fields.php:276 1062 1054 msgid "(GMT+10:00) Port Moresby" 1063 1055 msgstr "" 1064 1056 1065 #: includes/class-kind-fields.php:2 691057 #: includes/class-kind-fields.php:277 1066 1058 msgid "(GMT+11:00) Efate" 1067 1059 msgstr "" 1068 1060 1069 #: includes/class-kind-fields.php:27 01061 #: includes/class-kind-fields.php:278 1070 1062 msgid "(GMT+11:00) Guadalcanal" 1071 1063 msgstr "" 1072 1064 1073 #: includes/class-kind-fields.php:27 11065 #: includes/class-kind-fields.php:279 1074 1066 msgid "(GMT+11:00) Kosrae" 1075 1067 msgstr "" 1076 1068 1077 #: includes/class-kind-fields.php:2 721069 #: includes/class-kind-fields.php:280 1078 1070 msgid "(GMT+11:00) Norfolk" 1079 1071 msgstr "" 1080 1072 1081 #: includes/class-kind-fields.php:2 731073 #: includes/class-kind-fields.php:281 1082 1074 msgid "(GMT+11:00) Noumea" 1083 1075 msgstr "" 1084 1076 1085 #: includes/class-kind-fields.php:2 741077 #: includes/class-kind-fields.php:282 1086 1078 msgid "(GMT+11:00) Ponape" 1087 1079 msgstr "" 1088 1080 1089 #: includes/class-kind-fields.php:2 751081 #: includes/class-kind-fields.php:283 1090 1082 msgid "(GMT+12:00) Moscow+09 - Petropavlovsk-Kamchatskiy" 1091 1083 msgstr "" 1092 1084 1093 #: includes/class-kind-fields.php:2 761085 #: includes/class-kind-fields.php:284 1094 1086 msgid "(GMT+13:00) Auckland" 1095 1087 msgstr "" 1096 1088 1097 #: includes/class-kind-fields.php:2 771089 #: includes/class-kind-fields.php:285 1098 1090 msgid "(GMT+13:00) Fiji" 1099 1091 msgstr "" 1100 1092 1101 #: includes/class-kind-fields.php:2 781093 #: includes/class-kind-fields.php:286 1102 1094 msgid "(GMT+12:00) Funafuti" 1103 1095 msgstr "" 1104 1096 1105 #: includes/class-kind-fields.php:2 791097 #: includes/class-kind-fields.php:287 1106 1098 msgid "(GMT+12:00) Kwajalein" 1107 1099 msgstr "" 1108 1100 1109 #: includes/class-kind-fields.php:28 01101 #: includes/class-kind-fields.php:288 1110 1102 msgid "(GMT+12:00) Majuro" 1111 1103 msgstr "" 1112 1104 1113 #: includes/class-kind-fields.php:28 11105 #: includes/class-kind-fields.php:289 1114 1106 msgid "(GMT+12:00) Nauru" 1115 1107 msgstr "" 1116 1108 1117 #: includes/class-kind-fields.php:2 821109 #: includes/class-kind-fields.php:290 1118 1110 msgid "(GMT+12:00) Tarawa" 1119 1111 msgstr "" 1120 1112 1121 #: includes/class-kind-fields.php:2 831113 #: includes/class-kind-fields.php:291 1122 1114 msgid "(GMT+12:00) Wake" 1123 1115 msgstr "" 1124 1116 1125 #: includes/class-kind-fields.php:2 841117 #: includes/class-kind-fields.php:292 1126 1118 msgid "(GMT+12:00) Wallis" 1127 1119 msgstr "" 1128 1120 1129 #: includes/class-kind-fields.php:2 851121 #: includes/class-kind-fields.php:293 1130 1122 msgid "(GMT+14:00) Apia" 1131 1123 msgstr "" 1132 1124 1133 #: includes/class-kind-fields.php:2 861134 msgid "(GMT+13:00) Enderbury"1135 msgstr "" 1136 1137 #: includes/class-kind-fields.php:2 871125 #: includes/class-kind-fields.php:294 1126 msgid "(GMT+13:00) Kanton" 1127 msgstr "" 1128 1129 #: includes/class-kind-fields.php:295 1138 1130 msgid "(GMT+13:00) Fakaofo" 1139 1131 msgstr "" 1140 1132 1141 #: includes/class-kind-fields.php:2 881133 #: includes/class-kind-fields.php:296 1142 1134 msgid "(GMT+13:00) Tongatapu" 1143 1135 msgstr "" 1144 1136 1145 #: includes/class-kind-fields.php:2 891137 #: includes/class-kind-fields.php:297 1146 1138 msgid "(GMT+14:00) Kiritimati" 1147 1139 msgstr "" 1148 1140 1149 #: includes/class-kind-fields.php:396 1141 #: includes/class-kind-fields.php:427 1142 #: templates/reply-time.php:21 1143 msgid "Years" 1144 msgstr "" 1145 1146 #: includes/class-kind-fields.php:428 1147 #: templates/reply-time.php:25 1148 msgid "Months" 1149 msgstr "" 1150 1151 #: includes/class-kind-fields.php:429 1152 #: templates/reply-time.php:29 1153 msgid "Days" 1154 msgstr "" 1155 1156 #: includes/class-kind-fields.php:430 1157 #: templates/reply-time.php:35 1158 msgid "Hours" 1159 msgstr "" 1160 1161 #: includes/class-kind-fields.php:431 1162 #: templates/reply-time.php:39 1163 msgid "Minutes" 1164 msgstr "" 1165 1166 #: includes/class-kind-fields.php:432 1167 #: templates/reply-time.php:43 1168 msgid "Seconds" 1169 msgstr "" 1170 1171 #: includes/class-kind-fields.php:463 1150 1172 msgid "Author Name" 1151 1173 msgstr "" 1152 1174 1153 #: includes/class-kind-fields.php:4 001175 #: includes/class-kind-fields.php:467 1154 1176 #: templates/reply-author.php:26 1155 1177 msgid "Author URL" 1156 1178 msgstr "" 1157 1179 1158 #: includes/class-kind-fields.php:4 041180 #: includes/class-kind-fields.php:471 1159 1181 msgid "Author Photo" 1160 1182 msgstr "" 1161 1183 1184 #: includes/class-kind-fields.php:493 1185 #: templates/reply-metabox.php:56 1186 msgid "Name" 1187 msgstr "" 1188 1189 #: includes/class-kind-fields.php:497 1190 #: templates/reply-metabox.php:50 1191 msgid "URL" 1192 msgstr "" 1193 1194 #: includes/class-kind-fields.php:501 1195 #: templates/reply-author.php:20 1196 #: templates/reply-metabox.php:45 1197 msgid "Author" 1198 msgstr "" 1199 1200 #: includes/class-kind-fields.php:505 1201 msgid "Summary" 1202 msgstr "" 1203 1204 #: includes/class-kind-fields.php:509 1205 msgid "Publication/Website" 1206 msgstr "" 1207 1208 #: includes/class-kind-fields.php:513 1209 msgid "Publish Date" 1210 msgstr "" 1211 1212 #: includes/class-kind-fields.php:517 1213 msgid "Updated Time" 1214 msgstr "" 1215 1216 #: includes/class-kind-fields.php:521 1217 #: includes/register-kinds.php:187 1218 msgid "Tags" 1219 msgstr "" 1220 1221 #: includes/class-kind-fields.php:525 1222 msgid "Featured Media" 1223 msgstr "" 1224 1225 #: includes/class-kind-fields.php:567 1226 msgid "Title" 1227 msgstr "" 1228 1229 #: includes/class-kind-fields.php:581 1230 #: includes/class-kind-metabox.php:422 1231 msgid "Rating" 1232 msgstr "" 1233 1234 #: includes/class-kind-fields.php:583 1235 #: includes/class-kind-metabox.php:346 1236 msgid "Very Dissatisfied" 1237 msgstr "" 1238 1239 #: includes/class-kind-fields.php:584 1240 #: includes/class-kind-metabox.php:347 1241 msgid "Dissatisfied" 1242 msgstr "" 1243 1244 #: includes/class-kind-fields.php:585 1245 #: includes/class-kind-metabox.php:348 1246 msgid "Neutral" 1247 msgstr "" 1248 1249 #: includes/class-kind-fields.php:586 1250 #: includes/class-kind-metabox.php:349 1251 msgid "Satisfied" 1252 msgstr "" 1253 1254 #: includes/class-kind-fields.php:587 1255 #: includes/class-kind-metabox.php:350 1256 msgid "Very Satisfied" 1257 msgstr "" 1258 1259 #: includes/class-kind-fields.php:603 1260 #: includes/class-kind-metabox.php:404 1261 #: includes/register-kinds.php:201 1262 #: views/kind.php:81 1263 msgid "RSVP" 1264 msgstr "" 1265 1266 #: includes/class-kind-fields.php:606 1267 #: includes/class-kind-metabox.php:376 1268 msgid "Yes" 1269 msgstr "" 1270 1271 #: includes/class-kind-fields.php:607 1272 #: includes/class-kind-metabox.php:377 1273 msgid "No" 1274 msgstr "" 1275 1276 #: includes/class-kind-fields.php:608 1277 #: includes/class-kind-metabox.php:378 1278 msgid "Maybe" 1279 msgstr "" 1280 1281 #: includes/class-kind-fields.php:609 1282 #: includes/class-kind-metabox.php:379 1283 msgid "Interested" 1284 msgstr "" 1285 1286 #: includes/class-kind-fields.php:610 1287 #: includes/class-kind-metabox.php:380 1288 msgid "Remote" 1289 msgstr "" 1290 1291 #: includes/class-kind-fields.php:625 1292 msgid "Read Status" 1293 msgstr "" 1294 1295 #: includes/class-kind-fields.php:627 1296 msgid "Want to Read" 1297 msgstr "" 1298 1299 #: includes/class-kind-fields.php:628 1300 msgid "Reading" 1301 msgstr "" 1302 1303 #: includes/class-kind-fields.php:629 1304 msgid "Finished Reading" 1305 msgstr "" 1306 1307 #: includes/class-kind-fields.php:645 1308 #: includes/register-kinds.php:215 1309 msgid "Start Date" 1310 msgstr "" 1311 1312 #: includes/class-kind-fields.php:649 1313 #: includes/register-kinds.php:219 1314 msgid "End Date" 1315 msgstr "" 1316 1317 #: includes/class-kind-fields.php:653 1318 #: templates/reply-time.php:18 1319 msgid "Duration" 1320 msgstr "" 1321 1162 1322 #: includes/class-kind-media-metadata.php:125 1163 #: includes/register-kinds.php:551 1164 #: includes/register-kinds.php:616 1323 #: includes/register-kinds.php:244 1324 #: includes/register-kinds.php:275 1325 #: includes/register-kinds.php:484 1165 1326 msgid "Artist" 1166 1327 msgstr "" … … 1233 1394 msgstr "" 1234 1395 1235 #: includes/class-kind-metabox.php:3461236 msgid "Very Dissatisfied"1237 msgstr ""1238 1239 #: includes/class-kind-metabox.php:3471240 msgid "Dissatisfied"1241 msgstr ""1242 1243 #: includes/class-kind-metabox.php:3481244 msgid "Neutral"1245 msgstr ""1246 1247 #: includes/class-kind-metabox.php:3491248 msgid "Satisfied"1249 msgstr ""1250 1251 #: includes/class-kind-metabox.php:3501252 msgid "Very Satisfied"1253 msgstr ""1254 1255 #: includes/class-kind-metabox.php:3761256 #: includes/register-kinds.php:4681257 msgid "Yes"1258 msgstr ""1259 1260 #: includes/class-kind-metabox.php:3771261 #: includes/register-kinds.php:4691262 msgid "No"1263 msgstr ""1264 1265 #: includes/class-kind-metabox.php:3781266 #: includes/register-kinds.php:4701267 msgid "Maybe"1268 msgstr ""1269 1270 #: includes/class-kind-metabox.php:3791271 #: includes/register-kinds.php:4711272 msgid "Interested"1273 msgstr ""1274 1275 #: includes/class-kind-metabox.php:3801276 #: includes/register-kinds.php:4721277 msgid "Remote"1278 msgstr ""1279 1280 #: includes/class-kind-metabox.php:4041281 #: includes/register-kinds.php:4601282 #: views/kind.php:811283 msgid "RSVP"1284 msgstr ""1285 1286 #: includes/class-kind-metabox.php:4221287 msgid "Rating"1288 msgstr ""1289 1290 1396 #: includes/class-kind-metabox.php:461 1291 1397 msgid "Response Properties" … … 1321 1427 msgstr "" 1322 1428 1323 #: includes/class-kind-taxonomy.php:6 091429 #: includes/class-kind-taxonomy.php:621 1324 1430 msgid "Post Kinds replaces the IndieWeb Taxonomy plugin. Deactivate IndieWeb Taxonomy, then activate Post Kinds." 1325 1431 msgstr "" 1326 1432 1327 #: includes/class-kind-taxonomy.php: 6971433 #: includes/class-kind-taxonomy.php:709 1328 1434 msgctxt "taxonomy general name" 1329 1435 msgid "Kinds" 1330 1436 msgstr "" 1331 1437 1332 #: includes/class-kind-taxonomy.php: 6981438 #: includes/class-kind-taxonomy.php:710 1333 1439 msgctxt "taxonomy singular name" 1334 1440 msgid "Kind" 1335 1441 msgstr "" 1336 1442 1337 #: includes/class-kind-taxonomy.php: 6991443 #: includes/class-kind-taxonomy.php:711 1338 1444 msgctxt "search locations" 1339 1445 msgid "Search Kinds" 1340 1446 msgstr "" 1341 1447 1342 #: includes/class-kind-taxonomy.php:7 001448 #: includes/class-kind-taxonomy.php:712 1343 1449 msgctxt "popular kinds" 1344 1450 msgid "Popular Kinds" 1345 1451 msgstr "" 1346 1452 1347 #: includes/class-kind-taxonomy.php:7 011453 #: includes/class-kind-taxonomy.php:713 1348 1454 msgctxt "all taxonomy items" 1349 1455 msgid "All Kinds" 1350 1456 msgstr "" 1351 1457 1352 #: includes/class-kind-taxonomy.php:7 021458 #: includes/class-kind-taxonomy.php:714 1353 1459 msgctxt "taxonomy parent item" 1354 1460 msgid "Parent Kind" 1355 1461 msgstr "" 1356 1462 1357 #: includes/class-kind-taxonomy.php:7 031463 #: includes/class-kind-taxonomy.php:715 1358 1464 msgctxt "taxonomy parent item with colon" 1359 1465 msgid "Parent Kind:" 1360 1466 msgstr "" 1361 1467 1362 #: includes/class-kind-taxonomy.php:7 041468 #: includes/class-kind-taxonomy.php:716 1363 1469 msgid "This will appear on archives as the description if your theme supports" 1364 1470 msgstr "" 1365 1471 1366 #: includes/class-kind-taxonomy.php:7 051472 #: includes/class-kind-taxonomy.php:717 1367 1473 msgctxt "edit taxonomy item" 1368 1474 msgid "Edit Kind" 1369 1475 msgstr "" 1370 1476 1371 #: includes/class-kind-taxonomy.php:7 061477 #: includes/class-kind-taxonomy.php:718 1372 1478 msgctxt "view taxonomy item" 1373 1479 msgid "View Kind" 1374 1480 msgstr "" 1375 1481 1376 #: includes/class-kind-taxonomy.php:7 071482 #: includes/class-kind-taxonomy.php:719 1377 1483 msgctxt "update taxonomy item" 1378 1484 msgid "Update Kind" 1379 1485 msgstr "" 1380 1486 1381 #: includes/class-kind-taxonomy.php:7 081487 #: includes/class-kind-taxonomy.php:720 1382 1488 msgctxt "add taxonomy item" 1383 1489 msgid "Add New Kind" 1384 1490 msgstr "" 1385 1491 1386 #: includes/class-kind-taxonomy.php:7 091492 #: includes/class-kind-taxonomy.php:721 1387 1493 msgctxt "new taxonomy item" 1388 1494 msgid "New Kind" 1389 1495 msgstr "" 1390 1496 1391 #: includes/class-kind-taxonomy.php:7 101497 #: includes/class-kind-taxonomy.php:722 1392 1498 msgctxt "separate kinds with commas" 1393 1499 msgid "Separate kinds with commas" 1394 1500 msgstr "" 1395 1501 1396 #: includes/class-kind-taxonomy.php:7 111502 #: includes/class-kind-taxonomy.php:723 1397 1503 msgctxt "add or remove items" 1398 1504 msgid "Add or remove kinds" 1399 1505 msgstr "" 1400 1506 1401 #: includes/class-kind-taxonomy.php:7 121507 #: includes/class-kind-taxonomy.php:724 1402 1508 msgctxt "choose most used" 1403 1509 msgid "Choose from the most used kinds" 1404 1510 msgstr "" 1405 1511 1406 #: includes/class-kind-taxonomy.php:7 131512 #: includes/class-kind-taxonomy.php:725 1407 1513 msgctxt "no kinds found" 1408 1514 msgid "No kinds found" 1409 1515 msgstr "" 1410 1516 1411 #: includes/class-kind-taxonomy.php:7 141517 #: includes/class-kind-taxonomy.php:726 1412 1518 msgctxt "no kinds" 1413 1519 msgid "No kinds" 1414 1520 msgstr "" 1415 1521 1416 #: includes/class-kind-taxonomy.php:7 151522 #: includes/class-kind-taxonomy.php:727 1417 1523 msgid "Back to Kinds" 1418 1524 msgstr "" 1419 1525 1420 #: includes/class-kind-taxonomy.php:7 161526 #: includes/class-kind-taxonomy.php:728 1421 1527 msgid "Kind Link" 1422 1528 msgstr "" 1423 1529 1424 #: includes/class-kind-taxonomy.php:7 171530 #: includes/class-kind-taxonomy.php:729 1425 1531 msgid "A link to a kind" 1426 1532 msgstr "" … … 1429 1535 #. translators: 1: Taxonomy. 2: Month name and year 1430 1536 #. translators: 1. Taxonomy . 1: Date 1431 #: includes/class-kind-taxonomy.php:11 141432 #: includes/class-kind-taxonomy.php:11 171433 #: includes/class-kind-taxonomy.php:11 201537 #: includes/class-kind-taxonomy.php:1138 1538 #: includes/class-kind-taxonomy.php:1141 1539 #: includes/class-kind-taxonomy.php:1144 1434 1540 #, php-format 1435 1541 msgid "%1$1s - %2$2s" … … 1437 1543 1438 1544 #. translators: 1: Taxonomy. Yearly archive title. 2: Year 1439 #: includes/class-kind-taxonomy.php:11 141545 #: includes/class-kind-taxonomy.php:1138 1440 1546 msgctxt "yearly archives date format" 1441 1547 msgid "Y" … … 1443 1549 1444 1550 #. translators: 1: Taxonomy. 2: Month name and year 1445 #: includes/class-kind-taxonomy.php:11 171551 #: includes/class-kind-taxonomy.php:1141 1446 1552 msgctxt "monthly archives date format" 1447 1553 msgid "F Y" … … 1449 1555 1450 1556 #. translators: 1. Taxonomy . 1: Date 1451 #: includes/class-kind-taxonomy.php:11 201557 #: includes/class-kind-taxonomy.php:1144 1452 1558 msgctxt "daily archives date format" 1453 1559 msgid "F j, Y" … … 1455 1561 1456 1562 #. translators: 1. Title 2. Translated term for Firehose Feed 1457 #: includes/class-kind-taxonomy.php:11 241563 #: includes/class-kind-taxonomy.php:1148 1458 1564 #, php-format 1459 1565 msgid "%1$s - %2$2s" … … 1461 1567 1462 1568 #. translators: 1. Title 2. Translated term for Firehose Feed 1463 #: includes/class-kind-taxonomy.php:11 241569 #: includes/class-kind-taxonomy.php:1148 1464 1570 msgid "Firehose" 1465 1571 msgstr "" 1466 1572 1467 1573 #. translators: 1: Title prefix. 2: Title. 1468 #: includes/class-kind-taxonomy.php:11 301574 #: includes/class-kind-taxonomy.php:1154 1469 1575 #, php-format 1470 1576 msgctxt "archive title" … … 1473 1579 1474 1580 #. translators: All 1475 #: includes/class-kind-taxonomy.php:14 551581 #: includes/class-kind-taxonomy.php:1481 1476 1582 #, php-format 1477 1583 msgid "All %1s" 1478 1584 msgstr "" 1479 1585 1480 #: includes/class-kind-taxonomy.php:16 471586 #: includes/class-kind-taxonomy.php:1673 1481 1587 msgid "Invalid post" 1482 1588 msgstr "" 1483 1589 1484 #: includes/class-kind-taxonomy.php:16 501590 #: includes/class-kind-taxonomy.php:1676 1485 1591 msgid "Invalid Kind" 1486 1592 msgstr "" 1487 1593 1488 #: includes/class-kind-taxonomy.php:16 701594 #: includes/class-kind-taxonomy.php:1696 1489 1595 msgid "Invalid post." 1490 1596 msgstr "" 1491 1597 1492 #: includes/class-kind-taxonomy.php:16 731598 #: includes/class-kind-taxonomy.php:1699 1493 1599 msgid "Sorry, you are not allowed to set the kind of this post." 1494 1600 msgstr "" … … 1613 1719 msgstr[1] "" 1614 1720 1721 #: includes/class-post-kind.php:181 1722 msgid "The title argument is deprecated. A kind has a title when its properties include a name field, such as Kind_Fields::title_field()." 1723 msgstr "" 1724 1615 1725 #: includes/register-kinds.php:17 1616 1726 msgid "Article" … … 1621 1731 msgstr "" 1622 1732 1623 #: includes/register-kinds.php:2 31733 #: includes/register-kinds.php:25 1624 1734 msgid "traditional long form content: a post with an explicit title and body" 1625 1735 msgstr "" 1626 1736 1627 #: includes/register-kinds.php:3 41737 #: includes/register-kinds.php:35 1628 1738 msgid "Note" 1629 1739 msgstr "" 1630 1740 1631 #: includes/register-kinds.php:3 51741 #: includes/register-kinds.php:36 1632 1742 msgid "Notes" 1633 1743 msgstr "" 1634 1744 1635 #: includes/register-kinds.php:4 01745 #: includes/register-kinds.php:41 1636 1746 msgid "short content: a post or status update with just plain content and typically without a title" 1637 1747 msgstr "" … … 1649 1759 msgstr "" 1650 1760 1651 #: includes/register-kinds.php:58 1761 #: includes/register-kinds.php:56 1762 #: includes/register-kinds.php:591 1652 1763 msgid "In Reply To" 1653 1764 msgstr "" 1654 1765 1655 #: includes/register-kinds.php:62 1766 #: includes/register-kinds.php:59 1767 msgid "a reply to content typically on another site" 1768 msgstr "" 1769 1770 #: includes/register-kinds.php:69 1771 #: includes/register-kinds.php:74 1772 msgid "Repost" 1773 msgstr "" 1774 1775 #: includes/register-kinds.php:70 1776 msgid "Reposts" 1777 msgstr "" 1778 1779 #: includes/register-kinds.php:71 1780 msgid "Reposted" 1781 msgstr "" 1782 1783 #: includes/register-kinds.php:77 1784 msgid "a complete reposting of content from another site" 1785 msgstr "" 1786 1787 #: includes/register-kinds.php:87 1788 #: includes/register-kinds.php:92 1789 msgid "Like" 1790 msgstr "" 1791 1792 #: includes/register-kinds.php:88 1793 msgid "Likes" 1794 msgstr "" 1795 1796 #: includes/register-kinds.php:89 1797 msgid "Liked" 1798 msgstr "" 1799 1800 #: includes/register-kinds.php:95 1801 msgid "a way to pay compliments to the original post/poster of external content" 1802 msgstr "" 1803 1804 #: includes/register-kinds.php:105 1805 msgid "Favorite" 1806 msgstr "" 1807 1808 #: includes/register-kinds.php:106 1809 msgid "Favorites" 1810 msgstr "" 1811 1812 #: includes/register-kinds.php:107 1813 #: includes/register-kinds.php:110 1814 msgid "Favorited" 1815 msgstr "" 1816 1817 #: includes/register-kinds.php:113 1818 msgid "special to the author" 1819 msgstr "" 1820 1821 #: includes/register-kinds.php:123 1822 #: includes/register-kinds.php:128 1823 msgid "Bookmark" 1824 msgstr "" 1825 1826 #: includes/register-kinds.php:124 1827 msgid "Bookmarks" 1828 msgstr "" 1829 1830 #: includes/register-kinds.php:125 1831 msgid "Bookmarked" 1832 msgstr "" 1833 1656 1834 #: includes/register-kinds.php:131 1657 #: includes/register-kinds.php:200 1658 #: includes/register-kinds.php:269 1835 msgid "storing a link/bookmark for personal use or sharing with others" 1836 msgstr "" 1837 1838 #: includes/register-kinds.php:141 1839 msgid "Photo" 1840 msgstr "" 1841 1842 #: includes/register-kinds.php:142 1843 msgid "Photos" 1844 msgstr "" 1845 1846 #: includes/register-kinds.php:146 1847 msgid "a post with an embedded image/photo as its primary focus" 1848 msgstr "" 1849 1850 #: includes/register-kinds.php:156 1851 msgid "Video" 1852 msgstr "" 1853 1854 #: includes/register-kinds.php:157 1855 msgid "Videos" 1856 msgstr "" 1857 1858 #: includes/register-kinds.php:161 1859 msgid "a post with an embedded video as its primary focus" 1860 msgstr "" 1861 1862 #: includes/register-kinds.php:171 1863 msgid "Audio" 1864 msgstr "" 1865 1866 #: includes/register-kinds.php:172 1867 msgid "Audios" 1868 msgstr "" 1869 1870 #: includes/register-kinds.php:176 1871 msgid "a post with an embedded audio file as its primary focus" 1872 msgstr "" 1873 1874 #: includes/register-kinds.php:186 1875 msgid "Tag" 1876 msgstr "" 1877 1878 #: includes/register-kinds.php:188 1879 msgid "Tagged" 1880 msgstr "" 1881 1882 #: includes/register-kinds.php:191 1883 msgid "allows you to tag a post as being of a specific category or tag, or for person tagging" 1884 msgstr "" 1885 1886 #: includes/register-kinds.php:202 1887 msgid "RSVPs" 1888 msgstr "" 1889 1890 #: includes/register-kinds.php:203 1891 msgid "RSVPed" 1892 msgstr "" 1893 1894 #: includes/register-kinds.php:208 1895 msgid "Event Details" 1896 msgstr "" 1897 1898 #: includes/register-kinds.php:225 1899 msgid "a specific type of reply regarding attendance of an event" 1900 msgstr "" 1901 1902 #: includes/register-kinds.php:235 1903 msgid "Listen" 1904 msgstr "" 1905 1906 #: includes/register-kinds.php:236 1907 msgid "Listens" 1908 msgstr "" 1909 1910 #: includes/register-kinds.php:237 1911 msgid "Listened" 1912 msgstr "" 1913 1914 #: includes/register-kinds.php:242 1915 msgid "Listen To" 1916 msgstr "" 1917 1918 #: includes/register-kinds.php:245 1919 #: includes/register-kinds.php:485 1920 msgid "Album" 1921 msgstr "" 1922 1923 #: includes/register-kinds.php:246 1924 #: includes/register-kinds.php:277 1925 #: includes/register-kinds.php:486 1926 msgid "Release Date" 1927 msgstr "" 1928 1929 #: includes/register-kinds.php:248 1930 #: includes/register-kinds.php:488 1931 msgid "Album Art" 1932 msgstr "" 1933 1934 #: includes/register-kinds.php:256 1935 msgid "listening to audio; sometimes called a scrobble" 1936 msgstr "" 1937 1938 #: includes/register-kinds.php:266 1939 msgid "Watch" 1940 msgstr "" 1941 1942 #: includes/register-kinds.php:267 1943 msgid "Watches" 1944 msgstr "" 1945 1946 #: includes/register-kinds.php:268 1947 msgid "Watched" 1948 msgstr "" 1949 1950 #: includes/register-kinds.php:273 1951 msgid "Watching To" 1952 msgstr "" 1953 1954 #: includes/register-kinds.php:276 1955 msgid "Series" 1956 msgstr "" 1957 1958 #: includes/register-kinds.php:279 1959 msgid "Poster" 1960 msgstr "" 1961 1962 #: includes/register-kinds.php:287 1963 msgid "watching a movie, television show, online video, play or other visual-based event" 1964 msgstr "" 1965 1966 #: includes/register-kinds.php:297 1967 msgid "Checkin" 1968 msgstr "" 1969 1970 #: includes/register-kinds.php:298 1971 msgid "Checkins" 1972 msgstr "" 1973 1974 #: includes/register-kinds.php:299 1975 msgid "Checked into" 1976 msgstr "" 1977 1978 #: includes/register-kinds.php:305 1979 msgid "Checked In" 1980 msgstr "" 1981 1982 #: includes/register-kinds.php:311 1983 msgid "identifying you are at a particular geographic location" 1984 msgstr "" 1985 1986 #: includes/register-kinds.php:321 1987 msgid "Wish" 1988 msgstr "" 1989 1990 #: includes/register-kinds.php:322 1991 msgid "Wishes" 1992 msgstr "" 1993 1994 #: includes/register-kinds.php:323 1995 msgid "Wished" 1996 msgstr "" 1997 1998 #: includes/register-kinds.php:326 1999 msgid "a post indicating a desire/wish. The archive of which would be a wishlist, such as a gift registry or similar" 2000 msgstr "" 2001 2002 #: includes/register-kinds.php:336 2003 msgid "Play" 2004 msgstr "" 2005 2006 #: includes/register-kinds.php:337 2007 msgid "Playing" 2008 msgstr "" 2009 1659 2010 #: includes/register-kinds.php:338 1660 #: includes/register-kinds.php:4811661 #: includes/register-kinds.php:5431662 #: includes/register-kinds.php:6081663 #: includes/register-kinds.php:6731664 #: templates/reply-metabox.php:561665 msgid "Name"1666 msgstr ""1667 1668 #: includes/register-kinds.php:661669 #: includes/register-kinds.php:1351670 #: includes/register-kinds.php:2041671 #: includes/register-kinds.php:2731672 2011 #: includes/register-kinds.php:342 1673 #: includes/register-kinds.php:485 1674 #: includes/register-kinds.php:547 1675 #: includes/register-kinds.php:612 2012 msgid "Played" 2013 msgstr "" 2014 2015 #: includes/register-kinds.php:348 2016 msgid "playing a game" 2017 msgstr "" 2018 2019 #: includes/register-kinds.php:358 2020 #: includes/register-kinds.php:359 2021 msgid "Weather" 2022 msgstr "" 2023 2024 #: includes/register-kinds.php:363 2025 msgid "current weather conditions" 2026 msgstr "" 2027 2028 #: includes/register-kinds.php:373 2029 #: includes/register-kinds.php:374 2030 msgid "Exercise" 2031 msgstr "" 2032 2033 #: includes/register-kinds.php:375 2034 msgid "Exercised" 2035 msgstr "" 2036 2037 #: includes/register-kinds.php:378 2038 msgid "some form of physical activity or workout (examples: walk, run, cycle, hike, yoga, etc.)" 2039 msgstr "" 2040 2041 #: includes/register-kinds.php:388 2042 msgid "Trip" 2043 msgstr "" 2044 2045 #: includes/register-kinds.php:389 2046 msgid "Trips" 2047 msgstr "" 2048 2049 #: includes/register-kinds.php:390 2050 #: includes/register-kinds.php:405 2051 msgid "Travelled" 2052 msgstr "" 2053 2054 #: includes/register-kinds.php:393 2055 msgid "represents a geographic journey" 2056 msgstr "" 2057 2058 #: includes/register-kinds.php:403 2059 msgid "Itinerary" 2060 msgstr "" 2061 2062 #: includes/register-kinds.php:404 2063 msgid "Itineraries" 2064 msgstr "" 2065 2066 #: includes/register-kinds.php:408 2067 msgid "parts of a scheduled trip including transit by car, plane, train, etc." 2068 msgstr "" 2069 2070 #: includes/register-kinds.php:419 2071 #: includes/register-kinds.php:420 2072 msgid "Eat" 2073 msgstr "" 2074 2075 #: includes/register-kinds.php:421 2076 #: includes/register-kinds.php:424 2077 msgid "Ate" 2078 msgstr "" 2079 2080 #: includes/register-kinds.php:428 2081 msgid "what you are eating, perhaps for a food diary" 2082 msgstr "" 2083 2084 #: includes/register-kinds.php:439 2085 msgid "Drink" 2086 msgstr "" 2087 2088 #: includes/register-kinds.php:440 2089 msgid "Drinks" 2090 msgstr "" 2091 2092 #: includes/register-kinds.php:441 2093 #: includes/register-kinds.php:444 2094 msgid "Drank" 2095 msgstr "" 2096 2097 #: includes/register-kinds.php:448 2098 msgid "what you are drinking, perhaps for a food dairy" 2099 msgstr "" 2100 2101 #: includes/register-kinds.php:459 2102 msgid "Follow" 2103 msgstr "" 2104 2105 #: includes/register-kinds.php:460 2106 msgid "Follows" 2107 msgstr "" 2108 2109 #: includes/register-kinds.php:461 2110 msgid "Followed" 2111 msgstr "" 2112 2113 #: includes/register-kinds.php:464 2114 msgid "indicating you are now following or subscribing to another person`s activities online" 2115 msgstr "" 2116 2117 #: includes/register-kinds.php:475 2118 msgid "Jam" 2119 msgstr "" 2120 2121 #: includes/register-kinds.php:476 2122 msgid "Jams" 2123 msgstr "" 2124 2125 #: includes/register-kinds.php:477 2126 #: includes/register-kinds.php:482 2127 msgid "Listened to" 2128 msgstr "" 2129 2130 #: includes/register-kinds.php:496 2131 msgid "a particularly personally meaningful song (a listen with added emphasis)" 2132 msgstr "" 2133 2134 #: includes/register-kinds.php:507 2135 #: includes/register-kinds.php:509 2136 #: includes/register-kinds.php:513 2137 msgid "Read" 2138 msgstr "" 2139 2140 #: includes/register-kinds.php:508 2141 msgid "Reads" 2142 msgstr "" 2143 2144 #: includes/register-kinds.php:520 2145 msgid "reading a book, magazine, newspaper, other physical document, or online post" 2146 msgstr "" 2147 2148 #: includes/register-kinds.php:531 2149 msgid "Quote" 2150 msgstr "" 2151 2152 #: includes/register-kinds.php:532 2153 msgid "Quotes" 2154 msgstr "" 2155 2156 #: includes/register-kinds.php:533 2157 #: includes/register-kinds.php:536 2158 msgid "Quoted" 2159 msgstr "" 2160 2161 #: includes/register-kinds.php:539 2162 msgid "quoted content" 2163 msgstr "" 2164 2165 #: includes/register-kinds.php:550 2166 msgid "Mood" 2167 msgstr "" 2168 2169 #: includes/register-kinds.php:551 2170 msgid "Moods" 2171 msgstr "" 2172 2173 #: includes/register-kinds.php:552 2174 msgid "Felt" 2175 msgstr "" 2176 2177 #: includes/register-kinds.php:555 2178 msgid "how you are feeling (example: happy, sad, indifferent, etc.)" 2179 msgstr "" 2180 2181 #: includes/register-kinds.php:566 2182 msgid "Recipe" 2183 msgstr "" 2184 2185 #: includes/register-kinds.php:567 2186 msgid "Recipes" 2187 msgstr "" 2188 2189 #: includes/register-kinds.php:568 2190 msgid "Cooked" 2191 msgstr "" 2192 2193 #: includes/register-kinds.php:574 2194 msgid "list of ingredients and directions for making food or drink" 2195 msgstr "" 2196 2197 #: includes/register-kinds.php:585 2198 msgid "Issue" 2199 msgstr "" 2200 2201 #: includes/register-kinds.php:586 2202 msgid "Issues" 2203 msgstr "" 2204 2205 #: includes/register-kinds.php:587 2206 msgid "Filed an Issue" 2207 msgstr "" 2208 2209 #: includes/register-kinds.php:594 2210 msgid "Issue is a special kind of article post that is a reply to typically some source code, though potentially anything at a source control repository." 2211 msgstr "" 2212 2213 #: includes/register-kinds.php:605 2214 msgid "Question" 2215 msgstr "" 2216 2217 #: includes/register-kinds.php:606 2218 msgid "Questions" 2219 msgstr "" 2220 2221 #: includes/register-kinds.php:607 2222 msgid "Asked a question" 2223 msgstr "" 2224 2225 #: includes/register-kinds.php:610 2226 msgid "Question is a post type for soliciting answer replies, which are then typically up/down voted by others and then displayed underneath the question post ordered by highest positive vote count rather than time ordered." 2227 msgstr "" 2228 2229 #: includes/register-kinds.php:621 2230 msgid "Sleep" 2231 msgstr "" 2232 2233 #: includes/register-kinds.php:622 2234 msgid "Sleeps" 2235 msgstr "" 2236 2237 #: includes/register-kinds.php:623 2238 msgid "Slept" 2239 msgstr "" 2240 2241 #: includes/register-kinds.php:626 2242 msgid "Sleep is a passive metrics post type that indicates how much time (and often a graph of how deeply) a person has slept." 2243 msgstr "" 2244 2245 #: includes/register-kinds.php:637 2246 msgid "Event" 2247 msgstr "" 2248 2249 #: includes/register-kinds.php:638 2250 msgid "Events" 2251 msgstr "" 2252 2253 #: includes/register-kinds.php:639 2254 msgid "Planned" 2255 msgstr "" 2256 2257 #: includes/register-kinds.php:645 2258 msgid "An event is a type of post that in addition to a post name (event title) has a start datetime (likely end datetime), and a location." 2259 msgstr "" 2260 2261 #: includes/register-kinds.php:655 2262 msgid "Review" 2263 msgstr "" 2264 2265 #: includes/register-kinds.php:656 2266 msgid "Reviews" 2267 msgstr "" 2268 2269 #: includes/register-kinds.php:657 2270 #: includes/register-kinds.php:660 2271 msgid "Reviewed" 2272 msgstr "" 2273 2274 #: includes/register-kinds.php:664 2275 msgid "A review is a post evaluating a product or service, usually involving a written description, sometimes with summary numerical evaluations, also known as just a rating." 2276 msgstr "" 2277 2278 #: includes/register-kinds.php:675 2279 msgid "Acquisition" 2280 msgstr "" 2281 2282 #: includes/register-kinds.php:676 2283 msgid "Acquisitions" 2284 msgstr "" 2285 1676 2286 #: includes/register-kinds.php:677 1677 #: templates/reply-metabox.php:501678 msgid "URL"1679 msgstr ""1680 1681 #: includes/register-kinds.php:701682 #: includes/register-kinds.php:1391683 #: includes/register-kinds.php:2081684 #: includes/register-kinds.php:2771685 #: includes/register-kinds.php:3461686 #: templates/reply-author.php:201687 #: templates/reply-metabox.php:451688 msgid "Author"1689 msgstr ""1690 1691 #: includes/register-kinds.php:771692 #: includes/register-kinds.php:1461693 #: includes/register-kinds.php:2151694 #: includes/register-kinds.php:2841695 #: includes/register-kinds.php:3531696 #: includes/register-kinds.php:4891697 #: includes/register-kinds.php:5581698 #: includes/register-kinds.php:6231699 msgid "Summary"1700 msgstr ""1701 1702 #: includes/register-kinds.php:811703 #: includes/register-kinds.php:1501704 #: includes/register-kinds.php:2191705 #: includes/register-kinds.php:2881706 #: includes/register-kinds.php:3571707 #: includes/register-kinds.php:4931708 msgid "Publication/Website"1709 msgstr ""1710 1711 #: includes/register-kinds.php:851712 #: includes/register-kinds.php:1541713 #: includes/register-kinds.php:2231714 #: includes/register-kinds.php:2921715 #: includes/register-kinds.php:3611716 msgid "Publish Date"1717 msgstr ""1718 1719 #: includes/register-kinds.php:891720 #: includes/register-kinds.php:1581721 #: includes/register-kinds.php:2271722 #: includes/register-kinds.php:2961723 #: includes/register-kinds.php:3651724 msgid "Updated Time"1725 msgstr ""1726 1727 #: includes/register-kinds.php:931728 #: includes/register-kinds.php:1621729 #: includes/register-kinds.php:2311730 #: includes/register-kinds.php:3001731 #: includes/register-kinds.php:3691732 #: includes/register-kinds.php:4451733 #: includes/register-kinds.php:5051734 #: includes/register-kinds.php:5701735 #: includes/register-kinds.php:6351736 msgid "Tags"1737 msgstr ""1738 1739 #: includes/register-kinds.php:1001740 #: includes/register-kinds.php:1691741 #: includes/register-kinds.php:2381742 #: includes/register-kinds.php:3071743 #: includes/register-kinds.php:3761744 #: includes/register-kinds.php:5121745 msgid "Featured Media"1746 msgstr ""1747 1748 #: includes/register-kinds.php:1091749 msgid "a reply to content typically on another site"1750 msgstr ""1751 1752 #: includes/register-kinds.php:1201753 #: includes/register-kinds.php:1271754 msgid "Repost"1755 msgstr ""1756 1757 #: includes/register-kinds.php:1211758 msgid "Reposts"1759 msgstr ""1760 1761 #: includes/register-kinds.php:1221762 msgid "Reposted"1763 msgstr ""1764 1765 #: includes/register-kinds.php:1781766 msgid "a complete reposting of content from another site"1767 msgstr ""1768 1769 #: includes/register-kinds.php:1891770 #: includes/register-kinds.php:1961771 msgid "Like"1772 msgstr ""1773 1774 #: includes/register-kinds.php:1901775 msgid "Likes"1776 msgstr ""1777 1778 #: includes/register-kinds.php:1911779 msgid "Liked"1780 msgstr ""1781 1782 #: includes/register-kinds.php:2471783 msgid "a way to pay compliments to the original post/poster of external content"1784 msgstr ""1785 1786 #: includes/register-kinds.php:2581787 msgid "Favorite"1788 msgstr ""1789 1790 #: includes/register-kinds.php:2591791 msgid "Favorites"1792 msgstr ""1793 1794 #: includes/register-kinds.php:2601795 #: includes/register-kinds.php:2651796 msgid "Favorited"1797 msgstr ""1798 1799 #: includes/register-kinds.php:3161800 msgid "special to the author"1801 msgstr ""1802 1803 #: includes/register-kinds.php:3271804 #: includes/register-kinds.php:3341805 msgid "Bookmark"1806 msgstr ""1807 1808 #: includes/register-kinds.php:3281809 msgid "Bookmarks"1810 msgstr ""1811 1812 #: includes/register-kinds.php:3291813 msgid "Bookmarked"1814 msgstr ""1815 1816 #: includes/register-kinds.php:3851817 msgid "storing a link/bookmark for personal use or sharing with others"1818 msgstr ""1819 1820 #: includes/register-kinds.php:3961821 msgid "Photo"1822 msgstr ""1823 1824 #: includes/register-kinds.php:3971825 msgid "Photos"1826 msgstr ""1827 1828 #: includes/register-kinds.php:4011829 msgid "a post with an embedded image/photo as its primary focus"1830 msgstr ""1831 1832 #: includes/register-kinds.php:4121833 msgid "Video"1834 msgstr ""1835 1836 #: includes/register-kinds.php:4131837 msgid "Videos"1838 msgstr ""1839 1840 #: includes/register-kinds.php:4171841 msgid "a post with an embedded video as its primary focus"1842 msgstr ""1843 1844 #: includes/register-kinds.php:4281845 msgid "Audio"1846 msgstr ""1847 1848 #: includes/register-kinds.php:4291849 msgid "Audios"1850 msgstr ""1851 1852 #: includes/register-kinds.php:4331853 msgid "a post with an embedded audio file as its primary focus"1854 msgstr ""1855 1856 #: includes/register-kinds.php:4441857 msgid "Tag"1858 msgstr ""1859 1860 #: includes/register-kinds.php:4461861 msgid "Tagged"1862 msgstr ""1863 1864 #: includes/register-kinds.php:4491865 msgid "allows you to tag a post as being of a specific category or tag, or for person tagging"1866 msgstr ""1867 1868 #: includes/register-kinds.php:4611869 msgid "RSVPs"1870 msgstr ""1871 1872 #: includes/register-kinds.php:4621873 msgid "RSVPed"1874 msgstr ""1875 1876 #: includes/register-kinds.php:4771877 msgid "Event Details"1878 msgstr ""1879 1880 #: includes/register-kinds.php:4971881 msgid "Start Date"1882 msgstr ""1883 1884 #: includes/register-kinds.php:5011885 msgid "End Date"1886 msgstr ""1887 1888 #: includes/register-kinds.php:5211889 msgid "a specific type of reply regarding attendance of an event"1890 msgstr ""1891 1892 #: includes/register-kinds.php:5321893 msgid "Listen"1894 msgstr ""1895 1896 #: includes/register-kinds.php:5331897 msgid "Listens"1898 msgstr ""1899 1900 #: includes/register-kinds.php:5341901 msgid "Listened"1902 msgstr ""1903 1904 #: includes/register-kinds.php:5391905 msgid "Listen To"1906 msgstr ""1907 1908 #: includes/register-kinds.php:5621909 msgid "Album"1910 msgstr ""1911 1912 #: includes/register-kinds.php:5661913 #: includes/register-kinds.php:6311914 msgid "Release Date"1915 msgstr ""1916 1917 #: includes/register-kinds.php:5771918 msgid "Album Art"1919 msgstr ""1920 1921 #: includes/register-kinds.php:5861922 msgid "listening to audio; sometimes called a scrobble"1923 msgstr ""1924 1925 #: includes/register-kinds.php:5971926 msgid "Watch"1927 msgstr ""1928 1929 #: includes/register-kinds.php:5981930 msgid "Watches"1931 msgstr ""1932 1933 #: includes/register-kinds.php:5991934 msgid "Watched"1935 msgstr ""1936 1937 #: includes/register-kinds.php:6041938 msgid "Watching To"1939 msgstr ""1940 1941 #: includes/register-kinds.php:6271942 msgid "Series"1943 msgstr ""1944 1945 #: includes/register-kinds.php:6421946 msgid "Poster"1947 msgstr ""1948 1949 #: includes/register-kinds.php:6511950 msgid "watching a movie, television show, online video, play or other visual-based event"1951 msgstr ""1952 1953 #: includes/register-kinds.php:6621954 msgid "Checkin"1955 msgstr ""1956 1957 #: includes/register-kinds.php:6631958 msgid "Checkins"1959 msgstr ""1960 1961 #: includes/register-kinds.php:6641962 msgid "Checked into"1963 msgstr ""1964 1965 #: includes/register-kinds.php:6691966 msgid "Checked In"1967 msgstr ""1968 1969 #: includes/register-kinds.php:6811970 msgid "Latitude"1971 msgstr ""1972 1973 #: includes/register-kinds.php:6891974 msgid "Longitude"1975 msgstr ""1976 1977 #: includes/register-kinds.php:6971978 msgid "Street Address"1979 msgstr ""1980 1981 #: includes/register-kinds.php:7011982 msgid "Locality"1983 msgstr ""1984 1985 #: includes/register-kinds.php:7051986 msgid "Region"1987 msgstr ""1988 1989 #: includes/register-kinds.php:7091990 msgid "Country Name"1991 msgstr ""1992 1993 #: includes/register-kinds.php:7131994 msgid "Postal Code"1995 msgstr ""1996 1997 #: includes/register-kinds.php:7191998 msgid "identifying you are at a particular geographic location"1999 msgstr ""2000 2001 #: includes/register-kinds.php:7302002 msgid "Wish"2003 msgstr ""2004 2005 #: includes/register-kinds.php:7312006 msgid "Wishes"2007 msgstr ""2008 2009 #: includes/register-kinds.php:7322010 msgid "Wished"2011 msgstr ""2012 2013 #: includes/register-kinds.php:7352014 msgid "a post indicating a desire/wish. The archive of which would be a wishlist, such as a gift registry or similar"2015 msgstr ""2016 2017 #: includes/register-kinds.php:7462018 msgid "Play"2019 msgstr ""2020 2021 #: includes/register-kinds.php:7472022 msgid "Playing"2023 msgstr ""2024 2025 #: includes/register-kinds.php:7482026 msgid "Played"2027 msgstr ""2028 2029 #: includes/register-kinds.php:7512030 msgid "playing a game"2031 msgstr ""2032 2033 #: includes/register-kinds.php:7622034 #: includes/register-kinds.php:7632035 msgid "Weather"2036 msgstr ""2037 2038 #: includes/register-kinds.php:7672039 msgid "current weather conditions"2040 msgstr ""2041 2042 #: includes/register-kinds.php:7782043 #: includes/register-kinds.php:7792044 msgid "Exercise"2045 msgstr ""2046 2047 #: includes/register-kinds.php:7802048 msgid "Exercised"2049 msgstr ""2050 2051 #: includes/register-kinds.php:7832052 msgid "some form of physical activity or workout (examples: walk, run, cycle, hike, yoga, etc.)"2053 msgstr ""2054 2055 #: includes/register-kinds.php:7942056 msgid "Trip"2057 msgstr ""2058 2059 #: includes/register-kinds.php:7952060 msgid "Trips"2061 msgstr ""2062 2063 #: includes/register-kinds.php:7962064 #: includes/register-kinds.php:8122065 msgid "Travelled"2066 msgstr ""2067 2068 #: includes/register-kinds.php:7992069 msgid "represents a geographic journey"2070 msgstr ""2071 2072 #: includes/register-kinds.php:8102073 msgid "Itinerary"2074 msgstr ""2075 2076 #: includes/register-kinds.php:8112077 msgid "Itineraries"2078 msgstr ""2079 2080 #: includes/register-kinds.php:8152081 msgid "parts of a scheduled trip including transit by car, plane, train, etc."2082 msgstr ""2083 2084 #: includes/register-kinds.php:8272085 #: includes/register-kinds.php:8282086 msgid "Eat"2087 msgstr ""2088 2089 #: includes/register-kinds.php:8292090 msgid "Ate"2091 msgstr ""2092 2093 #: includes/register-kinds.php:8322094 msgid "what you are eating, perhaps for a food diary"2095 msgstr ""2096 2097 #: includes/register-kinds.php:8442098 msgid "Drink"2099 msgstr ""2100 2101 #: includes/register-kinds.php:8452102 msgid "Drinks"2103 msgstr ""2104 2105 #: includes/register-kinds.php:8462106 msgid "Drank"2107 msgstr ""2108 2109 #: includes/register-kinds.php:8492110 msgid "what you are drinking, perhaps for a food dairy"2111 msgstr ""2112 2113 #: includes/register-kinds.php:8612114 msgid "Follow"2115 msgstr ""2116 2117 #: includes/register-kinds.php:8622118 msgid "Follows"2119 msgstr ""2120 2121 #: includes/register-kinds.php:8632122 msgid "Followed"2123 msgstr ""2124 2125 #: includes/register-kinds.php:8662126 msgid "indicating you are now following or subscribing to another person`s activities online"2127 msgstr ""2128 2129 #: includes/register-kinds.php:8782130 msgid "Jam"2131 msgstr ""2132 2133 #: includes/register-kinds.php:8792134 msgid "Jams"2135 msgstr ""2136 2137 #: includes/register-kinds.php:8802138 msgid "Listened to"2139 msgstr ""2140 2141 #: includes/register-kinds.php:8832142 msgid "a particularly personally meaningful song (a listen with added emphasis)"2143 msgstr ""2144 2145 #: includes/register-kinds.php:8952146 #: includes/register-kinds.php:8972147 msgid "Read"2148 msgstr ""2149 2150 #: includes/register-kinds.php:8962151 msgid "Reads"2152 msgstr ""2153 2154 #: includes/register-kinds.php:9002155 msgid "reading a book, magazine, newspaper, other physical document, or online post"2156 msgstr ""2157 2158 #: includes/register-kinds.php:9122159 msgid "Quote"2160 msgstr ""2161 2162 #: includes/register-kinds.php:9132163 msgid "Quotes"2164 msgstr ""2165 2166 #: includes/register-kinds.php:9142167 msgid "Quoted"2168 msgstr ""2169 2170 #: includes/register-kinds.php:9172171 msgid "quoted content"2172 msgstr ""2173 2174 #: includes/register-kinds.php:9292175 msgid "Mood"2176 msgstr ""2177 2178 #: includes/register-kinds.php:9302179 msgid "Moods"2180 msgstr ""2181 2182 #: includes/register-kinds.php:9312183 msgid "Felt"2184 msgstr ""2185 2186 #: includes/register-kinds.php:9342187 msgid "how you are feeling (example: happy, sad, indifferent, etc.)"2188 msgstr ""2189 2190 #: includes/register-kinds.php:9462191 msgid "Recipe"2192 msgstr ""2193 2194 #: includes/register-kinds.php:9472195 msgid "Recipes"2196 msgstr ""2197 2198 #: includes/register-kinds.php:9482199 msgid "Cooked"2200 msgstr ""2201 2202 #: includes/register-kinds.php:9512203 msgid "list of ingredients and directions for making food or drink"2204 msgstr ""2205 2206 #: includes/register-kinds.php:9632207 msgid "Issue"2208 msgstr ""2209 2210 #: includes/register-kinds.php:9642211 msgid "Issues"2212 msgstr ""2213 2214 #: includes/register-kinds.php:9652215 msgid "Filed an Issue"2216 msgstr ""2217 2218 #: includes/register-kinds.php:9682219 msgid "Issue is a special kind of article post that is a reply to typically some source code, though potentially anything at a source control repository."2220 msgstr ""2221 2222 #: includes/register-kinds.php:9802223 msgid "Question"2224 msgstr ""2225 2226 #: includes/register-kinds.php:9812227 msgid "Questions"2228 msgstr ""2229 2230 #: includes/register-kinds.php:9822231 msgid "Asked a question"2232 msgstr ""2233 2234 #: includes/register-kinds.php:9852235 msgid "Question is a post type for soliciting answer replies, which are then typically up/down voted by others and then displayed underneath the question post ordered by highest positive vote count rather than time ordered."2236 msgstr ""2237 2238 #: includes/register-kinds.php:9972239 msgid "Sleep"2240 msgstr ""2241 2242 #: includes/register-kinds.php:9982243 msgid "Sleeps"2244 msgstr ""2245 2246 #: includes/register-kinds.php:9992247 msgid "Slept"2248 msgstr ""2249 2250 #: includes/register-kinds.php:10022251 msgid "Sleep is a passive metrics post type that indicates how much time (and often a graph of how deeply) a person has slept."2252 msgstr ""2253 2254 #: includes/register-kinds.php:10142255 msgid "Event"2256 msgstr ""2257 2258 #: includes/register-kinds.php:10152259 msgid "Events"2260 msgstr ""2261 2262 #: includes/register-kinds.php:10162263 msgid "Planned"2264 msgstr ""2265 2266 #: includes/register-kinds.php:10192267 msgid "An event is a type of post that in addition to a post name (event title) has a start datetime (likely end datetime), and a location."2268 msgstr ""2269 2270 #: includes/register-kinds.php:10302271 msgid "Review"2272 msgstr ""2273 2274 #: includes/register-kinds.php:10312275 msgid "Reviews"2276 msgstr ""2277 2278 #: includes/register-kinds.php:10322279 msgid "Reviewed"2280 msgstr ""2281 2282 #: includes/register-kinds.php:10352283 msgid "A review is a post evaluating a product or service, usually involving a written description, sometimes with summary numerical evaluations, also known as just a rating."2284 msgstr ""2285 2286 #: includes/register-kinds.php:10472287 msgid "Acquisition"2288 msgstr ""2289 2290 #: includes/register-kinds.php:10482291 msgid "Acquisitions"2292 msgstr ""2293 2294 #: includes/register-kinds.php:10492295 2287 msgid "Acquired" 2296 2288 msgstr "" 2297 2289 2298 #: includes/register-kinds.php: 10522290 #: includes/register-kinds.php:680 2299 2291 msgid "Purchases, gifts, found things, or objects donated" 2300 2292 msgstr "" 2301 2293 2302 #: includes/register-kinds.php: 10632294 #: includes/register-kinds.php:690 2303 2295 msgid "Craft" 2304 2296 msgstr "" 2305 2297 2306 #: includes/register-kinds.php: 10642298 #: includes/register-kinds.php:691 2307 2299 msgid "Crafts" 2308 2300 msgstr "" 2309 2301 2310 #: includes/register-kinds.php:1065 2302 #: includes/register-kinds.php:692 2303 #: includes/register-kinds.php:695 2311 2304 msgid "Crafted" 2312 2305 msgstr "" 2313 2306 2314 #: includes/register-kinds.php: 10682307 #: includes/register-kinds.php:698 2315 2308 msgid "Activities like knitting, crocheting, cross stitch, wood working, restoration, 3d printing...the activity of building something." 2316 2309 msgstr "" … … 2388 2381 #: templates/reply-metabox.php:47 2389 2382 msgid "Clear" 2390 msgstr ""2391 2392 #: templates/reply-time.php:182393 msgid "Duration"2394 msgstr ""2395 2396 #: templates/reply-time.php:212397 msgid "Years"2398 msgstr ""2399 2400 #: templates/reply-time.php:252401 msgid "Months"2402 msgstr ""2403 2404 #: templates/reply-time.php:292405 msgid "Days"2406 msgstr ""2407 2408 #: templates/reply-time.php:352409 msgid "Hours"2410 msgstr ""2411 2412 #: templates/reply-time.php:392413 msgid "Minutes"2414 msgstr ""2415 2416 #: templates/reply-time.php:432417 msgid "Seconds"2418 2383 msgstr "" 2419 2384 -
indieweb-post-kinds/trunk/lib/parse-this/includes/class-base.php
r3738687 r3810578 14 14 * 15 15 * Provides date ordering for feed items and sanitizers for values taken from 16 * remote documents. The limit_* sanitizers are derived from the Press This17 * code thatwas removed from WordPress core.16 * remote documents. limit_string() is derived from the Press This code that 17 * was removed from WordPress core. 18 18 * 19 19 * @since 1.0.0 … … 109 109 110 110 /** 111 * Limits an array to 100 values.112 *113 * Originally 50, raised because some sites are very detailed in their meta.114 *115 * @since 1.0.0116 *117 * @param array $value Array to limit.118 * @return array The first 100 values of $value, or an empty array if $value is119 * not an array.120 */121 protected static function limit_array( $value ) {122 if ( is_array( $value ) ) {123 if ( count( $value ) > 100 ) {124 return array_slice( $value, 0, 100 );125 }126 127 return $value;128 }129 130 return array();131 }132 133 /**134 111 * Sanitizes a string and limits it to 5,000 characters. 135 112 * … … 159 136 160 137 /** 161 * Validates a URL, resolves it against the source URL, and limits its length.162 *163 * @since 1.0.0164 *165 * @param string $url URL to check.166 * @param string $source_url URL of the document, used to resolve relative URLs.167 * @return string The absolute URL passed through esc_url_raw() (http and https168 * only), or an empty string if it is not a string, longer than169 * 2,048 characters, or invalid.170 */171 protected static function limit_url( $url, $source_url ) {172 if ( ! is_string( $url ) ) {173 return '';174 }175 176 // HTTP 1.1 allows 8000 chars but the "de-facto" standard supported in all current browsers is 2048.177 if ( strlen( $url ) > 2048 ) {178 return ''; // Return empty rather than a truncated/invalid URL.179 }180 181 // Does not look like a URL.182 if ( ! filter_var( $url, FILTER_VALIDATE_URL ) ) {183 return '';184 }185 186 $url = pt_make_absolute_url( $url, $source_url );187 188 return esc_url_raw( $url, array( 'http', 'https' ) );189 }190 191 /**192 * Filters out image URLs that are unlikely to be content images.193 *194 * Excludes ad images, share buttons, loaders and spinners, spacers,195 * thumbnails, WordPress interface, theme and plugin images, tracking pixels196 * and the WordPress.com stats image.197 *198 * @since 1.0.0199 *200 * @param string $src Image source URL.201 * @param string $source_url URL of the document, used to resolve relative URLs.202 * @return string The image URL, or an empty string if it is excluded.203 */204 protected static function limit_img( $src, $source_url ) {205 $src = self::limit_url( $src, $source_url );206 207 if ( preg_match( '!/ad[sx]?/!i', $src ) ) {208 // Ads.209 return '';210 } elseif ( preg_match( '!(/share-?this[^.]+?\.[a-z0-9]{3,4})(\?.*)?$!i', $src ) ) {211 // Share-this type button.212 return '';213 } elseif ( preg_match( '!/(spinner|loading|spacer|blank|rss)\.(gif|jpg|png)!i', $src ) ) {214 // Loaders, spinners, spacers.215 return '';216 } elseif ( preg_match( '!/([^./]+[-_])?(spinner|loading|spacer|blank)s?([-_][^./]+)?\.[a-z0-9]{3,4}!i', $src ) ) {217 // Fancy loaders, spinners, spacers.218 return '';219 } elseif ( preg_match( '!([^./]+[-_])?thumb[^.]*\.(gif|jpg|png)$!i', $src ) ) {220 // Thumbnails, too small, usually irrelevant to context.221 return '';222 } elseif ( false !== stripos( $src, '/wp-includes/' ) ) {223 // Classic WordPress interface images.224 return '';225 } elseif ( false !== stripos( $src, '/wp-content/themes' ) ) {226 // Anything within a WordPress theme directory.227 return '';228 } elseif ( false !== stripos( $src, '/wp-content/plugins' ) ) {229 // Anything within a WordPress plugin directory.230 return '';231 } elseif ( preg_match( '![^\d]\d{1,2}x\d+\.(gif|jpg|png)$!i', $src ) ) {232 // Most often tiny buttons/thumbs (< 100px wide).233 return '';234 } elseif ( preg_match( '!/pixel\.(mathtag|quantserve)\.com!i', $src ) ) {235 // Tracking pixels (mathtag.com, quantserve.com); see https://www.quantcast.com/how-we-do-it/iab-standard-measurement/how-we-collect-data/ for details.236 return '';237 } elseif ( preg_match( '!/[gb]\.gif(\?.+)?$!i', $src ) ) {238 // WordPress.com stats gif.239 return '';240 }241 /**242 * Filters an image URL after the built-in exclusions have been applied.243 *244 * Return an empty string to exclude the image.245 *246 * @since 1.0.0247 *248 * @param string $src Absolute image URL that passed the built-in checks, or an249 * empty string if the URL was invalid.250 */251 return apply_filters( 'parse_this_img_filters', $src );252 }253 254 /**255 * Converts an embed URL into the canonical URL of what it embeds.256 *257 * YouTube, Vimeo, Daily Motion and Vine (now defunct) player URLs are258 * rewritten to their watch-page form. Any other URL is kept only if it259 * matches a registered oEmbed provider.260 *261 * @since 1.0.0262 *263 * @param string $src Embed source URL.264 * @param string $source_url URL of the document, used to resolve relative URLs.265 * @return string The canonical URL, or an empty string if no provider matches.266 */267 protected static function limit_embed( $src, $source_url ) {268 $src = self::limit_url( $src, $source_url );269 270 if ( empty( $src ) ) {271 return '';272 }273 274 if ( preg_match( '!//(m|www)\.youtube\.com/(embed|v)/([^?]+)\?.+$!i', $src, $src_matches ) ) {275 // Embedded Youtube videos (www or mobile).276 $src = 'https://www.youtube.com/watch?v=' . $src_matches[3];277 } elseif ( preg_match( '!//player\.vimeo\.com/video/([\d]+)([?/].*)?$!i', $src, $src_matches ) ) {278 // Embedded Vimeo iframe videos.279 $src = 'https://vimeo.com/' . (int) $src_matches[1];280 } elseif ( preg_match( '!//vimeo\.com/moogaloop\.swf\?clip_id=([\d]+)$!i', $src, $src_matches ) ) {281 // Embedded Vimeo Flash videos.282 $src = 'https://vimeo.com/' . (int) $src_matches[1];283 } elseif ( preg_match( '!//vine\.co/v/([^/]+)/embed!i', $src, $src_matches ) ) {284 // Embedded Vine videos. Vine shut down in 2017; kept for old links.285 $src = 'https://vine.co/v/' . $src_matches[1];286 } elseif ( preg_match( '!//(www\.)?dailymotion\.com/embed/video/([^/?]+)([/?].+)?!i', $src, $src_matches ) ) {287 // Embedded Daily Motion videos.288 $src = 'https://www.dailymotion.com/video/' . $src_matches[2];289 } else {290 $oembed = _wp_oembed_get_object();291 292 if ( ! $oembed->get_provider(293 $src,294 array(295 'discover' => false,296 )297 ) ) {298 $src = '';299 }300 }301 302 return $src;303 }304 305 /**306 138 * Adds a value to an array key, turning the key into a list on repeats. 307 139 * -
indieweb-post-kinds/trunk/lib/parse-this/includes/class-discovery.php
r3738687 r3810578 295 295 'type' => 'card', 296 296 ); 297 if ( wp_http_validate_url( $jf2['author'] ) ) {297 if ( pt_is_http_url( $jf2['author'] ) ) { 298 298 $author['url'] = $jf2['author']; 299 299 } else { -
indieweb-post-kinds/trunk/lib/parse-this/includes/class-html.php
r3738687 r3810578 97 97 $src = $video->getAttribute( 'src' ); 98 98 if ( ! empty( $src ) ) { 99 $videos[] = $src;99 $videos[] = pt_make_absolute_url( $src, $url ); 100 100 } 101 101 } … … 110 110 $src = $audio->getAttribute( 'src' ); 111 111 if ( ! empty( $src ) ) { 112 $audios[] = $src;112 $audios[] = pt_make_absolute_url( $src, $url ); 113 113 } 114 114 } … … 117 117 $src = $audio->getAttribute( 'data-audio-url' ); 118 118 if ( ! empty( $src ) ) { 119 $audios[] = $src;119 $audios[] = pt_make_absolute_url( $src, $url ); 120 120 } 121 121 } 122 122 $jf2['audio'] = array_unique( $audios ); 123 123 } 124 125 /*126 For now do not search every link embed etc127 // Fetch and gather <iframe> data.128 $embeds = array();129 130 foreach ( $xpath->query( '//iframe[@src]' ) as $embed ) {131 $src = self::limit_embed( $embed->getAttribute( 'src' ), $url );132 if ( ! empty( $src ) ) {133 $embeds[] = $src;134 }135 }136 137 // Fetch and gather <img> data.138 $images = array();139 foreach ( $xpath->query( '//img[@src]' ) as $image ) {140 $src = self::limit_img( $image->getAttribute( 'src' ), $url );141 if ( ! empty( $src ) ) {142 $images[] = $src;143 }144 }145 $images = array_unique( $images );146 147 // Fetch and gather <link> data.148 $links = array();149 150 foreach ( $xpath->query( '//link[@rel and @href]' ) as $link ) {151 $rel = $link->getAttribute( 'rel' );152 $url = self::limit_url( $link->getAttribute( 'href' ), $url );153 if ( ! empty( $url ) ) {154 $links[ $rel ] = $url;155 }156 }157 158 $video_extensions = array(159 'mp4',160 'mkv',161 'webm',162 'ogv',163 'avi',164 'm4v',165 'mpg',166 );167 $audio_extensions = array(168 'mp3',169 'ogg',170 'm4a',171 'm4b',172 'flac',173 'aac',174 );175 $urls = array();176 foreach ( $xpath->query( '//a' ) as $link ) {177 $u = pt_make_absolute_url( $link->getAttribute( 'href' ), $url );178 $urls[] = wp_http_validate_url( $u );179 $extension = pathinfo( wp_parse_url( $url, PHP_URL_PATH ), PATHINFO_EXTENSION );180 if ( in_array( $extension, $audio_extensions, true ) ) {181 $audios[] = $url;182 }183 if ( in_array( $extension, $video_extensions, true ) ) {184 $videos[] = $url;185 }186 }187 */188 124 189 125 if ( ! empty( $args['debug'] ) ) { … … 201 137 * 202 138 * @since 1.0.0 139 * @since 2.0.1 Parse.ly tags are trimmed, article:modified_time becomes 140 * updated rather than modified, and Dublin Core names (DC., 141 * dc. and DCTERMS.) are matched in any case. 203 142 * 204 143 * @param array $meta Meta values as grouped by parse_meta(), keyed by prefix … … 269 208 $modified = $meta['article']['modified_time'] ?? $meta['article']['modified'] ?? null; 270 209 if ( $modified ) { 271 $jf2[' modified'] = normalize_iso8601( $modified );210 $jf2['updated'] = normalize_iso8601( $modified ); 272 211 } 273 212 $jf2['category'] = $meta['article']['tag'] ?? null; … … 314 253 } 315 254 } 316 if ( isset( $meta['dc'] ) ) { 317 $dc = $meta['dc']; 318 if ( isset( $dc['Title'] ) ) { 319 $jf2['name'] = $dc['Title']; 320 } 321 if ( isset( $dc['Creator'] ) ) { 322 if ( is_string( $dc['Creator'] ) ) { 323 $jf2['author'] = $dc['Creator']; 255 // Dublin Core: DC.title, dc.title, DCTERMS.title and so on, in any case. 256 $dc = array(); 257 foreach ( $meta as $prefix => $values ) { 258 if ( is_array( $values ) && in_array( strtolower( (string) $prefix ), array( 'dc', 'dcterms' ), true ) ) { 259 foreach ( $values as $key => $value ) { 260 $dc += array( strtolower( (string) $key ) => $value ); 261 } 262 } 263 } 264 if ( $dc ) { 265 if ( isset( $dc['title'] ) ) { 266 $jf2['name'] = $dc['title']; 267 } 268 if ( isset( $dc['creator'] ) ) { 269 if ( is_string( $dc['creator'] ) ) { 270 $jf2['author'] = $dc['creator']; 324 271 } else { 325 272 $jf2['author'] = array(); 326 foreach ( $dc[' Creator'] as $creator ) {273 foreach ( $dc['creator'] as $creator ) { 327 274 $jf2['author'][] = array( 328 275 'type' => 'card', … … 332 279 } 333 280 } 334 if ( isset( $dc['Description'] ) ) { 335 $jf2['summary'] = $dc['Description']; 336 } 337 if ( isset( $dc['Date'] ) && ! isset( $jf2['published'] ) ) { 338 $jf2['published'] = normalize_iso8601( $dc['Date'] ); 281 if ( isset( $dc['description'] ) ) { 282 $jf2['summary'] = $dc['description']; 283 } 284 $date = $dc['date'] ?? ( $dc['issued'] ?? ( $dc['created'] ?? null ) ); 285 if ( $date && ! isset( $jf2['published'] ) ) { 286 $jf2['published'] = normalize_iso8601( $date ); 339 287 } 340 288 } … … 365 313 366 314 if ( empty( $jf2['category'] ) && isset( $meta['parsely-tags'] ) ) { 367 if ( is_array( $meta['parsely-tags'] ) ) { 368 $jf2['category'] = $meta['parsely-tags']; 369 } else { 370 $jf2['category'] = explode( ',', $meta['parsely-tags'] ); 371 } 315 $tags = is_array( $meta['parsely-tags'] ) ? $meta['parsely-tags'] : explode( ',', $meta['parsely-tags'] ); 316 $jf2['category'] = array_values( array_filter( array_map( 'trim', array_filter( $tags, 'is_string' ) ), 'strlen' ) ); 372 317 } 373 318 -
indieweb-post-kinds/trunk/lib/parse-this/includes/class-jsonld.php
r3738687 r3810578 210 210 if ( ! array_key_exists( 'author', $return ) && array_key_exists( 'person', $jf2 ) ) { 211 211 $return['author'] = $jf2['person']; 212 }213 if ( ! array_key_exists( 'publication', $return ) && array_key_exists( 'publisher', $jf2 ) ) {214 $return['publication'] = $jf2['publisher'];215 212 } 216 213 return array_filter( $return, array( __CLASS__, 'is_set' ) ); … … 538 535 * Converts a MusicRelease node into a jf2 cite. 539 536 * 540 * @since 1.0.0 537 * The artists (releaseOf.byArtist, one or a list) become a list of cards 538 * in author. 539 * 540 * @since 1.0.0 541 * @since 2.0.1 Artists are cards rather than one-item lists, and a single 542 * byArtist object is accepted. 541 543 * 542 544 * @param array $music MusicRelease node. … … 559 561 'featured' => self::image_to_photo( $music['image'] ?? null ), 560 562 ); 561 if ( isset( $music['releaseOf'] ) ) { 562 if ( isset( $music['releaseOf']['byArtist'] ) ) { 563 $return['author'] = array(); 564 foreach ( $music['releaseOf']['byArtist'] as $artist ) { 565 $return['author'][] = array( 566 array_filter( 567 array( 568 'type' => 'card', 569 'name' => $artist['name'] ?? null, 570 'url' => $artist['@id'] ?? null, 571 ) 572 ), 573 ); 563 if ( isset( $music['releaseOf']['byArtist'] ) ) { 564 // One artist or a list of them; each becomes a card. 565 $artists = $music['releaseOf']['byArtist']; 566 if ( ! is_array( $artists ) || ! wp_is_numeric_array( $artists ) ) { 567 $artists = array( $artists ); 568 } 569 $return['author'] = array(); 570 foreach ( $artists as $artist ) { 571 if ( is_string( $artist ) ) { 572 $artist = array( 'name' => $artist ); 573 } 574 if ( ! is_array( $artist ) ) { 575 continue; 576 } 577 $card = array_filter( 578 array( 579 'name' => $artist['name'] ?? null, 580 'url' => $artist['url'] ?? ( $artist['@id'] ?? null ), 581 ), 582 'is_string' 583 ); 584 if ( $card ) { 585 $return['author'][] = array( 'type' => 'card' ) + $card; 574 586 } 575 587 } … … 630 642 * Converts an Event node into a jf2 event. 631 643 * 632 * @since 1.0.0 644 * The organizer may be an Organization or a Person. 645 * 646 * @since 1.0.0 647 * @since 2.0.1 Accepts a Person as organizer. 633 648 * 634 649 * @param array $event Event or BusinessEvent node. … … 644 659 'url' => $event['url'] ?? null, 645 660 'summary' => $event['description'] ?? null, 646 'organizer' => self:: organization_to_hcard( $event['organizer'] ?? null ),661 'organizer' => self::person_to_hcard( $event['organizer'] ?? null ), 647 662 'location' => self::place_to_hcard( $event['location'] ?? null ), 648 663 'start' => normalize_iso8601( $event['startDate'] ?? null ), … … 658 673 * Returns the URL of an ImageObject. 659 674 * 660 * For a list, the last image is used. 661 * 662 * @since 1.0.0 675 * For a list, the last image is used. The URL is taken from url, then 676 * contentUrl, then @id. 677 * 678 * @since 1.0.0 679 * @since 2.0.1 Falls back to contentUrl and @id when there is no url. 663 680 * 664 681 * @param array|string|mixed $image ImageObject node, list of nodes, or URL. 665 * @return string|false The image URL, or false if $image is not an image. 682 * @return string|false The image URL, or false if $image is not an image or 683 * has no URL. 666 684 */ 667 685 public static function image_to_photo( $image ) { … … 686 704 * } 687 705 */ 688 return $image['url']; 706 foreach ( array( 'url', 'contentUrl', '@id' ) as $key ) { 707 if ( isset( $image[ $key ] ) && is_string( $image[ $key ] ) && '' !== trim( $image[ $key ] ) ) { 708 return trim( $image[ $key ] ); 709 } 710 } 711 return false; 689 712 } 690 713 … … 693 716 * 694 717 * @since 1.0.0 718 * @since 2.0.1 The transcript's plain text is content.text, not content.value. 695 719 * 696 720 * @param array|string $audio AudioObject node, or a URL. … … 717 741 if ( isset( $audio['transcript'] ) ) { 718 742 $return['content'] = array( 719 'html' => Parser::clean_content( $audio['transcript'] ),720 ' value' => wp_strip_all_tags( $audio['transcript']),743 'html' => Parser::clean_content( $audio['transcript'] ), 744 'text' => trim( wp_strip_all_tags( $audio['transcript'] ) ), 721 745 ); 722 746 } … … 731 755 * 732 756 * @since 1.0.0 757 * @since 2.0.1 The transcript's plain text is content.text, not content.value. 733 758 * 734 759 * @param array|string $video VideoObject node, or a URL. … … 755 780 if ( isset( $video['transcript'] ) ) { 756 781 $return['content'] = array( 757 'html' => Parser::clean_content( $video['transcript'] ),758 ' value' => wp_strip_all_tags( $video['transcript']),782 'html' => Parser::clean_content( $video['transcript'] ), 783 'text' => trim( wp_strip_all_tags( $video['transcript'] ) ), 759 784 ); 760 785 } … … 813 838 814 839 /** 840 * Returns the card properties for a schema.org address. 841 * 842 * A PostalAddress gives its parts; plain text, which schema.org also allows, 843 * becomes the card's label. 844 * 845 * @since 2.0.1 846 * 847 * @param array|string|mixed $address PostalAddress node or text. 848 * @return array Address properties, possibly empty. 849 */ 850 private static function address_properties( $address ) { 851 if ( is_string( $address ) ) { 852 $address = trim( $address ); 853 return '' === $address ? array() : array( 'label' => $address ); 854 } 855 $parts = self::postaladdress_to_address( $address ); 856 return is_array( $parts ) ? $parts : array(); 857 } 858 859 /** 815 860 * Converts a Place node into a jf2 card. 816 861 * 817 862 * @since 1.0.0 863 * @since 2.0.1 A plain-text address is kept as the card's label. 818 864 * 819 865 * @param array|mixed $place Place node. … … 839 885 840 886 if ( isset( $place['address'] ) ) { 841 $address = self::postaladdress_to_address( $place['address'] ); 842 if ( is_array( $address ) ) { 843 $hcard = array_merge( $hcard, $address ); 844 } 887 $hcard = array_merge( $hcard, self::address_properties( $place['address'] ) ); 845 888 } 846 889 return array_filter( $hcard ); … … 927 970 * 928 971 * @since 1.0.0 972 * @since 2.0.1 A plain-text address is kept as the card's label. 929 973 * 930 974 * @param array|mixed $organization Organization, NewsMediaOrganization, NGO or … … 963 1007 } 964 1008 if ( isset( $organization['address'] ) ) { 965 $address = self::postaladdress_to_address( $organization['address'] ); 966 if ( is_array( $address ) ) { 967 $publication = array_merge( $publication, $address ); 968 } else { 969 $publication['_address'] = $address; 970 } 1009 $publication = array_merge( $publication, self::address_properties( $organization['address'] ) ); 971 1010 } 972 1011 return array_filter( $publication ); … … 1071 1110 * Converts an article or web page node into a jf2 entry. 1072 1111 * 1073 * Accepts WebPage, Article, NewsArticle and BlogPosting. 1074 * 1075 * @since 1.0.0 1112 * Accepts WebPage, Article, NewsArticle and BlogPosting. The author comes 1113 * from author, or from creator when there is no usable author. 1114 * 1115 * @since 1.0.0 1116 * @since 2.0.1 A creator no longer replaces the author, and is a single card 1117 * when there is only one. 1076 1118 * 1077 1119 * @param array|mixed $newsarticle Article node. … … 1110 1152 if ( ! is_array( $newsarticle['keywords'] ) ) { 1111 1153 $newsarticle['keywords'] = explode( ',', $newsarticle['keywords'] ); 1112 } elseif ( is_string( $newsarticle['keywords'] ) ) {1113 $newsarticle['keywords'] = array( $newsarticle['keywords'] );1114 1154 } 1115 1155 $jf2['category'] = array_map( 'trim', $newsarticle['keywords'] ); … … 1122 1162 ); 1123 1163 } 1124 if ( isset( $newsarticle['author'] ) ) { 1125 if ( ! wp_is_numeric_array( $newsarticle['author'] ) ) { 1126 $newsarticle['author'] = array( $newsarticle['author'] ); 1127 } 1128 $jf2['author'] = array(); 1129 foreach ( $newsarticle['author'] as $author ) { 1130 $jf2['author'][] = self::person_to_hcard( $author ); 1131 } 1132 $jf2['author'] = array_filter( $jf2['author'] ); 1133 if ( 0 === count( $jf2['author'] ) ) { 1134 unset( $jf2['author'] ); 1135 } elseif ( 1 === count( $jf2['author'] ) ) { 1136 $jf2['author'] = array_pop( $jf2['author'] ); 1137 } 1138 } 1139 if ( isset( $newsarticle['creator'] ) ) { 1140 if ( ! wp_is_numeric_array( $newsarticle['creator'] ) ) { 1141 $newsarticle['creator'] = array( $newsarticle['creator'] ); 1142 } 1143 $jf2['author'] = array(); 1144 foreach ( $newsarticle['creator'] as $creator ) { 1145 $jf2['author'][] = self::person_to_hcard( $creator ); 1164 // The author, or failing that the creator: one card, or a list of them. 1165 foreach ( array( 'author', 'creator' ) as $property ) { 1166 if ( isset( $jf2['author'] ) || ! isset( $newsarticle[ $property ] ) ) { 1167 continue; 1168 } 1169 $agents = $newsarticle[ $property ]; 1170 if ( ! wp_is_numeric_array( $agents ) ) { 1171 $agents = array( $agents ); 1172 } 1173 $cards = array_values( array_filter( array_map( array( __CLASS__, 'person_to_hcard' ), $agents ) ) ); 1174 if ( 1 === count( $cards ) ) { 1175 $jf2['author'] = $cards[0]; 1176 } elseif ( $cards ) { 1177 $jf2['author'] = $cards; 1146 1178 } 1147 1179 } -
indieweb-post-kinds/trunk/lib/parse-this/includes/class-mf2.php
r3738687 r3810578 199 199 * @since 1.0.0 200 200 * @since 2.0.0 Implements steps 7.2 to 7.4 of the algorithm. Added $args. 201 * @since 2.0.1 Recognizes author URLs by their syntax, without a DNS lookup. 201 202 * 202 203 * @param array $item Microformat to find the author of. … … 219 220 return $a; 220 221 } elseif ( is_string( $a ) ) { 221 if ( wp_http_validate_url( $a ) ) {222 if ( pt_is_http_url( $a ) ) { 222 223 // 5.2 "otherwise if author property is an http(s) URL, let the author-page have that URL" 223 224 $authorpage = $a; … … 489 490 * 490 491 * The first h-card is removed from the items and used as the feed's author. 491 * If only one item remains, the document is returned with that h-card as the 492 * item's author instead. 493 * 494 * @since 1.0.0 492 * If only one item remains, the document is returned with just that item, 493 * and the h-card becomes its author if it has none of its own. 494 * 495 * @since 1.0.0 496 * @since 2.0.1 The remaining item keeps its own author, and is no longer 497 * lost when the h-card came first. 495 498 * 496 499 * @param array $input Parsed mf2 document. 497 * @return array Parsed mf2 document with one h-feed item. 500 * @return array Parsed mf2 document with one item: an h-feed, or the only 501 * item that isn't the h-card. 498 502 */ 499 503 public static function normalize_feed( $input ) { … … 506 510 } 507 511 } 512 $input['items'] = array_values( $input['items'] ); 513 $author = $hcard ? array( 'author' => array( $hcard ) ) : array(); 508 514 if ( 1 === count( $input['items'] ) ) { 509 if ( self::has_prop( $input['items'][0], 'author' ) ) {515 if ( $hcard && ! self::has_prop( $input['items'][0], 'author' ) ) { 510 516 $input['items'][0]['properties']['author'] = array( $hcard ); 511 517 } … … 516 522 array( 517 523 'type' => array( 'h-feed' ), 518 'properties' => array( 519 'author' => array( $hcard ), 520 ), 524 'properties' => $author, 521 525 'children' => $input['items'], 522 526 ), … … 1043 1047 * 1044 1048 * Microformats2 parsing is vocabulary-agnostic, so any h-* root gets the 1045 * generic properties from parse_h() and its type without the h- prefix, 1046 * as jf2 does for known types (h-org becomes org). 1047 * 1048 * @since 1.0.0 1049 * generic properties from parse_h(), every other property it has (as 1050 * get_prop_array() converts them), and its type without the h- prefix, as 1051 * jf2 does for known types (h-org becomes org, h-review-aggregate becomes 1052 * review-aggregate). 1053 * 1054 * @since 1.0.0 1055 * @since 2.0.1 Passes through all properties parse_h() doesn't read, even 1056 * ones known from other types (category, photo, rating), and 1057 * keeps items that have none of the generic properties. 1049 1058 * 1050 1059 * @param array $unknown Microformat. 1051 1060 * @param array $mf Parsed mf2 document. 1052 1061 * @param array $args Parse arguments (see Parser::parse()). 1053 * @return array jf2 with the generic properties and the type, or an empty1054 * array ifthe type isn't h-* or no properties were found.1062 * @return array jf2 with the properties and the type, or an empty array if 1063 * the type isn't h-* or no properties were found. 1055 1064 */ 1056 1065 public static function parse_hunknown( $unknown, $mf, $args ) { … … 1059 1068 return array(); 1060 1069 } 1061 // Parse unknown h property.1062 1070 $data = self::parse_h( $unknown, $mf, $args ); 1071 // parse_h() reads these, and may drop one on purpose (a name that repeats 1072 // the content), so only the rest are passed through. 1073 $generic = array( 'name', 'published', 'updated', 'url', 'author', 'content', 'summary' ); 1074 $rest = array_diff( array_keys( (array) ( $unknown['properties'] ?? array() ) ), $generic, array_keys( $data ) ); 1075 if ( $rest ) { 1076 $data = array_merge( $data, self::filter_empty( self::get_prop_array( $unknown, array_values( $rest ), $args ) ) ); 1077 } 1063 1078 if ( empty( $data ) ) { 1064 1079 return array(); … … 1074 1089 * Reads name, published, updated, url, author, content and summary, drops 1075 1090 * the name when it only repeats the start of the content (see 1076 * name_is_content_prefix()), and adds the document's rel=syndication links. 1091 * name_is_content_prefix()), and adds the document's rel=syndication links 1092 * to the item's own syndication. 1077 1093 * 1078 1094 * @since 1.0.0 1079 1095 * @since 2.0.0 Drops a name that is a prefix of the content, including a 1080 1096 * truncated one, not only one that contains all of it. 1097 * @since 2.0.1 rel=syndication links are merged with the item's own 1098 * syndication instead of replacing it. 1081 1099 * 1082 1100 * @param array $entry Microformat. … … 1108 1126 } 1109 1127 1128 // The page's rel=syndication links add to the item's own u-syndication; 1129 // callers merge this result over their own properties. 1110 1130 if ( isset( $mf['rels']['syndication'] ) ) { 1111 if ( isset( $data['syndication'] ) ) { 1112 if ( is_string( $data['syndication'] ) ) { 1113 $data['syndication'] = array( $data['syndication'] ); 1114 } 1115 $data['syndication'] = array_unique( array_merge( $data['syndication'], $mf['rels']['syndication'] ) ); 1116 } else { 1117 $data['syndication'] = $mf['rels']['syndication']; 1118 } 1131 $own = array_filter( (array) ( self::get_prop_array( $entry, array( 'syndication' ), $args )['syndication'] ?? array() ), 'is_string' ); 1132 $data['syndication'] = array_values( array_unique( array_merge( $own, $mf['rels']['syndication'] ) ) ); 1119 1133 } 1120 1134 return self::filter_empty( $data ); … … 1470 1484 $properties = array( 'category', 'item' ); 1471 1485 $data = array_merge( $data, self::get_prop_array( $entry, $properties, $args ) ); 1472 $properties = array();1473 foreach ( $properties as $p ) {1474 $v = self::get_plaintext( $entry, $p );1475 if ( null !== $v ) {1476 $data[ $p ] = $v;1477 }1478 }1479 1486 $data = array_merge( $data, self::parse_h( $entry, $mf, $args ) ); 1480 1487 return self::filter_empty( $data ); … … 1504 1511 $properties = array( 'category', 'item' ); 1505 1512 $data = array_merge( $data, self::get_prop_array( $entry, $properties, $args ) ); 1506 $properties = array();1507 foreach ( $properties as $p ) {1508 $v = self::get_plaintext( $entry, $p );1509 if ( null !== $v ) {1510 $data[ $p ] = $v;1511 }1512 }1513 1513 $data = array_merge( $data, self::parse_h( $entry, $mf, $args ) ); 1514 1514 return self::filter_empty( $data ); … … 1579 1579 $properties = array( 'category', 'item' ); 1580 1580 $data = array_merge( $data, self::get_prop_array( $item, $properties, $args ) ); 1581 $properties = array();1582 foreach ( $properties as $p ) {1583 $v = self::get_plaintext( $item, $p );1584 if ( null !== $v ) {1585 $data[ $p ] = $v;1586 }1587 }1588 1581 $data = array_merge( $data, self::parse_h( $item, $mf, $args ) ); 1589 1582 return self::filter_empty( $data ); -
indieweb-post-kinds/trunk/lib/parse-this/includes/class-restapi.php
r3738687 r3810578 32 32 * 33 33 * @since 1.0.0 34 * @since 2.0.1 Returns null, rather than failing, when the field is not an 35 * object with a rendered value. 34 36 * 35 37 * @param string $key Field name. 36 38 * @param array $item REST API object. 37 * @return string|null The field's 'rendered' value, or null if absent. 39 * @return string|null The field's 'rendered' value, or null if absent or 40 * the field is not an object. 38 41 */ 39 42 public static function get_rendered( $key, $item ) { 40 if ( ! array_key_exists( $key, $item) ) {43 if ( ! isset( $item[ $key ] ) || ! is_array( $item[ $key ] ) ) { 41 44 return null; 42 45 } 43 if ( array_key_exists( 'rendered', $item[ $key ] ) ) { 44 return $item[ $key ]['rendered']; 45 } 46 return null; 46 return $item[ $key ]['rendered'] ?? null; 47 47 } 48 48 … … 279 279 return $return; 280 280 } else { 281 $content = self::fetch( $rest_url, '/wp/v2/posts ?_embed=1' );281 $content = self::fetch( $rest_url, '/wp/v2/posts' ); 282 282 if ( is_wp_error( $content ) || ! is_array( $content ) ) { 283 283 return $content; -
indieweb-post-kinds/trunk/lib/parse-this/includes/class-rss.php
r3738687 r3810578 102 102 * 103 103 * @since 1.0.0 104 * @since 2.0.1 An author whose name is a single link is no longer dropped. 104 105 * 105 106 * @param SimplePie_Author|SimplePie_Author[]|null $author One author or a list. … … 129 130 if ( ! empty( $names ) ) { 130 131 if ( 1 === count( $names ) ) { 131 reset( $names ); 132 $r['name'] = key( $names ); 132 $r['name'] = (string) key( $names ); 133 $r['url'] = reset( $names ) ? reset( $names ) : $r['url']; 134 $return[] = array_filter( $r ); 133 135 } else { 134 136 foreach ( $names as $name => $url ) { -
indieweb-post-kinds/trunk/lib/parse-this/includes/functions.php
r3738687 r3810578 1173 1173 } 1174 1174 } 1175 1176 if ( ! function_exists( __NAMESPACE__ . '\\pt_is_http_url' ) ) { 1177 /** 1178 * Checks whether a string is an absolute http(s) URL with a host. 1179 * 1180 * This is a syntax check only. Unlike wp_http_validate_url(), it does not 1181 * resolve the host, so it is cheap and gives the same answer whether or not 1182 * the site is reachable. Use it to decide what a value is (a URL or a 1183 * name); fetching still goes through pt_remote_get(), which rejects unsafe 1184 * hosts. 1185 * 1186 * @since 2.0.1 1187 * 1188 * @param mixed $url Value to check. 1189 * @return bool True if $url is an http or https URL with a host. 1190 */ 1191 function pt_is_http_url( $url ) { 1192 if ( ! is_string( $url ) || preg_match( '/\s/', $url ) ) { 1193 return false; 1194 } 1195 $parts = wp_parse_url( $url ); 1196 return is_array( $parts ) && ! empty( $parts['host'] ) && in_array( strtolower( $parts['scheme'] ?? '' ), array( 'http', 'https' ), true ); 1197 } 1198 } -
indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Parser/DOMTreeBuilder.php
r3738687 r3810578 372 372 373 373 if (false !== $needsWorkaround) { 374 $xml = "<$lname xmlns=\" $needsWorkaround\" " . (strlen($prefix) && isset($this->nsStack[0][$prefix]) ? ("xmlns:$prefix=\"" . $this->nsStack[0][$prefix]. '"') : '') . '/>';374 $xml = "<$lname xmlns=\"" . htmlspecialchars($needsWorkaround, ENT_QUOTES | ENT_XML1, 'UTF-8') . '" ' . (strlen($prefix) && isset($this->nsStack[0][$prefix]) ? ("xmlns:$prefix=\"" . htmlspecialchars($this->nsStack[0][$prefix], ENT_QUOTES | ENT_XML1, 'UTF-8') . '"') : '') . '/>'; 375 375 376 376 $frag = new \DOMDocument('1.0', 'UTF-8'); 377 $frag->loadXML($xml); 377 $previous = libxml_use_internal_errors(true); 378 try { 379 $loaded = $frag->loadXML($xml); 380 } finally { 381 libxml_clear_errors(); 382 libxml_use_internal_errors($previous); 383 } 384 if (!$loaded || null === $frag->documentElement) { 385 throw new \DOMException('Invalid namespace declaration'); 386 } 378 387 379 388 $ele = $this->doc->importNode($frag->documentElement, true); … … 386 395 } 387 396 } catch (\DOMException $e) { 388 $this->parseError("Illegal tag name : <$lname>. Replaced with <invalid>.");397 $this->parseError("Illegal tag name or namespace: <$lname>. Replaced with <invalid>."); 389 398 $ele = $this->doc->createElement('invalid'); 390 399 } … … 672 681 return true; 673 682 } 683 684 // Stop at an ancestor whose own insertion would already have closed 685 // any open <p>. Inserting an AUTOCLOSE_P element calls autoclose('p'), 686 // which moves the insertion point above the <p>, so no <p> can still 687 // be open further up. Without this the walk runs to the document root 688 // on every block-level start tag, making deeply nested markup 689 // quadratic. Elements that are BLOCK_TAG but not AUTOCLOSE_P (table, 690 // address, canvas, dd, hr, noscript, output, tfoot) are NOT boundaries, 691 // because they nest inside a <p> without closing it. 692 if ('p' === $tagName 693 && $working !== $this->current 694 && Elements::isA($working->tagName, Elements::AUTOCLOSE_P)) { 695 return false; 696 } 674 697 } while ($working = $working->parentNode); 675 698 -
indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Parser/Scanner.php
r2839509 r3810578 30 30 31 31 /** 32 * Cached byte offset, line and column of the last position lookup. 33 * 34 * Lets currentLine() and columnOffset() advance from the previous lookup 35 * instead of rescanning the input from the start for every parse error. 36 */ 37 private $posChar = 0; 38 private $posLine = 1; 39 private $posColumn = 0; 40 41 /** 32 42 * Parse errors. 33 43 */ … … 247 257 // Add one to $this->char because we want the number for the next 248 258 // byte to be processed. 249 return substr_count($this->data, "\n", 0, min($this->char, $this->EOF)) + 1; 259 $this->advancePosition(min($this->char, $this->EOF)); 260 261 return $this->posLine; 262 } 263 264 /** 265 * Move the cached line/column forward to the given byte offset. 266 * 267 * @param int $offset 268 */ 269 private function advancePosition($offset) 270 { 271 if ($offset < $this->posChar) { 272 $this->posChar = 0; 273 $this->posLine = 1; 274 $this->posColumn = 0; 275 } 276 277 $segment = substr($this->data, $this->posChar, $offset - $this->posChar); 278 $this->posChar = $offset; 279 280 $lastNewline = strrpos($segment, "\n"); 281 if (false === $lastNewline) { 282 $this->posColumn += UTF8Utils::countChars($segment); 283 } else { 284 $this->posLine += substr_count($segment, "\n"); 285 $this->posColumn = UTF8Utils::countChars(substr($segment, $lastNewline + 1)); 286 } 250 287 } 251 288 … … 288 325 } 289 326 290 // strrpos is weird, and the offset needs to be negative for what we 291 // want (i.e., the last \n before $this->char). This needs to not have 292 // one (to make it point to the next character, the one we want the 293 // position of) added to it because strrpos's behaviour includes the 294 // final offset byte. 295 $backwardFrom = $this->char - 1 - strlen($this->data); 296 $lastLine = strrpos($this->data, "\n", $backwardFrom); 297 298 // However, for here we want the length up until the next byte to be 299 // processed, so add one to the current byte ($this->char). 300 if (false !== $lastLine) { 301 $findLengthOf = substr($this->data, $lastLine + 1, $this->char - 1 - $lastLine); 302 } else { 303 // After a newline. 304 $findLengthOf = substr($this->data, 0, $this->char); 305 } 306 307 return UTF8Utils::countChars($findLengthOf); 327 $this->advancePosition($this->char); 328 329 return $this->posColumn; 308 330 } 309 331 -
indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Parser/Tokenizer.php
r3738687 r3810578 568 568 protected function quotedAttributeValue($quote) 569 569 { 570 $stoplist = "\f" .$quote;570 $stoplist = $quote; 571 571 $val = ''; 572 572 -
indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Parser/UTF8Utils.php
r3738687 r3810578 28 28 */ 29 29 30 use Masterminds\HTML5\Exception;31 32 30 class UTF8Utils 33 31 { … … 39 37 /** 40 38 * Count the number of characters in a string. 41 * UTF-8 aware. This will try (in order) iconv, MB, and finally a custom counter.39 * UTF-8 aware. 42 40 * 43 41 * @param string $string … … 47 45 public static function countChars($string) 48 46 { 49 // Get the length for the string we need. 50 if (function_exists('mb_strlen')) { 51 return mb_strlen($string, 'utf-8'); 52 } 53 54 if (function_exists('iconv_strlen')) { 55 return iconv_strlen($string, 'utf-8'); 56 } 57 58 $count = count_chars($string); 59 60 // 0x80 = 0x7F - 0 + 1 (one added to get inclusive range) 61 // 0x33 = 0xF4 - 0x2C + 1 (one added to get inclusive range) 62 return array_sum(array_slice($count, 0, 0x80)) + array_sum(array_slice($count, 0xC2, 0x33)); 47 return mb_strlen($string, 'utf-8'); 63 48 } 64 49 … … 89 74 // which contains links to the actual but reports as well as work around 90 75 // details. 91 if (function_exists('mb_convert_encoding')) {92 // mb library has the following behaviors:93 // - UTF-16 surrogates result in false.94 // - Overlongs and outside Plane 16 result in empty strings.76 // 77 // mb library has the following behaviors: 78 // - UTF-16 surrogates result in false. 79 // - Overlongs and outside Plane 16 result in empty strings. 95 80 96 // Before we run mb_convert_encoding we need to tell it what to do with 97 // characters it does not know. This could be different than the parent 98 // application executing this library so we store the value, change it 99 // to our needs, and then change it back when we are done. This feels 100 // a little excessive and it would be great if there was a better way. 101 $save = mb_substitute_character(); 102 mb_substitute_character('none'); 103 $data = mb_convert_encoding($data, 'UTF-8', $encoding); 104 mb_substitute_character($save); 105 } 106 // @todo Get iconv running in at least some environments if that is possible. 107 elseif (function_exists('iconv') && 'auto' !== $encoding) { 108 // fprintf(STDOUT, "iconv found\n"); 109 // iconv has the following behaviors: 110 // - Overlong representations are ignored. 111 // - Beyond Plane 16 is replaced with a lower char. 112 // - Incomplete sequences generate a warning. 113 $data = @iconv($encoding, 'UTF-8//IGNORE', $data); 114 } else { 115 throw new Exception('Not implemented, please install mbstring or iconv'); 116 } 81 // Before we run mb_convert_encoding we need to tell it what to do with 82 // characters it does not know. This could be different than the parent 83 // application executing this library so we store the value, change it 84 // to our needs, and then change it back when we are done. This feels 85 // a little excessive and it would be great if there was a better way. 86 $save = mb_substitute_character(); 87 mb_substitute_character(0xFFFD); 88 $data = mb_convert_encoding($data, 'UTF-8', $encoding); 89 mb_substitute_character($save); 117 90 118 91 /* -
indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Serializer/OutputRules.php
r3738687 r3810578 279 279 } 280 280 281 /** 282 * Write an entity reference node. 283 * 284 * Such a node carries the entity name only: its nodeValue is null and its 285 * textContent is empty, so it cannot go through text(). saveXML() gives 286 * back the reference as it was written, which is what DOMDocument does. 287 * 288 * @param \DOMEntityReference $ele The entity reference to write. 289 */ 290 public function entityReference($ele) 291 { 292 $this->wr($ele->ownerDocument->saveXML($ele)); 293 } 294 281 295 public function processorInstruction($ele) 282 296 { … … 301 315 foreach ($this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele) as $nsNode) { 302 316 if (!in_array($nsNode->nodeValue, $this->implicitNamespaces)) { 303 $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($ nsNode->nodeValue)->wr('"');317 $this->wr(' ')->wr($nsNode->nodeName)->wr('="')->wr($this->enc((string) $nsNode->nodeValue, true))->wr('"'); 304 318 } 305 319 } -
indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Serializer/Traverser.php
r2110745 r3810578 105 105 $this->rules->comment($node); 106 106 break; 107 case XML_ENTITY_REF_NODE: 108 // entityReference() is not on RulesInterface, so a custom rules 109 // implementation keeps the previous behaviour of skipping the node 110 // rather than fataling on a missing method. 111 if ($this->rules instanceof OutputRules) { 112 $this->rules->entityReference($node); 113 } 114 break; 107 115 // Currently we don't support embedding DTDs. 108 116 default: -
indieweb-post-kinds/trunk/lib/parse-this/lib/mf2/Parser.php
r3738687 r3810578 64 64 */ 65 65 function fetch($url, $convertClassic = true, &$curlInfo=null) { 66 $version = '0'; 67 if (is_array($curl = curl_version())) { 68 $version = $curl['version']; 69 } 70 66 71 $ch = curl_init(); 67 72 curl_setopt($ch, CURLOPT_URL, $url); … … 70 75 curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); 71 76 curl_setopt($ch, CURLOPT_MAXREDIRS, 5); 77 78 if (version_compare($version, '7.21.6', '>=')) { 79 // see https://curl.se/libcurl/c/CURLOPT_ACCEPT_ENCODING.html 80 curl_setopt($ch, CURLOPT_ACCEPT_ENCODING, ''); 81 } elseif (version_compare($version, '7.10.5', '>=')) { 82 // see https://curl.se/ch/7.10.5.html 83 curl_setopt($ch, CURLOPT_ENCODING, ''); 84 } 85 72 86 curl_setopt($ch, CURLOPT_HTTPHEADER, array( 73 87 'Accept: text/html' 74 88 )); 75 89 $html = curl_exec($ch); 90 91 if ($html === false) { 92 return null; 93 } 94 76 95 $info = $curlInfo = curl_getinfo($ch); 77 curl_close($ch); 96 if (PHP_VERSION_ID < 80000) { 97 curl_close($ch); 98 } 78 99 79 100 if (strpos(strtolower($info['content_type']), 'html') === false) { … … 94 115 */ 95 116 function unicodeToHtmlEntities($input) { 96 return mb_convert_encoding($input, 'HTML-ENTITIES', mb_detect_encoding($input)); 117 // Convert all non-ASCII characters to HTML numeric entities. 118 $convmap = [ 119 0x80, 0x1FFFFF, 0, 0x10FFFF, 120 ]; 121 122 return mb_encode_numericentity($input, $convmap, mb_detect_encoding($input), true); 97 123 } 98 124 … … 112 138 113 139 function unicodeTrim($str) { 114 // this is cheating. TODO: find a better way if this causes any problems 115 $str = str_replace(mb_convert_encoding(' ', 'UTF-8', 'HTML-ENTITIES'), ' ', $str); 116 $str = preg_replace('/^\s+/', '', $str); 117 return preg_replace('/\s+$/', '', $str); 140 return preg_replace('/^\s+|\s+$/u', '', $str); 118 141 } 119 142 … … 146 169 147 170 /** 171 * Registered with the XPath object and used within XPaths for finding root elements. 172 * @param string $class 173 * @return bool 174 */ 175 function classHasMf2RootClassname($class) { 176 return count(mfNamesFromClass($class, 'h-')) > 0; 177 } 178 179 /** 148 180 * Get Nested µf Property Name From Class 149 181 * … … 158 190 $propertyNames = array(); 159 191 160 $class = str_replace(array(' ', ' ', "\n"), ' ', $class); 161 foreach (explode(' ', $class) as $classname) { 162 foreach ($prefixes as $prefix) { 163 // Check if $classname is a valid property classname for $prefix. 164 if (mb_substr($classname, 0, mb_strlen($prefix)) == $prefix && $classname != $prefix) { 165 $propertyName = mb_substr($classname, mb_strlen($prefix)); 166 $propertyNames[$propertyName][] = $prefix; 167 } 192 foreach ($prefixes as $prefix) { 193 $classes = mfNamesFromClass($class, $prefix); 194 foreach ($classes as $property) { 195 $propertyNames[$property][] = $prefix; 168 196 } 169 197 } … … 356 384 */ 357 385 public function __construct($input, $url = null, $jsonMode = false) { 386 $emptyDocDefault = '<html><body></body></html>'; 358 387 libxml_use_internal_errors(true); 359 388 if (is_string($input)) { 389 if (empty($input)) { 390 $input = $emptyDocDefault; 391 } 392 360 393 if (class_exists('Masterminds\\HTML5')) { 361 394 $doc = new \Masterminds\HTML5(array('disable_html_ns' => true)); … … 369 402 } else { 370 403 $doc = new DOMDocument(); 371 @$doc->loadHTML(''); 372 } 373 404 @$doc->loadHTML($emptyDocDefault); 405 } 406 407 // Create an XPath object and allow some PHP functions to be used within XPath queries. 374 408 $this->xpath = new DOMXPath($doc); 409 $this->xpath->registerNamespace('php', 'http://php.net/xpath'); 410 $this->xpath->registerPhpFunctions('\\Mf2\\classHasMf2RootClassname'); 375 411 376 412 $baseurl = $url; … … 405 441 406 442 private function elementPrefixParsed(\DOMElement $e, $prefix) { 407 if (!$this->parsed-> contains($e))408 $this->parsed-> attach($e, array());443 if (!$this->parsed->offsetExists($e)) 444 $this->parsed->offsetSet($e, array()); 409 445 410 446 $prefixes = $this->parsed[$e]; … … 420 456 */ 421 457 private function isElementParsed(\DOMElement $e, $prefix) { 422 if (!$this->parsed-> contains($e)) {458 if (!$this->parsed->offsetExists($e)) { 423 459 return false; 424 460 } … … 440 476 */ 441 477 private function isElementUpgraded(\DOMElement $el, $property) { 442 if ( $this->upgraded-> contains($el) ) {478 if ( $this->upgraded->offsetExists($el) ) { 443 479 if ( in_array($property, $this->upgraded[$el]) ) { 444 480 return true; … … 586 622 */ 587 623 public function parseValueClassTitle(\DOMElement $e, $separator = '') { 588 $valueClassElements = $this->xpath->query('./*[contains(concat(" ", @class, " "), " value ")]', $e);624 $valueClassElements = $this->xpath->query('./*[contains(concat(" ", normalize-space(@class), " "), " value ")]', $e); 589 625 590 626 if ($valueClassElements->length !== 0) { … … 598 634 } 599 635 600 $valueTitleElements = $this->xpath->query('./*[contains(concat(" ", @class, " "), " value-title ")]', $e);636 $valueTitleElements = $this->xpath->query('./*[contains(concat(" ", normalize-space(@class), " "), " value-title ")]', $e); 601 637 602 638 if ($valueTitleElements->length !== 0) { … … 686 722 public function parseDT(\DOMElement $dt, &$dates = array(), &$impliedTimezone = null) { 687 723 // Check for value-class pattern 688 $valueClassChildren = $this->xpath->query('./*[contains(concat(" ", @class, " "), " value ") or contains(concat(" ", @class, " "), " value-title ")]', $dt);724 $valueClassChildren = $this->xpath->query('./*[contains(concat(" ", normalize-space(@class), " "), " value ") or contains(concat(" ", normalize-space(@class), " "), " value-title ")]', $dt); 689 725 $dtValue = false; 690 726 … … 938 974 public function parseH(\DOMElement $e, $is_backcompat = false, $has_nested_mf = false) { 939 975 // If it’s already been parsed (e.g. is a child mf), skip 940 if ($this->parsed-> contains($e)) {976 if ($this->parsed->offsetExists($e)) { 941 977 return null; 942 978 } … … 962 998 963 999 // Handle p-* 964 foreach ($this->xpath->query('.//*[contains(concat(" ", @class) ," p-")]', $e) as $p) {1000 foreach ($this->xpath->query('.//*[contains(concat(" ", normalize-space(@class)) ," p-")]', $e) as $p) { 965 1001 // element is already parsed 966 1002 if ($this->isElementParsed($p, 'p')) { … … 987 1023 988 1024 // Handle u-* 989 foreach ($this->xpath->query('.//*[contains(concat(" ", @class)," u-")]', $e) as $u) {1025 foreach ($this->xpath->query('.//*[contains(concat(" ", normalize-space(@class))," u-")]', $e) as $u) { 990 1026 // element is already parsed 991 1027 if ($this->isElementParsed($u, 'u')) { … … 1012 1048 1013 1049 // Handle dt-* 1014 foreach ($this->xpath->query('.//*[contains(concat(" ", @class), " dt-")]', $e) as $dt) {1050 foreach ($this->xpath->query('.//*[contains(concat(" ", normalize-space(@class)), " dt-")]', $e) as $dt) { 1015 1051 // element is already parsed 1016 1052 if ($this->isElementParsed($dt, 'dt')) { … … 1047 1083 1048 1084 // Handle e-* 1049 foreach ($this->xpath->query('.//*[contains(concat(" ", @class)," e-")]', $e) as $em) {1085 foreach ($this->xpath->query('.//*[contains(concat(" ", normalize-space(@class))," e-")]', $e) as $em) { 1050 1086 // element is already parsed 1051 1087 if ($this->isElementParsed($em, 'e')) { … … 1165 1201 'properties' => $return 1166 1202 ); 1167 1203 1168 1204 if(trim($e->getAttribute('id')) !== '') { 1169 1205 $parsed['id'] = trim($e->getAttribute("id")); … … 1507 1543 // start with mf2 root class name xpath 1508 1544 $xpaths = array( 1509 ' contains(concat(" ",normalize-space(@class)), " h-")'1545 '(php:function("\\Mf2\\classHasMf2RootClassname", normalize-space(@class)))' 1510 1546 ); 1511 1547 … … 1562 1598 break; 1563 1599 1600 case 'hfeed': 1601 $this->upgradeRelTagToCategory($el); 1602 break; 1603 1604 case 'hproduct': 1605 $review_and_hreview_aggregate = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " review ") and contains(concat(" ", normalize-space(@class), " "), " hreview-aggregate ")]', $el); 1606 1607 if ( $review_and_hreview_aggregate->length ) { 1608 foreach ( $review_and_hreview_aggregate as $tempEl ) { 1609 if ( !$this->hasRootMf2($tempEl) ) { 1610 $this->backcompat($tempEl, 'hreview-aggregate'); 1611 $this->addMfClasses($tempEl, 'p-review h-review-aggregate'); 1612 $this->addUpgraded($tempEl, array('review hreview-aggregate')); 1613 } 1614 } 1615 } 1616 1617 $review_and_hreview = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " review ") and contains(concat(" ", normalize-space(@class), " "), " hreview ")]', $el); 1618 1619 if ( $review_and_hreview->length ) { 1620 foreach ( $review_and_hreview as $tempEl ) { 1621 if ( !$this->hasRootMf2($tempEl) ) { 1622 $this->backcompat($tempEl, 'hreview'); 1623 $this->addMfClasses($tempEl, 'p-review h-review'); 1624 $this->addUpgraded($tempEl, array('review hreview')); 1625 } 1626 } 1627 } 1628 1629 break; 1630 1631 case 'hreview-aggregate': 1564 1632 case 'hreview': 1565 1633 $item_and_vcard = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " item ") and contains(concat(" ", normalize-space(@class), " "), " vcard ")]', $el); … … 1593 1661 if ( !$this->hasRootMf2($tempEl) ) { 1594 1662 $this->addMfClasses($tempEl, 'p-item h-product'); 1595 $this->backcompat($tempEl, ' vevent');1663 $this->backcompat($tempEl, 'hproduct'); 1596 1664 $this->addUpgraded($tempEl, array('item', 'hproduct')); 1597 1665 } … … 1599 1667 } 1600 1668 1669 $rel_self_bookmark = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@rel), " "), " self ") and contains(concat(" ", normalize-space(@rel), " "), " bookmark ")]', $el); 1670 1671 if ( $rel_self_bookmark->length ) { 1672 foreach ( $rel_self_bookmark as $tempEl ) { 1673 $this->addMfClasses($tempEl, 'u-url'); 1674 $this->addUpgraded($tempEl, array('self', 'bookmark')); 1675 } 1676 } 1677 1678 $reviewer_nodes = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " reviewer ")]', $el); 1679 1680 if ( $reviewer_nodes->length ) { 1681 foreach ( $reviewer_nodes as $tempEl ) { 1682 if ( !$this->hasRootMf2($tempEl) ) { 1683 $this->addMfClasses($tempEl, 'p-author h-card'); 1684 } 1685 } 1686 } 1687 1601 1688 $this->upgradeRelTagToCategory($el); 1602 1689 break; 1603 1690 1604 1691 case 'vevent': 1605 $location = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " location")]', $el);1606 1607 if ( $location ->length ) {1608 foreach ( $location as $tempEl ) {1692 $location_and_vcard = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " location ") and contains(concat(" ", normalize-space(@class), " "), " vcard ")]', $el); 1693 1694 if ( $location_and_vcard->length ) { 1695 foreach ( $location_and_vcard as $tempEl ) { 1609 1696 if ( !$this->hasRootMf2($tempEl) ) { 1610 $this->addMfClasses($tempEl, ' h-card');1697 $this->addMfClasses($tempEl, 'p-location h-card'); 1611 1698 $this->backcompat($tempEl, 'vcard'); 1699 $this->addUpgraded($tempEl, array('location', 'vcard')); 1612 1700 } 1613 1701 } … … 1658 1746 1659 1747 // add element to list of upgraded elements 1660 if ( !$this->upgraded-> contains($el) ) {1661 $this->upgraded-> attach($el, $property);1748 if ( !$this->upgraded->offsetExists($el) ) { 1749 $this->upgraded->offsetSet($el, $property); 1662 1750 } else { 1663 1751 $this->upgraded[$el] = array_merge($this->upgraded[$el], $property); … … 1688 1776 public function hasRootMf2(\DOMElement $el) { 1689 1777 $class = str_replace(array("\t", "\n"), ' ', $el->getAttribute('class')); 1690 $classes = array_filter(explode(' ', $class)); 1691 1692 foreach ( $classes as $classname ) { 1693 if ( strpos($classname, 'h-') === 0 ) { 1694 return true; 1695 } 1696 } 1697 1698 return false; 1778 1779 // Check for valid mf2 root classnames, not just any classname with a h- prefix. 1780 return count(mfNamesFromClass($class, 'h-')) > 0; 1699 1781 } 1700 1782 … … 1713 1795 // replace all roots 1714 1796 foreach ($this->classicRootMap as $old => $new) { 1715 foreach ($xp->query('//*[contains(concat(" ", @class, " "), " ' . $old . ' ") and not(contains(concat(" ", @class, " "), " ' . $new . ' "))]') as $el) {1797 foreach ($xp->query('//*[contains(concat(" ", normalize-space(@class), " "), " ' . $old . ' ") and not(contains(concat(" ", normalize-space(@class), " "), " ' . $new . ' "))]') as $el) { 1716 1798 $el->setAttribute('class', $el->getAttribute('class') . ' ' . $new); 1717 1799 } … … 1721 1803 $newRoot = $this->classicRootMap[$oldRoot]; 1722 1804 foreach ($properties as $old => $data) { 1723 foreach ($xp->query('//*[contains(concat(" ", @class, " "), " ' . $oldRoot . ' ")]//*[contains(concat(" ", @class, " "), " ' . $old . ' ") and not(contains(concat(" ", @class, " "), " ' . $data['replace'] . ' "))]') as $el) {1805 foreach ($xp->query('//*[contains(concat(" ", normalize-space(@class), " "), " ' . $oldRoot . ' ")]//*[contains(concat(" ", normalize-space(@class), " "), " ' . $old . ' ") and not(contains(concat(" ", normalize-space(@class), " "), " ' . $data['replace'] . ' "))]') as $el) { 1724 1806 $el->setAttribute('class', $el->getAttribute('class') . ' ' . $data['replace']); 1725 1807 } … … 1756 1838 'vevent' => 'h-event', 1757 1839 'hreview' => 'h-review', 1840 'hreview-aggregate' => 'h-review-aggregate', 1758 1841 'hproduct' => 'h-product', 1759 1842 'adr' => 'h-adr', 1843 'geo' => 'h-geo' 1760 1844 ); 1761 1845 … … 1874 1958 ), 1875 1959 'hfeed' => array( 1876 # nothing currently 1960 'author' => array( 1961 'replace' => 'p-author h-card', 1962 'context' => 'vcard' 1963 ), 1964 'url' => array( 1965 'replace' => 'u-url' 1966 ), 1967 'photo' => array( 1968 'replace' => 'u-photo' 1969 ), 1970 'category' => array( 1971 'replace' => 'p-category' 1972 ), 1877 1973 ), 1878 1974 'hentry' => array( … … 1984 2080 ), 1985 2081 'location' => array( 1986 'replace' => 'h-card', 1987 'context' => 'vcard' 2082 'replace' => 'p-location', 1988 2083 ), 1989 2084 'geo' => array( 1990 2085 'replace' => 'p-location h-geo' 1991 2086 ), 2087 'attendee' => array( 2088 'replace' => 'p-attendee h-card', 2089 'context' => 'vcard' 2090 ) 1992 2091 ), 1993 2092 'hreview' => array( … … 2002 2101 'context' => 'item' 2003 2102 ), 2004 'reviewer' => array( 2005 'replace' => 'p-author h-card', 2006 'context' => 'vcard', 2007 ), 2103 # reviewer: see backcompat() 2008 2104 'dtreviewed' => array( 2009 2105 'replace' => 'dt-published' … … 2023 2119 'category' => array( 2024 2120 'replace' => 'p-category' 2121 ), 2122 ), 2123 'hreview-aggregate' => array( 2124 'summary' => array( 2125 'replace' => 'p-name' 2126 ), 2127 # fn: see item.fn below 2128 # photo: see item.photo below 2129 # url: see item.url below 2130 'item' => array( 2131 'replace' => 'p-item h-item', 2132 'context' => 'item' 2133 ), 2134 'rating' => array( 2135 'replace' => 'p-rating' 2136 ), 2137 'best' => array( 2138 'replace' => 'p-best' 2139 ), 2140 'worst' => array( 2141 'replace' => 'p-worst' 2142 ), 2143 'average' => array( 2144 'replace' => 'p-average' 2145 ), 2146 'count' => array( 2147 'replace' => 'p-count' 2148 ), 2149 'votes' => array( 2150 'replace' => 'p-votes' 2025 2151 ), 2026 2152 ), … … 2047 2173 'replace' => 'u-url', 2048 2174 ), 2049 'review' => array( 2050 'replace' => 'p-review h-review', 2051 ), 2175 // review is handled in the special processing section to allow for 'review hreview-aggregate' 2052 2176 'price' => array( 2053 2177 'replace' => 'p-price' -
indieweb-post-kinds/trunk/lib/parse-this/parse-this.php
r3738687 r3810578 4 4 * Plugin URI: https://github.com/dshanske/parse-this 5 5 * Description: Turns URLs into structured jf2 data from microformats2, JSON-LD, meta tags and RSS, Atom and JSON feeds. 6 * Version: 2.0. 06 * Version: 2.0.1 7 7 * Author: David Shanske 8 8 * Author URI: https://david.shanske.com … … 45 45 * @var string 46 46 */ 47 define( 'PARSE_THIS_VERSION', '2.0. 0' );47 define( 'PARSE_THIS_VERSION', '2.0.1' ); 48 48 } 49 49 require_once plugin_dir_path( __FILE__ ) . 'includes/autoload.php'; -
indieweb-post-kinds/trunk/lib/parse-this/readme.txt
r3738687 r3810578 2 2 Contributors: dshanske 3 3 Tags: indieweb, microformats, jf2, json-ld, feeds 4 Stable tag: 2.0. 04 Stable tag: 2.0.1 5 5 Requires at least: 6.2 6 6 Requires PHP: 7.4 … … 88 88 89 89 * `pt_rewrite_secure`: the list of domains whose `http://` URLs are upgraded to `https://` before fetching. 90 * `parse_this_img_filters`: an image URL found in a page, after the built-in exclusions (ads, spinners, tracking pixels and so on). Return an empty string to drop it.91 90 * `parse_this_url_shorteners`: the hosts treated as link shorteners. Links to them in a summary are expanded to where they redirect; other links are left as they are, without a request. 92 91 * `parse_this_native_html_parser`: whether to parse HTML with PHP's own HTML5 parser on PHP 8.4 and later. Default true. Return false to use the bundled masterminds/html5 parser instead; the two only differ on invalid markup, where PHP's parser does what browsers do. … … 162 161 163 162 == Changelog == 163 164 = 2.0.1 ( 2026-11-18 ) = 165 166 Bug fixes and maintenance. Plugins that bundle Parse This need no changes. 167 168 * Relative `<audio>` and `<video>` URLs found by the HTML parser are now made absolute. 169 * The bundled php-mf2 is updated to 0.5.1, and masterminds/html5 (the HTML parser used before PHP 8.4) to 2.12.0. php-mf2 no longer raises PHP 8.2 and 8.5 deprecation notices while parsing (three remain on PHP 8.4+ when the file loads, fixed upstream but not yet released). It also parses classic hReview markup better: the reviewer becomes the author, and hreview-aggregate and geo are recognized. 170 * Unused and unreachable code is removed, including the `limit_array()`, `limit_url()`, `limit_img()` and `limit_embed()` helpers, a commented-out block in the HTML parser that would have scraped every image, embed and link on a page, and the `parse_this_img_filters` filter, which could no longer run. 171 * Code coverage is measured in CI, and the test suite now covers about 95% of the plugin's code. PHP 8.5 is fully supported. 172 * WordPress REST API: a feed of a site with plain permalinks no longer requests a route that doesn't exist, and a field that isn't a `{rendered}` object no longer causes a fatal error. 173 * Microformats: types Parse This has no handler for (h-review-aggregate, h-x-*) keep all their properties, including category, photo and rating; old-style hreview-aggregate markup is no longer lost. A feed request for a page with an h-card and one other item now returns that item, with the h-card as its author only if it has none. A page's `rel=syndication` links are added to an entry's own syndication instead of replacing it. Author URLs are recognized by their syntax, without a DNS lookup, so an author whose site is unreachable is no longer given its URL as a name. 174 * JSON-LD: `creator` no longer replaces `author`; plain-text addresses are kept as the card's label; an ImageObject without `url` uses `contentUrl` or `@id`; a person can organize an event; music release artists are plain cards, and a single artist is accepted; audio and video transcripts use `content.text`. 175 * Meta tags: Parse.ly tags are trimmed, `article:modified_time` becomes `updated`, and Dublin Core tags are read whatever their case (`DC.title`, `dc.title`, `DCTERMS.*`). 176 * RSS: an author whose name is a single link is no longer dropped. 164 177 165 178 = 2.0.0 ( 2026-10-03 ) = … … 222 235 == Upgrade Notice == 223 236 237 = 2.0.1 = 238 Bug fixes for the JSON-LD, microformats, meta tag, RSS and WordPress REST API parsers, and updated bundled libraries. Plugins that use Parse This need no changes. 239 224 240 = 2.0.0 = 225 241 A major update: classes and functions move to the ParseThis namespace (the old names Post Kinds and Yarns use still work), the output format changes in places, and the REST endpoint now requires the edit_posts capability. Requires PHP 7.4 and WordPress 6.2. -
indieweb-post-kinds/trunk/readme.txt
r3771941 r3810578 2 2 Contributors: dshanske 3 3 Tags: indieweb, interaction, posts, webmention, share, like, scrobble 4 Stable tag: 4.0. 14 Stable tag: 4.0.2 5 5 Requires at least: 6.2 6 6 Requires PHP: 7.4 … … 305 305 306 306 == Changelog == 307 308 = 4.0.2 ( 2026-11-18 ) = 309 * Update the bundled Parse This to 2.0.1, with fixes to how citations are read from microformats, JSON-LD, meta tags, RSS and the WordPress REST API, and updated php-mf2 and HTML5 parsers 310 * Fix accented and non-Latin text in media metadata, such as an audio file's title or artist, being garbled when it was saved ("Café" became "Café"). Metadata already saved this way isn't repaired 311 * Fix category and tag archives linked by ID (`?cat=5`, the default on sites with plain permalinks) having an empty title and causing PHP warnings 312 * The embed template for a kind is now named after its slug (`embed-post-like.php`), so it no longer depends on the site's language. The old name (`embed-post-Like.php`) still works 313 * Fix the `tz_timezone_to_seconds()` helper, which failed on every call (a fatal error on PHP 8) 314 * Every kind shown in the editor except photo, video and audio now has a field schema (returned by the `post-kinds/1.0/fields` REST route), built from shared field sets; citations are marked required, and ratings, times and read status are optional fields. The checkin schema is a place reference (name and URL); its unused address and coordinate fields are removed. This is groundwork for editors driven by the schema 315 * Deprecate the `title` argument of `register_post_kind()`: a kind has a title when its properties include a `name` field. Passing `'title' => true` still works and adds one 316 * `Kind_Fields`, which builds editor fields from a kind's schema, now works: fields render escaped, with structured names (`mf2_in-reply-to[name]`); `rebuild_data()` reassembles submitted fields; the new `sanitize()` validates values by field type for any editor or REST client; and fields can be marked required, with `missing()` listing the empty ones. Its time zone list uses current names 317 * Code coverage is measured in CI, and the test suite now covers about 92% of the plugin's code 307 318 308 319 = 4.0.1 ( 2026-10-28 ) =
Note:
See TracChangeset
for help on using the changeset viewer.