Plugin Directory

Changeset 3810578


Ignore:
Timestamp:
11/19/2026 03:23:05 AM (less than one hour ago)
Author:
dshanske
Message:

Update to version 4.0.2 from GitHub

Location:
indieweb-post-kinds
Files:
4 added
56 edited
1 copied

Legend:

Unmodified
Added
Removed
  • indieweb-post-kinds/tags/4.0.2/.gitattributes

    r3738687 r3810578  
    55/tests export-ignore
    66/bin export-ignore
     7/build export-ignore
    78/node_modules export-ignore
    89/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.
     1Developer 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.
    22
    33== Template functions ==
    … …  
    2424`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.
    2525`set_post_kind_visibility( $slug, $show = true )` - Shows or hides a kind in Settings, including the kinds reserved for future use.
     26
     27A 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.
    2628
    2729== Time functions ==
    … …  
    122124* 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.
    123125* 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.
    124127
    125128== Styling icons ==
    … …  
    132135
    133136To 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
     138When 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.
    134139
    135140Copies 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  
    1212 * Generates form fields for the posting UI from a kind's property schema.
    1313 *
    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.
    1525 * - 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().
    2532 *
    2633 * @since 3.3.4
    … …  
    3138         * Returns a list of time zones with translated labels.
    3239         *
    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.
    3444         *
    3545         * @return string[] Labels, keyed by time zone identifier.
    3646         */
    3747        public static function timezone_list() {
    38                 return array(
     48                $zones = array(
    3949                        'Pacific/Niue'                   => __( '(GMT-11:00) Niue', 'indieweb-post-kinds' ),
    4050                        'Pacific/Pago_Pago'              => __( '(GMT-11:00) Pago Pago', 'indieweb-post-kinds' ),
    … …  
    109119                        'America/Cayenne'                => __( '(GMT-03:00) Cayenne', 'indieweb-post-kinds' ),
    110120                        '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' ),
    112122                        'America/Maceio'                 => __( '(GMT-03:00) Maceio', 'indieweb-post-kinds' ),
    113123                        'America/Miquelon'               => __( '(GMT-03:00) Miquelon', 'indieweb-post-kinds' ),
    … …  
    182192                        'Europe/Istanbul'                => __( '(GMT+02:00) Istanbul', 'indieweb-post-kinds' ),
    183193                        'Europe/Kaliningrad'             => __( '(GMT+02:00) Moscow-01 - Kaliningrad', 'indieweb-post-kinds' ),
    184                         'Europe/Kiev'                    => __( '(GMT+02:00) Kiev', 'indieweb-post-kinds' ),
     194                        'Europe/Kyiv'                    => __( '(GMT+02:00) Kyiv', 'indieweb-post-kinds' ),
    185195                        'Europe/Riga'                    => __( '(GMT+02:00) Riga', 'indieweb-post-kinds' ),
    186196                        'Europe/Sofia'                   => __( '(GMT+02:00) Sofia', 'indieweb-post-kinds' ),
    … …  
    215225                        'Indian/Kerguelen'               => __( '(GMT+05:00) Kerguelen', 'indieweb-post-kinds' ),
    216226                        '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' ),
    218228                        'Asia/Colombo'                   => __( '(GMT+05:30) Colombo', 'indieweb-post-kinds' ),
    219                         'Asia/Katmandu'                  => __( '(GMT+05:45) Katmandu', 'indieweb-post-kinds' ),
     229                        'Asia/Kathmandu'                 => __( '(GMT+05:45) Kathmandu', 'indieweb-post-kinds' ),
    220230                        'Antarctica/Vostok'              => __( '(GMT+06:00) Vostok', 'indieweb-post-kinds' ),
    221231                        'Asia/Almaty'                    => __( '(GMT+06:00) Almaty', 'indieweb-post-kinds' ),
    … …  
    225235                        'Asia/Thimphu'                   => __( '(GMT+06:00) Thimphu', 'indieweb-post-kinds' ),
    226236                        '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' ),
    228238                        'Indian/Cocos'                   => __( '(GMT+06:30) Cocos', 'indieweb-post-kinds' ),
    229239                        'Antarctica/Davis'               => __( '(GMT+07:00) Davis', 'indieweb-post-kinds' ),
    … …  
    232242                        'Asia/Jakarta'                   => __( '(GMT+07:00) Jakarta', 'indieweb-post-kinds' ),
    233243                        'Asia/Krasnoyarsk'               => __( '(GMT+07:00) Moscow+04 - Krasnoyarsk', 'indieweb-post-kinds' ),
    234                         'Asia/Saigon'                    => __( '(GMT+07:00) Hanoi', 'indieweb-post-kinds' ),
    235244                        'Asia/Ho_Chi_Minh'               => __( '(GMT+07:00) Ho Chi Minh', 'indieweb-post-kinds' ),
    236245                        'Indian/Christmas'               => __( '(GMT+07:00) Christmas', 'indieweb-post-kinds' ),
    237246                        'Antarctica/Casey'               => __( '(GMT+08:00) Casey', 'indieweb-post-kinds' ),
    238247                        'Asia/Brunei'                    => __( '(GMT+08:00) Brunei', 'indieweb-post-kinds' ),
    239                         'Asia/Choibalsan'                => __( '(GMT+08:00) Choibalsan', 'indieweb-post-kinds' ),
    240248                        'Asia/Hong_Kong'                 => __( '(GMT+08:00) Hong Kong', 'indieweb-post-kinds' ),
    241249                        'Asia/Irkutsk'                   => __( '(GMT+08:00) Moscow+05 - Irkutsk', 'indieweb-post-kinds' ),
    … …  
    284292                        'Pacific/Wallis'                 => __( '(GMT+12:00) Wallis', 'indieweb-post-kinds' ),
    285293                        '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' ),
    287295                        'Pacific/Fakaofo'                => __( '(GMT+13:00) Fakaofo', 'indieweb-post-kinds' ),
    288296                        'Pacific/Tongatapu'              => __( '(GMT+13:00) Tongatapu', 'indieweb-post-kinds' ),
    289297                        'Pacific/Kiritimati'             => __( '(GMT+14:00) Kiritimati', 'indieweb-post-kinds' ),
    290298                );
     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 );
    291311        }
    292312
    … …  
    295315         *
    296316         * @since 3.3.4
     317         * @since 4.0.2 Uses get_gmt_offsets().
    297318         *
    298319         * @return string[] Offsets such as '-05:00'.
    299320         */
    300321        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"';
    315382        }
    316383
    … …  
    318385         * Renders date, time and offset inputs.
    319386         *
    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.
    324394         * @return string The inputs.
    325395         */
    326396        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() );
    332400                }
    333401                $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'] ) );
    339406                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 ) );
    341408                }
    342409                $return[] = '</select></label>';
    … …  
    345412
    346413        /**
    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.
    353422         * @return string The inputs.
    354423         */
    355424        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'] );
    362435                $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 );
    373437                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                        );
    375447                }
    376448                $return[] = '</label>';
    … …  
    379451
    380452        /**
    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(
    394461                        'name'  => array(
    395462                                'type'  => 'text',
    … …  
    405472                        ),
    406473                );
    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.
    419676         *
    420677         * @since 3.3.4
    … …  
    425682         */
    426683        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>';
    431688                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 ) );
    433690                }
    434691                $return[] = '</select></label>';
    435692                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                );
    436715        }
    437716
    … …  
    446725         */
    447726        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 );
    453728        }
    454729
    455730        /**
    456731         * 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.
    457745         *
    458746         * @since 3.3.4
    … …  
    462750         * @return string The input.
    463751         */
    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.
    479763         * @return string The input.
    480764         */
    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.4
    493          *
    494          * @param array  $args  Field arguments, as returned by validate().
    495          * @param string $value Value.
    496          * @return string The input.
    497          */
    498765        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                );
    504777        }
    505778
    … …  
    515788        public static function field_list( $args, $value ) {
    516789                if ( is_array( $value ) ) {
    517                         $value = implode( ';', $value );
     790                        $value = implode( ';', array_filter( $value, 'is_scalar' ) );
    518791                }
    519792                return self::field_textarea( $args, $value );
    … …  
    521794
    522795        /**
    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.
    529802         * @return string The inputs.
    530803         */
    531804        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.
    542815         * @return string The inputs.
    543816         */
    544817        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 : '';
    546863        }
    547864
    … …  
    581898         * Checks a field definition and fills in defaults.
    582899         *
    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.
    584906         *
    585907         * @param array $element Field definition.
    … …  
    587909         */
    588910        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 ) ) {
    591912                        return false;
    592913                }
    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.
    598914                if ( ! self::get( 'name', $element ) ) {
     915                        if ( ! self::get( 'label', $element ) ) {
     916                                return false;
     917                        }
    599918                        $element['name'] = sanitize_title( $element['label'] );
    600919                }
    601                 // If no label property then the name property copies over.
    602920                if ( ! self::get( 'label', $element ) ) {
    603921                        $element['label'] = $element['name'];
    604922                }
    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                }
    606926                if ( ! self::get( 'class', $element ) ) {
    607927                        $element['class'] = '';
    608928                }
    609                 // Class can be an array.
    610929                if ( is_array( $element['class'] ) ) {
    611930                        $element['class'] = implode( ' ', $element['class'] );
    612931                }
    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                }
    6191166                switch ( $type ) {
    6201167                        case 'cite':
    6211168                        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;
    6261205                        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;
    6311207                        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.4
    653          *
    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.
    6551231         * @return bool
    6561232         */
    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();
    7161328                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 );
    7191337                        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 ) );
    7701368        }
    7711369}
  • indieweb-post-kinds/tags/4.0.2/includes/class-kind-media-metadata.php

    r3738687 r3810578  
    340340
    341341        /**
    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.
    346348         *
    347349         * @since 3.3.0
    348          *
    349          * @param array $metadata An existing array with data.
    350          *
    351          * @return array Returns array of sanitized metadata.
     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.
    352354         */
    353355        public static function wp_sanitize_media_metadata( $metadata ) {
    354356                if ( ! is_array( $metadata ) ) {
    355                                 return $metadata;
     357                        return $metadata;
    356358                }
    357359                foreach ( $metadata as $name => $value ) {
    358                         if ( ! is_string( $value ) ) {
    359                                 continue;
    360                         }
    361360                        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                        }
    368373                }
    369374                return $metadata;
  • indieweb-post-kinds/tags/4.0.2/includes/class-kind-taxonomy.php

    r3771941 r3810578  
    372372
    373373        /**
    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.
    375379         *
    376380         * @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[]
    382387         */
    383388        public static function embed_template_hierarchy( $templates ) {
    384389                $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 );
    392404        }
    393405
    … …  
    10341046
    10351047        /**
    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.
    10371053         *
    10381054         * @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.
    10431058         */
    10441059        public static function get_terms_from_query() {
    10451060                global $wp_query;
    10461061                $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;
    10521074                                }
    10531075                        }
    … …  
    10691091        public static function kind_archive_prefix( $prefix ) {
    10701092                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 ) . ':';
    10751099                }
    10761100                return $prefix;
    … …  
    12871311         *     @type string $verb            The verb or action, such as 'Liked'. Default the slug.
    12881312         *     @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.
    12901315         *     @type string $format          Post format that maps to this kind. Default 'standard'.
    12911316         *     @type string $icon            Icon name. Default the slug.
    … …  
    12931318         *     @type string $description_url Link to more information.
    12941319         *     @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.
    12961322         *     @type bool   $show            Whether to show the kind in Settings. Default false.
    12971323         * }
  • indieweb-post-kinds/tags/4.0.2/includes/class-post-kind.php

    r3738687 r3810578  
    8888
    8989        /**
    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.
    9395         * @var bool
    9496         */
    … …  
    170172                );
    171173                $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                }
    172188                foreach ( $args as $property_name => $property_value ) {
    173189                        if ( 'extra' !== $property_name && property_exists( $this, $property_name ) ) {
    … …  
    177193                        }
    178194                }
     195                $this->title = isset( $this->properties['name'] );
    179196        }
    180197
  • indieweb-post-kinds/tags/4.0.2/includes/register-kinds.php

    r3738687 r3810578  
    1919                'verb'            => ' ',
    2020                'property'        => '',
    21                 'properties'      => array(),
     21                'properties'      => array(
     22                        'name' => Kind_Fields::title_field(),
     23                ),
    2224                'format'          => '',
    2325                'description'     => __( 'traditional long form content: a post with an explicit title and body', 'indieweb-post-kinds' ),
    2426                'description_url' => 'http://indieweb.org/article',
    2527                'shortlink'       => 'b',
    26                 'title'           => true,
    2728                'show'            => true,
    2829        )
    … …  
    4142                'description_url' => 'http://indieweb.org/note',
    4243                'shortlink'       => 't',
    43                 'title'           => false,
    4444                'show'            => false,
    4545        )
    … …  
    5454                'property'        => 'in-reply-to',
    5555                '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' ) ),
    10757                ),
    10858                'format'          => 'link',
    … …  
    11060                'description_url' => 'http://indieweb.org/reply',
    11161                'shortlink'       => 't',
    112                 'title'           => false,
    11362                'show'            => true,
    11463        )
    … …  
    12372                'property'        => 'repost-of',
    12473                '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' ) ),
    17675                ),
    17776                'format'          => '',
    … …  
    17978                'description_url' => 'http://indieweb.org/repost',
    18079                'shortlink'       => 'b',
    181                 'title'           => true,
    18280                'show'            => true,
    18381        )
    … …  
    19290                'property'        => 'like-of',
    19391                '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' ) ),
    24593                ),
    24694                'format'          => 'link',
    … …  
    24896                'description_url' => 'http://indieweb.org/like',
    24997                'shortlink'       => 'f',
    250                 'title'           => false,
    25198                'show'            => true,
    25299        )
    … …  
    261108                'property'        => 'favorite-of',
    262109                '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' ) ),
    314111                ),
    315112                'format'          => 'link',
    … …  
    317114                'description_url' => 'http://indieweb.org/favorite',
    318115                'shortlink'       => 'f',
    319                 'title'           => false,
    320116                'show'            => true,
    321117        )
    … …  
    330126                'property'        => 'bookmark-of',
    331127                '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' ) ),
    383129                ),
    384130                'format'          => 'link',
    … …  
    386132                'description_url' => 'http://indieweb.org/bookmark',
    387133                'shortlink'       => 'h',
    388                 'title'           => false,
    389134                'show'            => true,
    390135        )
    … …  
    402147                'description_url' => 'http://indieweb.org/photo',
    403148                'shortlink'       => 'p',
    404                 'title'           => false,
    405149                'show'            => true,
    406150        )
    … …  
    418162                'description_url' => 'http://indieweb.org/video',
    419163                'shortlink'       => 'a',
    420                 'title'           => false,
    421164                'show'            => true,
    422165        )
    … …  
    434177                'description_url' => 'http://indieweb.org/audio',
    435178                'shortlink'       => 'a',
    436                 'title'           => false,
    437179                'show'            => true,
    438180        )
    … …  
    450192                'description_url' => 'http://indieweb.org/tag',
    451193                'shortlink'       => 'd',
    452                 'title'           => false,
    453194                'show'            => false,
    454195        )
    … …  
    463204                'property'        => 'in-reply-to',
    464205                '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(
    496214                                                'type'  => 'datetime',
    497215                                                'label' => __( 'Start Date', 'indieweb-post-kinds' ),
    498216                                        ),
    499                                         'end'         => array(
     217                                        'end'       => array(
    500218                                                'type'  => 'datetime',
    501219                                                'label' => __( 'End Date', 'indieweb-post-kinds' ),
    502220                                        ),
    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                                )
    518222                        ),
    519223                ),
    … …  
    522226                'description_url' => 'http://indieweb.org/rsvp',
    523227                'shortlink'       => 't',
    524                 'title'           => false,
    525228                'show'            => true,
    526229        )
    … …  
    534237                'verb'            => __( 'Listened', 'indieweb-post-kinds' ),
    535238                '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                                        )
    582250                                ),
     251                                'rating'    => Kind_Fields::rating_field(),
    583252                        ),
     253                        Kind_Fields::time_fields()
    584254                ),
    585255                'format'          => 'audio',
    … …  
    587257                'description_url' => 'http://indieweb.org/listen',
    588258                'shortlink'       => 'x',
    589                 'title'           => false,
    590259                'show'            => true,
    591260        )
    … …  
    599268                'verb'            => __( 'Watched', 'indieweb-post-kinds' ),
    600269                '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                                        )
    647281                                ),
     282                                'rating'   => Kind_Fields::rating_field(),
    648283                        ),
     284                        Kind_Fields::time_fields()
    649285                ),
    650286                'format'          => 'video',
    … …  
    652288                'description_url' => 'http://indieweb.org/watch',
    653289                'shortlink'       => 'x',
    654                 'title'           => false,
    655290                'show'            => true,
    656291        )
    … …  
    664299                'verb'            => __( 'Checked into', 'indieweb-post-kinds' ),
    665300                'property'        => 'checkin',
     301                // A place reference, like a citation. Location details are left to Simple Location when it's active (#553).
    666302                'properties'      => array(
    667303                        'checkin' => array(
    668304                                'type'       => 'venue',
    669305                                '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' ) ),
    716308                        ),
    717309                ),
    … …  
    720312                'description_url' => 'http://indieweb.org/checkin',
    721313                'shortlink'       => 'g',
    722                 'title'           => false,
    723314                'show'            => true,
    724315        )
    … …  
    736327                'description_url' => '',
    737328                'shortlink'       => 'f',
    738                 'title'           => false,
    739329                'show'            => false,
    740330        )
    … …  
    748338                'verb'            => __( 'Played', 'indieweb-post-kinds' ),
    749339                '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                ),
    750347                'format'          => 'status',
    751348                'description'     => __( 'playing a game', 'indieweb-post-kinds' ),
    752349                'description_url' => 'https://indieweb.org/game_play',
    753350                'shortlink'       => 'x',
    754                 'title'           => false,
    755351                'show'            => true,
    756352        )
    … …  
    768364                'description_url' => 'https://indieweb.org/weather',
    769365                'shortlink'       => 'u',
    770                 'title'           => false,
    771366                'show'            => false,
    772367        )
    … …  
    784379                'description_url' => 'https://indieweb.org/exercise',
    785380                'shortlink'       => 'm',
    786                 'title'           => false,
    787381                'show'            => false,
    788382        )
    … …  
    800394                'description_url' => 'https://indieweb.org/trip',
    801395                'shortlink'       => 'e',
    802                 'title'           => false,
    803396                'show'            => false,
    804397        )
    … …  
    816409                'description_url' => 'https://indieweb.org/trip',
    817410                'shortlink'       => 'e',
    818                 'title'           => false,
    819411                'show'            => false,
    820412        )
    … …  
    829421                'verb'            => __( 'Ate', 'indieweb-post-kinds' ),
    830422                'property'        => 'ate',
     423                'properties'      => array(
     424                        'ate'    => Kind_Fields::cite_field( __( 'Ate', 'indieweb-post-kinds' ) ),
     425                        'rating' => Kind_Fields::rating_field(),
     426                ),
    831427                'format'          => 'status',
    832428                'description'     => __( 'what you are eating, perhaps for a food diary', 'indieweb-post-kinds' ),
    833429                'description_url' => 'https://indieweb.org/food',
    834430                'shortlink'       => 'u',
    835                 'title'           => false,
    836431                'show'            => true,
    837432        )
    … …  
    846441                'verb'            => __( 'Drank', 'indieweb-post-kinds' ),
    847442                'property'        => 'drank',
     443                'properties'      => array(
     444                        'drank'  => Kind_Fields::cite_field( __( 'Drank', 'indieweb-post-kinds' ) ),
     445                        'rating' => Kind_Fields::rating_field(),
     446                ),
    848447                'format'          => 'status',
    849448                'description'     => __( 'what you are drinking, perhaps for a food dairy', 'indieweb-post-kinds' ),
    850449                'description_url' => 'https://indieweb.org/food',
    851450                'shortlink'       => 'u',
    852                 'title'           => false,
    853451                'show'            => true,
    854452        )
    … …  
    867465                'description_url' => 'https://indieweb.org/follow',
    868466                'shortlink'       => 'f',
    869                 'title'           => false,
    870467                'show'            => false,
    871468        )
    … …  
    880477                'verb'            => __( 'Listened to', 'indieweb-post-kinds' ),
    881478                '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                ),
    882495                'format'          => 'audio',
    883496                'description'     => __( 'a particularly personally meaningful song (a listen with added emphasis)', 'indieweb-post-kinds' ),
    884497                'description_url' => 'https://indieweb.org/jam',
    885498                'shortlink'       => 'f',
    886                 'title'           => false,
    887499                'show'            => true,
    888500        )
    … …  
    897509                'verb'            => __( 'Read', 'indieweb-post-kinds' ),
    898510                '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                ),
    899519                'format'          => 'status',
    900520                'description'     => __( 'reading a book, magazine, newspaper, other physical document, or online post', 'indieweb-post-kinds' ),
    901521                'description_url' => 'https://indieweb.org/read',
    902522                'shortlink'       => 'x',
    903                 'title'           => false,
    904523                'show'            => true,
    905524        )
    … …  
    914533                'verb'            => __( 'Quoted', 'indieweb-post-kinds' ),
    915534                'property'        => 'quotation-of',
     535                'properties'      => array(
     536                        'quotation-of' => Kind_Fields::cite_field( __( 'Quoted', 'indieweb-post-kinds' ) ),
     537                ),
    916538                'format'          => 'quote',
    917539                'description'     => __( 'quoted content', 'indieweb-post-kinds' ),
    918540                'description_url' => 'https://indieweb.org/quote',
    919541                'shortlink'       => 't',
    920                 'title'           => false,
    921542                'show'            => true,
    922543        )
    … …  
    935556                'description_url' => 'https://indieweb.org/mood',
    936557                'shortlink'       => 't',
    937                 'title'           => false,
    938558                'show'            => false,
    939559        )
    … …  
    948568                'verb'            => __( 'Cooked', 'indieweb-post-kinds' ),
    949569                'property'        => 'recipe',
     570                'properties'      => array(
     571                        'name' => Kind_Fields::title_field(),
     572                ),
    950573                'format'          => '',
    951574                'description'     => __( 'list of ingredients and directions for making food or drink', 'indieweb-post-kinds' ),
    952575                'description_url' => 'https://indieweb.org/recipe',
    953576                'shortlink'       => 'b',
    954                 'title'           => true,
    955577                'show'            => false,
    956578        )
    … …  
    965587                'verb'            => __( 'Filed an Issue', 'indieweb-post-kinds' ),
    966588                '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                ),
    967593                'format'          => '',
    968594                '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' ),
    969595                'description_url' => 'https://indieweb.org/issue',
    970596                'shortlink'       => 't',
    971                 'title'           => true,
    972597                'show'            => true,
    973598        )
    … …  
    986611                'description_url' => 'https://indieweb.org/question',
    987612                'shortlink'       => 'q',
    988                 'title'           => false,
    989613                'show'            => false,
    990614        )
    … …  
    1003627                'description_url' => 'https://indieweb.org/sleep',
    1004628                'shortlink'       => 'm',
    1005                 'title'           => false,
    1006629                'show'            => false,
    1007630        )
    … …  
    1016639                'verb'            => __( 'Planned', 'indieweb-post-kinds' ),
    1017640                'property'        => 'event',
     641                'properties'      => array(
     642                        'name' => Kind_Fields::title_field(),
     643                ),
    1018644                'format'          => '',
    1019645                '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' ),
    1020646                'description_url' => 'https://indieweb.org/event',
    1021647                'shortlink'       => 'e',
    1022                 'title'           => true,
    1023648                'show'            => false,
    1024649        )
    … …  
    1032657                'verb'            => __( 'Reviewed', 'indieweb-post-kinds' ),
    1033658                'property'        => 'review-of',
     659                'properties'      => array(
     660                        'review-of' => Kind_Fields::cite_field( __( 'Reviewed', 'indieweb-post-kinds' ) ),
     661                        'rating'    => Kind_Fields::rating_field(),
     662                ),
    1034663                'format'          => '',
    1035664                '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' ),
    1036665                'description_url' => 'https://indieweb.org/review',
    1037666                'shortlink'       => 't',
    1038                 'title'           => false,
    1039667                'show'            => true,
    1040668        )
    … …  
    1053681                'description_url' => 'http://indieweb.org/acquisition',
    1054682                'shortlink'       => 'f',
    1055                 'title'           => false,
    1056683                'show'            => false,
    1057684        )
    … …  
    1065692                'verb'            => __( 'Crafted', 'indieweb-post-kinds' ),
    1066693                'property'        => 'craft-of',
     694                'properties'      => array(
     695                        'craft-of' => Kind_Fields::cite_field( __( 'Crafted', 'indieweb-post-kinds' ) ),
     696                ),
    1067697                'format'          => 'status',
    1068698                'description'     => __( 'Activities like knitting, crocheting, cross stitch, wood working, restoration, 3d printing...the activity of building something.', 'indieweb-post-kinds' ),
    1069699                'description_url' => 'https://indieweb.org/crafts',
    1070700                '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  
    123123if ( ! function_exists( 'tz_timezone_to_seconds' ) ) {
    124124        /**
    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.
    126129         *
    127130         * @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'.
    130134         * @return int|false Offset in seconds, or false if the time zone is not valid.
    131135         */
    132136        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 ) );
    138146        }
    139147}
  • indieweb-post-kinds/tags/4.0.2/indieweb-post-kinds.php

    r3771941 r3810578  
    88 * Plugin URI: https://wordpress.org/plugins/indieweb-post-kinds/
    99 * 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.1
     10 * Version: 4.0.2
    1111 * Requires at least: 6.2
    1212 * Requires PHP: 7.4
  • indieweb-post-kinds/tags/4.0.2/languages/indieweb-post-kinds.pot

    r3771941 r3810578  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Post Kinds 4.0.1\n"
     5"Project-Id-Version: Post Kinds 4.0.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieweb-post-kinds\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-10-29T01:48:12+00:00\n"
     12"POT-Creation-Date: 2026-11-19T03:09:43+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    147147msgstr ""
    148148
    149 #: includes/class-kind-fields.php:39
     149#: includes/class-kind-fields.php:49
    150150msgid "(GMT-11:00) Niue"
    151151msgstr ""
    152152
    153 #: includes/class-kind-fields.php:40
     153#: includes/class-kind-fields.php:50
    154154msgid "(GMT-11:00) Pago Pago"
    155155msgstr ""
    156156
    157 #: includes/class-kind-fields.php:41
     157#: includes/class-kind-fields.php:51
    158158msgid "(GMT-10:00) Hawaii Time"
    159159msgstr ""
    160160
    161 #: includes/class-kind-fields.php:42
     161#: includes/class-kind-fields.php:52
    162162msgid "(GMT-10:00) Rarotonga"
    163163msgstr ""
    164164
    165 #: includes/class-kind-fields.php:43
     165#: includes/class-kind-fields.php:53
    166166msgid "(GMT-10:00) Tahiti"
    167167msgstr ""
    168168
    169 #: includes/class-kind-fields.php:44
     169#: includes/class-kind-fields.php:54
    170170msgid "(GMT-09:30) Marquesas"
    171171msgstr ""
    172172
    173 #: includes/class-kind-fields.php:45
     173#: includes/class-kind-fields.php:55
    174174msgid "(GMT-09:00) Alaska Time"
    175175msgstr ""
    176176
    177 #: includes/class-kind-fields.php:46
     177#: includes/class-kind-fields.php:56
    178178msgid "(GMT-09:00) Gambier"
    179179msgstr ""
    180180
    181 #: includes/class-kind-fields.php:47
     181#: includes/class-kind-fields.php:57
    182182msgid "(GMT-08:00) Pacific Time"
    183183msgstr ""
    184184
    185 #: includes/class-kind-fields.php:48
     185#: includes/class-kind-fields.php:58
    186186msgid "(GMT-08:00) Pacific Time - Tijuana"
    187187msgstr ""
    188188
    189 #: includes/class-kind-fields.php:49
     189#: includes/class-kind-fields.php:59
    190190msgid "(GMT-08:00) Pacific Time - Vancouver"
    191191msgstr ""
    192192
    193 #: includes/class-kind-fields.php:50
     193#: includes/class-kind-fields.php:60
    194194msgid "(GMT-08:00) Pacific Time - Whitehorse"
    195195msgstr ""
    196196
    197 #: includes/class-kind-fields.php:51
     197#: includes/class-kind-fields.php:61
    198198msgid "(GMT-08:00) Pitcairn"
    199199msgstr ""
    200200
    201 #: includes/class-kind-fields.php:52
     201#: includes/class-kind-fields.php:62
    202202msgid "(GMT-07:00) Mountain Time - Dawson Creek"
    203203msgstr ""
    204204
    205 #: includes/class-kind-fields.php:53
     205#: includes/class-kind-fields.php:63
    206206msgid "(GMT-07:00) Mountain Time"
    207207msgstr ""
    208208
    209 #: includes/class-kind-fields.php:54
     209#: includes/class-kind-fields.php:64
    210210msgid "(GMT-07:00) Mountain Time - Edmonton"
    211211msgstr ""
    212212
    213 #: includes/class-kind-fields.php:55
     213#: includes/class-kind-fields.php:65
    214214msgid "(GMT-07:00) Mountain Time - Hermosillo"
    215215msgstr ""
    216216
    217 #: includes/class-kind-fields.php:56
     217#: includes/class-kind-fields.php:66
    218218msgid "(GMT-07:00) Mountain Time - Chihuahua, Mazatlan"
    219219msgstr ""
    220220
    221 #: includes/class-kind-fields.php:57
     221#: includes/class-kind-fields.php:67
    222222msgid "(GMT-07:00) Mountain Time - Arizona"
    223223msgstr ""
    224224
    225 #: includes/class-kind-fields.php:58
     225#: includes/class-kind-fields.php:68
    226226msgid "(GMT-07:00) Mountain Time - Yellowknife"
    227227msgstr ""
    228228
    229 #: includes/class-kind-fields.php:59
     229#: includes/class-kind-fields.php:69
    230230msgid "(GMT-06:00) Belize"
    231231msgstr ""
    232232
    233 #: includes/class-kind-fields.php:60
     233#: includes/class-kind-fields.php:70
    234234msgid "(GMT-06:00) Central Time"
    235235msgstr ""
    236236
    237 #: includes/class-kind-fields.php:61
     237#: includes/class-kind-fields.php:71
    238238msgid "(GMT-06:00) Costa Rica"
    239239msgstr ""
    240240
    241 #: includes/class-kind-fields.php:62
     241#: includes/class-kind-fields.php:72
    242242msgid "(GMT-06:00) El Salvador"
    243243msgstr ""
    244244
    245 #: includes/class-kind-fields.php:63
     245#: includes/class-kind-fields.php:73
    246246msgid "(GMT-06:00) Guatemala"
    247247msgstr ""
    248248
    249 #: includes/class-kind-fields.php:64
     249#: includes/class-kind-fields.php:74
    250250msgid "(GMT-06:00) Managua"
    251251msgstr ""
    252252
    253 #: includes/class-kind-fields.php:65
     253#: includes/class-kind-fields.php:75
    254254msgid "(GMT-06:00) Central Time - Mexico City"
    255255msgstr ""
    256256
    257 #: includes/class-kind-fields.php:66
     257#: includes/class-kind-fields.php:76
    258258msgid "(GMT-06:00) Central Time - Regina"
    259259msgstr ""
    260260
    261 #: includes/class-kind-fields.php:67
     261#: includes/class-kind-fields.php:77
    262262msgid "(GMT-06:00) Central Time - Tegucigalpa"
    263263msgstr ""
    264264
    265 #: includes/class-kind-fields.php:68
     265#: includes/class-kind-fields.php:78
    266266msgid "(GMT-06:00) Central Time - Winnipeg"
    267267msgstr ""
    268268
    269 #: includes/class-kind-fields.php:69
     269#: includes/class-kind-fields.php:79
    270270msgid "(GMT-06:00) Galapagos"
    271271msgstr ""
    272272
    273 #: includes/class-kind-fields.php:70
     273#: includes/class-kind-fields.php:80
    274274msgid "(GMT-05:00) Bogota"
    275275msgstr ""
    276276
    277 #: includes/class-kind-fields.php:71
     277#: includes/class-kind-fields.php:81
    278278msgid "(GMT-05:00) America Cancun"
    279279msgstr ""
    280280
    281 #: includes/class-kind-fields.php:72
     281#: includes/class-kind-fields.php:82
    282282msgid "(GMT-05:00) Cayman"
    283283msgstr ""
    284284
    285 #: includes/class-kind-fields.php:73
     285#: includes/class-kind-fields.php:83
    286286msgid "(GMT-05:00) Guayaquil"
    287287msgstr ""
    288288
    289 #: includes/class-kind-fields.php:74
     289#: includes/class-kind-fields.php:84
    290290msgid "(GMT-05:00) Havana"
    291291msgstr ""
    292292
    293 #: includes/class-kind-fields.php:75
     293#: includes/class-kind-fields.php:85
    294294msgid "(GMT-05:00) Eastern Time - Iqaluit"
    295295msgstr ""
    296296
    297 #: includes/class-kind-fields.php:76
     297#: includes/class-kind-fields.php:86
    298298msgid "(GMT-05:00) Jamaica"
    299299msgstr ""
    300300
    301 #: includes/class-kind-fields.php:77
     301#: includes/class-kind-fields.php:87
    302302msgid "(GMT-05:00) Lima"
    303303msgstr ""
    304304
    305 #: includes/class-kind-fields.php:78
     305#: includes/class-kind-fields.php:88
    306306msgid "(GMT-05:00) Nassau"
    307307msgstr ""
    308308
    309 #: includes/class-kind-fields.php:79
     309#: includes/class-kind-fields.php:89
    310310msgid "(GMT-05:00) Eastern Time"
    311311msgstr ""
    312312
    313 #: includes/class-kind-fields.php:80
     313#: includes/class-kind-fields.php:90
    314314msgid "(GMT-05:00) Panama"
    315315msgstr ""
    316316
    317 #: includes/class-kind-fields.php:81
     317#: includes/class-kind-fields.php:91
    318318msgid "(GMT-05:00) Port-au-Prince"
    319319msgstr ""
    320320
    321 #: includes/class-kind-fields.php:82
     321#: includes/class-kind-fields.php:92
    322322msgid "(GMT-05:00) Rio Branco"
    323323msgstr ""
    324324
    325 #: includes/class-kind-fields.php:83
     325#: includes/class-kind-fields.php:93
    326326msgid "(GMT-05:00) Eastern Time - Toronto"
    327327msgstr ""
    328328
    329 #: includes/class-kind-fields.php:84
     329#: includes/class-kind-fields.php:94
    330330msgid "(GMT-05:00) Easter Island"
    331331msgstr ""
    332332
    333 #: includes/class-kind-fields.php:85
     333#: includes/class-kind-fields.php:95
    334334msgid "(GMT-04:30) Caracas"
    335335msgstr ""
    336336
    337 #: includes/class-kind-fields.php:86
     337#: includes/class-kind-fields.php:96
    338338msgid "(GMT-03:00) Asuncion"
    339339msgstr ""
    340340
    341 #: includes/class-kind-fields.php:87
     341#: includes/class-kind-fields.php:97
    342342msgid "(GMT-04:00) Barbados"
    343343msgstr ""
    344344
    345 #: includes/class-kind-fields.php:88
     345#: includes/class-kind-fields.php:98
    346346msgid "(GMT-04:00) Boa Vista"
    347347msgstr ""
    348348
    349 #: includes/class-kind-fields.php:89
     349#: includes/class-kind-fields.php:99
    350350msgid "(GMT-03:00) Campo Grande"
    351351msgstr ""
    352352
    353 #: includes/class-kind-fields.php:90
     353#: includes/class-kind-fields.php:100
    354354msgid "(GMT-03:00) Cuiaba"
    355355msgstr ""
    356356
    357 #: includes/class-kind-fields.php:91
     357#: includes/class-kind-fields.php:101
    358358msgid "(GMT-04:00) Curacao"
    359359msgstr ""
    360360
    361 #: includes/class-kind-fields.php:92
     361#: includes/class-kind-fields.php:102
    362362msgid "(GMT-04:00) Grand Turk"
    363363msgstr ""
    364364
    365 #: includes/class-kind-fields.php:93
     365#: includes/class-kind-fields.php:103
    366366msgid "(GMT-04:00) Guyana"
    367367msgstr ""
    368368
    369 #: includes/class-kind-fields.php:94
     369#: includes/class-kind-fields.php:104
    370370msgid "(GMT-04:00) Atlantic Time - Halifax"
    371371msgstr ""
    372372
    373 #: includes/class-kind-fields.php:95
     373#: includes/class-kind-fields.php:105
    374374msgid "(GMT-04:00) La Paz"
    375375msgstr ""
    376376
    377 #: includes/class-kind-fields.php:96
     377#: includes/class-kind-fields.php:106
    378378msgid "(GMT-04:00) Manaus"
    379379msgstr ""
    380380
    381 #: includes/class-kind-fields.php:97
     381#: includes/class-kind-fields.php:107
    382382msgid "(GMT-04:00) Martinique"
    383383msgstr ""
    384384
    385 #: includes/class-kind-fields.php:98
     385#: includes/class-kind-fields.php:108
    386386msgid "(GMT-04:00) Port of Spain"
    387387msgstr ""
    388388
    389 #: includes/class-kind-fields.php:99
     389#: includes/class-kind-fields.php:109
    390390msgid "(GMT-04:00) Porto Velho"
    391391msgstr ""
    392392
    393 #: includes/class-kind-fields.php:100
     393#: includes/class-kind-fields.php:110
    394394msgid "(GMT-04:00) Puerto Rico"
    395395msgstr ""
    396396
    397 #: includes/class-kind-fields.php:101
     397#: includes/class-kind-fields.php:111
    398398msgid "(GMT-04:00) Santo Domingo"
    399399msgstr ""
    400400
    401 #: includes/class-kind-fields.php:102
     401#: includes/class-kind-fields.php:112
    402402msgid "(GMT-04:00) Thule"
    403403msgstr ""
    404404
    405 #: includes/class-kind-fields.php:103
     405#: includes/class-kind-fields.php:113
    406406msgid "(GMT-04:00) Bermuda"
    407407msgstr ""
    408408
    409 #: includes/class-kind-fields.php:104
     409#: includes/class-kind-fields.php:114
    410410msgid "(GMT-03:30) Newfoundland Time - St. Johns"
    411411msgstr ""
    412412
    413 #: includes/class-kind-fields.php:105
     413#: includes/class-kind-fields.php:115
    414414msgid "(GMT-03:00) Araguaina"
    415415msgstr ""
    416416
    417 #: includes/class-kind-fields.php:106
     417#: includes/class-kind-fields.php:116
    418418msgid "(GMT-03:00) Buenos Aires"
    419419msgstr ""
    420420
    421 #: includes/class-kind-fields.php:107
     421#: includes/class-kind-fields.php:117
    422422msgid "(GMT-03:00) Salvador"
    423423msgstr ""
    424424
    425 #: includes/class-kind-fields.php:108
     425#: includes/class-kind-fields.php:118
    426426msgid "(GMT-03:00) Belem"
    427427msgstr ""
    428428
    429 #: includes/class-kind-fields.php:109
     429#: includes/class-kind-fields.php:119
    430430msgid "(GMT-03:00) Cayenne"
    431431msgstr ""
    432432
    433 #: includes/class-kind-fields.php:110
     433#: includes/class-kind-fields.php:120
    434434msgid "(GMT-03:00) Fortaleza"
    435435msgstr ""
    436436
    437 #: includes/class-kind-fields.php:111
    438 msgid "(GMT-03:00) Godthab"
    439 msgstr ""
    440 
    441 #: includes/class-kind-fields.php:112
     437#: includes/class-kind-fields.php:121
     438msgid "(GMT-02:00) Nuuk"
     439msgstr ""
     440
     441#: includes/class-kind-fields.php:122
    442442msgid "(GMT-03:00) Maceio"
    443443msgstr ""
    444444
    445 #: includes/class-kind-fields.php:113
     445#: includes/class-kind-fields.php:123
    446446msgid "(GMT-03:00) Miquelon"
    447447msgstr ""
    448448
    449 #: includes/class-kind-fields.php:114
     449#: includes/class-kind-fields.php:124
    450450msgid "(GMT-03:00) Montevideo"
    451451msgstr ""
    452452
    453 #: includes/class-kind-fields.php:115
     453#: includes/class-kind-fields.php:125
    454454msgid "(GMT-03:00) Paramaribo"
    455455msgstr ""
    456456
    457 #: includes/class-kind-fields.php:116
     457#: includes/class-kind-fields.php:126
    458458msgid "(GMT-03:00) Recife"
    459459msgstr ""
    460460
    461 #: includes/class-kind-fields.php:117
     461#: includes/class-kind-fields.php:127
    462462msgid "(GMT-03:00) Santiago"
    463463msgstr ""
    464464
    465 #: includes/class-kind-fields.php:118
     465#: includes/class-kind-fields.php:128
    466466msgid "(GMT-02:00) Sao Paulo"
    467467msgstr ""
    468468
    469 #: includes/class-kind-fields.php:119
     469#: includes/class-kind-fields.php:129
    470470msgid "(GMT-03:00) Palmer"
    471471msgstr ""
    472472
    473 #: includes/class-kind-fields.php:120
     473#: includes/class-kind-fields.php:130
    474474msgid "(GMT-03:00) Rothera"
    475475msgstr ""
    476476
    477 #: includes/class-kind-fields.php:121
     477#: includes/class-kind-fields.php:131
    478478msgid "(GMT-03:00) Stanley"
    479479msgstr ""
    480480
    481 #: includes/class-kind-fields.php:122
     481#: includes/class-kind-fields.php:132
    482482msgid "(GMT-02:00) Noronha"
    483483msgstr ""
    484484
    485 #: includes/class-kind-fields.php:123
     485#: includes/class-kind-fields.php:133
    486486msgid "(GMT-02:00) South Georgia"
    487487msgstr ""
    488488
    489 #: includes/class-kind-fields.php:124
     489#: includes/class-kind-fields.php:134
    490490msgid "(GMT-01:00) Scoresbysund"
    491491msgstr ""
    492492
    493 #: includes/class-kind-fields.php:125
     493#: includes/class-kind-fields.php:135
    494494msgid "(GMT-01:00) Azores"
    495495msgstr ""
    496496
    497 #: includes/class-kind-fields.php:126
     497#: includes/class-kind-fields.php:136
    498498msgid "(GMT-01:00) Cape Verde"
    499499msgstr ""
    500500
    501 #: includes/class-kind-fields.php:127
     501#: includes/class-kind-fields.php:137
    502502msgid "(GMT+00:00) Abidjan"
    503503msgstr ""
    504504
    505 #: includes/class-kind-fields.php:128
     505#: includes/class-kind-fields.php:138
    506506msgid "(GMT+00:00) Accra"
    507507msgstr ""
    508508
    509 #: includes/class-kind-fields.php:129
     509#: includes/class-kind-fields.php:139
    510510msgid "(GMT+00:00) Bissau"
    511511msgstr ""
    512512
    513 #: includes/class-kind-fields.php:130
     513#: includes/class-kind-fields.php:140
    514514msgid "(GMT+00:00) Casablanca"
    515515msgstr ""
    516516
    517 #: includes/class-kind-fields.php:131
     517#: includes/class-kind-fields.php:141
    518518msgid "(GMT+00:00) El Aaiun"
    519519msgstr ""
    520520
    521 #: includes/class-kind-fields.php:132
     521#: includes/class-kind-fields.php:142
    522522msgid "(GMT+00:00) Monrovia"
    523523msgstr ""
    524524
    525 #: includes/class-kind-fields.php:133
     525#: includes/class-kind-fields.php:143
    526526msgid "(GMT+00:00) Danmarkshavn"
    527527msgstr ""
    528528
    529 #: includes/class-kind-fields.php:134
     529#: includes/class-kind-fields.php:144
    530530msgid "(GMT+00:00) Canary Islands"
    531531msgstr ""
    532532
    533 #: includes/class-kind-fields.php:135
     533#: includes/class-kind-fields.php:145
    534534msgid "(GMT+00:00) Faeroe"
    535535msgstr ""
    536536
    537 #: includes/class-kind-fields.php:136
     537#: includes/class-kind-fields.php:146
    538538msgid "(GMT+00:00) Reykjavik"
    539539msgstr ""
    540540
    541 #: includes/class-kind-fields.php:137
     541#: includes/class-kind-fields.php:147
    542542msgid "(GMT+00:00) GMT (no daylight saving)"
    543543msgstr ""
    544544
    545 #: includes/class-kind-fields.php:138
     545#: includes/class-kind-fields.php:148
    546546msgid "(GMT+00:00) Dublin"
    547547msgstr ""
    548548
    549 #: includes/class-kind-fields.php:139
     549#: includes/class-kind-fields.php:149
    550550msgid "(GMT+00:00) Lisbon"
    551551msgstr ""
    552552
    553 #: includes/class-kind-fields.php:140
     553#: includes/class-kind-fields.php:150
    554554msgid "(GMT+00:00) London"
    555555msgstr ""
    556556
    557 #: includes/class-kind-fields.php:141
     557#: includes/class-kind-fields.php:151
    558558msgid "(GMT+01:00) Algiers"
    559559msgstr ""
    560560
    561 #: includes/class-kind-fields.php:142
     561#: includes/class-kind-fields.php:152
    562562msgid "(GMT+01:00) Ceuta"
    563563msgstr ""
    564564
    565 #: includes/class-kind-fields.php:143
     565#: includes/class-kind-fields.php:153
    566566msgid "(GMT+01:00) Lagos"
    567567msgstr ""
    568568
    569 #: includes/class-kind-fields.php:144
     569#: includes/class-kind-fields.php:154
    570570msgid "(GMT+01:00) Ndjamena"
    571571msgstr ""
    572572
    573 #: includes/class-kind-fields.php:145
     573#: includes/class-kind-fields.php:155
    574574msgid "(GMT+01:00) Tunis"
    575575msgstr ""
    576576
    577 #: includes/class-kind-fields.php:146
     577#: includes/class-kind-fields.php:156
    578578msgid "(GMT+02:00) Windhoek"
    579579msgstr ""
    580580
    581 #: includes/class-kind-fields.php:147
     581#: includes/class-kind-fields.php:157
    582582msgid "(GMT+01:00) Amsterdam"
    583583msgstr ""
    584584
    585 #: includes/class-kind-fields.php:148
     585#: includes/class-kind-fields.php:158
    586586msgid "(GMT+01:00) Andorra"
    587587msgstr ""
    588588
    589 #: includes/class-kind-fields.php:149
     589#: includes/class-kind-fields.php:159
    590590msgid "(GMT+01:00) Central European Time - Belgrade"
    591591msgstr ""
    592592
    593 #: includes/class-kind-fields.php:150
     593#: includes/class-kind-fields.php:160
    594594msgid "(GMT+01:00) Berlin"
    595595msgstr ""
    596596
    597 #: includes/class-kind-fields.php:151
     597#: includes/class-kind-fields.php:161
    598598msgid "(GMT+01:00) Brussels"
    599599msgstr ""
    600600
    601 #: includes/class-kind-fields.php:152
     601#: includes/class-kind-fields.php:162
    602602msgid "(GMT+01:00) Budapest"
    603603msgstr ""
    604604
    605 #: includes/class-kind-fields.php:153
     605#: includes/class-kind-fields.php:163
    606606msgid "(GMT+01:00) Copenhagen"
    607607msgstr ""
    608608
    609 #: includes/class-kind-fields.php:154
     609#: includes/class-kind-fields.php:164
    610610msgid "(GMT+01:00) Gibraltar"
    611611msgstr ""
    612612
    613 #: includes/class-kind-fields.php:155
     613#: includes/class-kind-fields.php:165
    614614msgid "(GMT+01:00) Luxembourg"
    615615msgstr ""
    616616
    617 #: includes/class-kind-fields.php:156
     617#: includes/class-kind-fields.php:166
    618618msgid "(GMT+01:00) Madrid"
    619619msgstr ""
    620620
    621 #: includes/class-kind-fields.php:157
     621#: includes/class-kind-fields.php:167
    622622msgid "(GMT+01:00) Malta"
    623623msgstr ""
    624624
    625 #: includes/class-kind-fields.php:158
     625#: includes/class-kind-fields.php:168
    626626msgid "(GMT+01:00) Monaco"
    627627msgstr ""
    628628
    629 #: includes/class-kind-fields.php:159
     629#: includes/class-kind-fields.php:169
    630630msgid "(GMT+01:00) Oslo"
    631631msgstr ""
    632632
    633 #: includes/class-kind-fields.php:160
     633#: includes/class-kind-fields.php:170
    634634msgid "(GMT+01:00) Paris"
    635635msgstr ""
    636636
    637 #: includes/class-kind-fields.php:161
     637#: includes/class-kind-fields.php:171
    638638msgid "(GMT+01:00) Central European Time - Prague"
    639639msgstr ""
    640640
    641 #: includes/class-kind-fields.php:162
     641#: includes/class-kind-fields.php:172
    642642msgid "(GMT+01:00) Rome"
    643643msgstr ""
    644644
    645 #: includes/class-kind-fields.php:163
     645#: includes/class-kind-fields.php:173
    646646msgid "(GMT+01:00) Stockholm"
    647647msgstr ""
    648648
    649 #: includes/class-kind-fields.php:164
     649#: includes/class-kind-fields.php:174
    650650msgid "(GMT+01:00) Tirane"
    651651msgstr ""
    652652
    653 #: includes/class-kind-fields.php:165
     653#: includes/class-kind-fields.php:175
    654654msgid "(GMT+01:00) Vienna"
    655655msgstr ""
    656656
    657 #: includes/class-kind-fields.php:166
     657#: includes/class-kind-fields.php:176
    658658msgid "(GMT+01:00) Warsaw"
    659659msgstr ""
    660660
    661 #: includes/class-kind-fields.php:167
     661#: includes/class-kind-fields.php:177
    662662msgid "(GMT+01:00) Zurich"
    663663msgstr ""
    664664
    665 #: includes/class-kind-fields.php:168
     665#: includes/class-kind-fields.php:178
    666666msgid "(GMT+02:00) Cairo"
    667667msgstr ""
    668668
    669 #: includes/class-kind-fields.php:169
     669#: includes/class-kind-fields.php:179
    670670msgid "(GMT+02:00) Johannesburg"
    671671msgstr ""
    672672
    673 #: includes/class-kind-fields.php:170
     673#: includes/class-kind-fields.php:180
    674674msgid "(GMT+02:00) Maputo"
    675675msgstr ""
    676676
    677 #: includes/class-kind-fields.php:171
     677#: includes/class-kind-fields.php:181
    678678msgid "(GMT+02:00) Tripoli"
    679679msgstr ""
    680680
    681 #: includes/class-kind-fields.php:172
     681#: includes/class-kind-fields.php:182
    682682msgid "(GMT+02:00) Amman"
    683683msgstr ""
    684684
    685 #: includes/class-kind-fields.php:173
     685#: includes/class-kind-fields.php:183
    686686msgid "(GMT+02:00) Beirut"
    687687msgstr ""
    688688
    689 #: includes/class-kind-fields.php:174
     689#: includes/class-kind-fields.php:184
    690690msgid "(GMT+02:00) Damascus"
    691691msgstr ""
    692692
    693 #: includes/class-kind-fields.php:175
     693#: includes/class-kind-fields.php:185
    694694msgid "(GMT+02:00) Gaza"
    695695msgstr ""
    696696
    697 #: includes/class-kind-fields.php:176
     697#: includes/class-kind-fields.php:186
    698698msgid "(GMT+02:00) Jerusalem"
    699699msgstr ""
    700700
    701 #: includes/class-kind-fields.php:177
     701#: includes/class-kind-fields.php:187
    702702msgid "(GMT+02:00) Nicosia"
    703703msgstr ""
    704704
    705 #: includes/class-kind-fields.php:178
     705#: includes/class-kind-fields.php:188
    706706msgid "(GMT+02:00) Athens"
    707707msgstr ""
    708708
    709 #: includes/class-kind-fields.php:179
     709#: includes/class-kind-fields.php:189
    710710msgid "(GMT+02:00) Bucharest"
    711711msgstr ""
    712712
    713 #: includes/class-kind-fields.php:180
     713#: includes/class-kind-fields.php:190
    714714msgid "(GMT+02:00) Chisinau"
    715715msgstr ""
    716716
    717 #: includes/class-kind-fields.php:181
     717#: includes/class-kind-fields.php:191
    718718msgid "(GMT+02:00) Helsinki"
    719719msgstr ""
    720720
    721 #: includes/class-kind-fields.php:182
     721#: includes/class-kind-fields.php:192
    722722msgid "(GMT+02:00) Istanbul"
    723723msgstr ""
    724724
    725 #: includes/class-kind-fields.php:183
     725#: includes/class-kind-fields.php:193
    726726msgid "(GMT+02:00) Moscow-01 - Kaliningrad"
    727727msgstr ""
    728728
    729 #: includes/class-kind-fields.php:184
    730 msgid "(GMT+02:00) Kiev"
    731 msgstr ""
    732 
    733 #: includes/class-kind-fields.php:185
     729#: includes/class-kind-fields.php:194
     730msgid "(GMT+02:00) Kyiv"
     731msgstr ""
     732
     733#: includes/class-kind-fields.php:195
    734734msgid "(GMT+02:00) Riga"
    735735msgstr ""
    736736
    737 #: includes/class-kind-fields.php:186
     737#: includes/class-kind-fields.php:196
    738738msgid "(GMT+02:00) Sofia"
    739739msgstr ""
    740740
    741 #: includes/class-kind-fields.php:187
     741#: includes/class-kind-fields.php:197
    742742msgid "(GMT+02:00) Tallinn"
    743743msgstr ""
    744744
    745 #: includes/class-kind-fields.php:188
     745#: includes/class-kind-fields.php:198
    746746msgid "(GMT+02:00) Vilnius"
    747747msgstr ""
    748748
    749 #: includes/class-kind-fields.php:189
     749#: includes/class-kind-fields.php:199
    750750msgid "(GMT+03:00) Khartoum"
    751751msgstr ""
    752752
    753 #: includes/class-kind-fields.php:190
     753#: includes/class-kind-fields.php:200
    754754msgid "(GMT+03:00) Nairobi"
    755755msgstr ""
    756756
    757 #: includes/class-kind-fields.php:191
     757#: includes/class-kind-fields.php:201
    758758msgid "(GMT+03:00) Syowa"
    759759msgstr ""
    760760
    761 #: includes/class-kind-fields.php:192
     761#: includes/class-kind-fields.php:202
    762762msgid "(GMT+03:00) Baghdad"
    763763msgstr ""
    764764
    765 #: includes/class-kind-fields.php:193
     765#: includes/class-kind-fields.php:203
    766766msgid "(GMT+03:00) Qatar"
    767767msgstr ""
    768768
    769 #: includes/class-kind-fields.php:194
     769#: includes/class-kind-fields.php:204
    770770msgid "(GMT+03:00) Riyadh"
    771771msgstr ""
    772772
    773 #: includes/class-kind-fields.php:195
     773#: includes/class-kind-fields.php:205
    774774msgid "(GMT+03:00) Minsk"
    775775msgstr ""
    776776
    777 #: includes/class-kind-fields.php:196
     777#: includes/class-kind-fields.php:206
    778778msgid "(GMT+03:00) Moscow+00 - Moscow"
    779779msgstr ""
    780780
    781 #: includes/class-kind-fields.php:197
     781#: includes/class-kind-fields.php:207
    782782msgid "(GMT+03:30) Tehran"
    783783msgstr ""
    784784
    785 #: includes/class-kind-fields.php:198
     785#: includes/class-kind-fields.php:208
    786786msgid "(GMT+04:00) Baku"
    787787msgstr ""
    788788
    789 #: includes/class-kind-fields.php:199
     789#: includes/class-kind-fields.php:209
    790790msgid "(GMT+04:00) Dubai"
    791791msgstr ""
    792792
    793 #: includes/class-kind-fields.php:200
     793#: includes/class-kind-fields.php:210
    794794msgid "(GMT+04:00) Tbilisi"
    795795msgstr ""
    796796
    797 #: includes/class-kind-fields.php:201
     797#: includes/class-kind-fields.php:211
    798798msgid "(GMT+04:00) Yerevan"
    799799msgstr ""
    800800
    801 #: includes/class-kind-fields.php:202
     801#: includes/class-kind-fields.php:212
    802802msgid "(GMT+04:00) Moscow+01 - Samara"
    803803msgstr ""
    804804
    805 #: includes/class-kind-fields.php:203
     805#: includes/class-kind-fields.php:213
    806806msgid "(GMT+04:00) Mahe"
    807807msgstr ""
    808808
    809 #: includes/class-kind-fields.php:204
     809#: includes/class-kind-fields.php:214
    810810msgid "(GMT+04:00) Mauritius"
    811811msgstr ""
    812812
    813 #: includes/class-kind-fields.php:205
     813#: includes/class-kind-fields.php:215
    814814msgid "(GMT+04:00) Reunion"
    815815msgstr ""
    816816
    817 #: includes/class-kind-fields.php:206
     817#: includes/class-kind-fields.php:216
    818818msgid "(GMT+04:30) Kabul"
    819819msgstr ""
    820820
    821 #: includes/class-kind-fields.php:207
     821#: includes/class-kind-fields.php:217
    822822msgid "(GMT+05:00) Mawson"
    823823msgstr ""
    824824
    825 #: includes/class-kind-fields.php:208
     825#: includes/class-kind-fields.php:218
    826826msgid "(GMT+05:00) Aqtau"
    827827msgstr ""
    828828
    829 #: includes/class-kind-fields.php:209
     829#: includes/class-kind-fields.php:219
    830830msgid "(GMT+05:00) Aqtobe"
    831831msgstr ""
    832832
    833 #: includes/class-kind-fields.php:210
     833#: includes/class-kind-fields.php:220
    834834msgid "(GMT+05:00) Ashgabat"
    835835msgstr ""
    836836
    837 #: includes/class-kind-fields.php:211
     837#: includes/class-kind-fields.php:221
    838838msgid "(GMT+05:00) Dushanbe"
    839839msgstr ""
    840840
    841 #: includes/class-kind-fields.php:212
     841#: includes/class-kind-fields.php:222
    842842msgid "(GMT+05:00) Karachi"
    843843msgstr ""
    844844
    845 #: includes/class-kind-fields.php:213
     845#: includes/class-kind-fields.php:223
    846846msgid "(GMT+05:00) Tashkent"
    847847msgstr ""
    848848
    849 #: includes/class-kind-fields.php:214
     849#: includes/class-kind-fields.php:224
    850850msgid "(GMT+05:00) Moscow+02 - Yekaterinburg"
    851851msgstr ""
    852852
    853 #: includes/class-kind-fields.php:215
     853#: includes/class-kind-fields.php:225
    854854msgid "(GMT+05:00) Kerguelen"
    855855msgstr ""
    856856
    857 #: includes/class-kind-fields.php:216
     857#: includes/class-kind-fields.php:226
    858858msgid "(GMT+05:00) Maldives"
    859859msgstr ""
    860860
    861 #: includes/class-kind-fields.php:217
     861#: includes/class-kind-fields.php:227
    862862msgid "(GMT+05:30) India Standard Time"
    863863msgstr ""
    864864
    865 #: includes/class-kind-fields.php:218
     865#: includes/class-kind-fields.php:228
    866866msgid "(GMT+05:30) Colombo"
    867867msgstr ""
    868868
    869 #: includes/class-kind-fields.php:219
    870 msgid "(GMT+05:45) Katmandu"
    871 msgstr ""
    872 
    873 #: includes/class-kind-fields.php:220
     869#: includes/class-kind-fields.php:229
     870msgid "(GMT+05:45) Kathmandu"
     871msgstr ""
     872
     873#: includes/class-kind-fields.php:230
    874874msgid "(GMT+06:00) Vostok"
    875875msgstr ""
    876876
    877 #: includes/class-kind-fields.php:221
     877#: includes/class-kind-fields.php:231
    878878msgid "(GMT+06:00) Almaty"
    879879msgstr ""
    880880
    881 #: includes/class-kind-fields.php:222
     881#: includes/class-kind-fields.php:232
    882882msgid "(GMT+06:00) Bishkek"
    883883msgstr ""
    884884
    885 #: includes/class-kind-fields.php:223
     885#: includes/class-kind-fields.php:233
    886886msgid "(GMT+06:00) Dhaka"
    887887msgstr ""
    888888
    889 #: includes/class-kind-fields.php:224
     889#: includes/class-kind-fields.php:234
    890890msgid "(GMT+06:00) Moscow+03 - Omsk, Novosibirsk"
    891891msgstr ""
    892892
    893 #: includes/class-kind-fields.php:225
     893#: includes/class-kind-fields.php:235
    894894msgid "(GMT+06:00) Thimphu"
    895895msgstr ""
    896896
    897 #: includes/class-kind-fields.php:226
     897#: includes/class-kind-fields.php:236
    898898msgid "(GMT+06:00) Chagos"
    899899msgstr ""
    900900
    901 #: includes/class-kind-fields.php:227
    902 msgid "(GMT+06:30) Rangoon"
    903 msgstr ""
    904 
    905 #: includes/class-kind-fields.php:228
     901#: includes/class-kind-fields.php:237
     902msgid "(GMT+06:30) Yangon"
     903msgstr ""
     904
     905#: includes/class-kind-fields.php:238
    906906msgid "(GMT+06:30) Cocos"
    907907msgstr ""
    908908
    909 #: includes/class-kind-fields.php:229
     909#: includes/class-kind-fields.php:239
    910910msgid "(GMT+07:00) Davis"
    911911msgstr ""
    912912
    913 #: includes/class-kind-fields.php:230
     913#: includes/class-kind-fields.php:240
    914914msgid "(GMT+07:00) Bangkok"
    915915msgstr ""
    916916
    917 #: includes/class-kind-fields.php:231
     917#: includes/class-kind-fields.php:241
    918918msgid "(GMT+07:00) Hovd"
    919919msgstr ""
    920920
    921 #: includes/class-kind-fields.php:232
     921#: includes/class-kind-fields.php:242
    922922msgid "(GMT+07:00) Jakarta"
    923923msgstr ""
    924924
    925 #: includes/class-kind-fields.php:233
     925#: includes/class-kind-fields.php:243
    926926msgid "(GMT+07:00) Moscow+04 - Krasnoyarsk"
    927927msgstr ""
    928928
    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
    934930msgid "(GMT+07:00) Ho Chi Minh"
    935931msgstr ""
    936932
    937 #: includes/class-kind-fields.php:236
     933#: includes/class-kind-fields.php:245
    938934msgid "(GMT+07:00) Christmas"
    939935msgstr ""
    940936
    941 #: includes/class-kind-fields.php:237
     937#: includes/class-kind-fields.php:246
    942938msgid "(GMT+08:00) Casey"
    943939msgstr ""
    944940
    945 #: includes/class-kind-fields.php:238
     941#: includes/class-kind-fields.php:247
    946942msgid "(GMT+08:00) Brunei"
    947943msgstr ""
    948944
    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
    954946msgid "(GMT+08:00) Hong Kong"
    955947msgstr ""
    956948
    957 #: includes/class-kind-fields.php:241
     949#: includes/class-kind-fields.php:249
    958950msgid "(GMT+08:00) Moscow+05 - Irkutsk"
    959951msgstr ""
    960952
    961 #: includes/class-kind-fields.php:242
     953#: includes/class-kind-fields.php:250
    962954msgid "(GMT+08:00) Kuala Lumpur"
    963955msgstr ""
    964956
    965 #: includes/class-kind-fields.php:243
     957#: includes/class-kind-fields.php:251
    966958msgid "(GMT+08:00) Macau"
    967959msgstr ""
    968960
    969 #: includes/class-kind-fields.php:244
     961#: includes/class-kind-fields.php:252
    970962msgid "(GMT+08:00) Makassar"
    971963msgstr ""
    972964
    973 #: includes/class-kind-fields.php:245
     965#: includes/class-kind-fields.php:253
    974966msgid "(GMT+08:00) Manila"
    975967msgstr ""
    976968
    977 #: includes/class-kind-fields.php:246
     969#: includes/class-kind-fields.php:254
    978970msgid "(GMT+08:00) China Time - Beijing"
    979971msgstr ""
    980972
    981 #: includes/class-kind-fields.php:247
     973#: includes/class-kind-fields.php:255
    982974msgid "(GMT+08:00) Singapore"
    983975msgstr ""
    984976
    985 #: includes/class-kind-fields.php:248
     977#: includes/class-kind-fields.php:256
    986978msgid "(GMT+08:00) Taipei"
    987979msgstr ""
    988980
    989 #: includes/class-kind-fields.php:249
     981#: includes/class-kind-fields.php:257
    990982msgid "(GMT+08:00) Ulaanbaatar"
    991983msgstr ""
    992984
    993 #: includes/class-kind-fields.php:250
     985#: includes/class-kind-fields.php:258
    994986msgid "(GMT+08:00) Western Time - Perth"
    995987msgstr ""
    996988
    997 #: includes/class-kind-fields.php:251
     989#: includes/class-kind-fields.php:259
    998990msgid "(GMT+08:30) Pyongyang"
    999991msgstr ""
    1000992
    1001 #: includes/class-kind-fields.php:252
     993#: includes/class-kind-fields.php:260
    1002994msgid "(GMT+09:00) Dili"
    1003995msgstr ""
    1004996
    1005 #: includes/class-kind-fields.php:253
     997#: includes/class-kind-fields.php:261
    1006998msgid "(GMT+09:00) Jayapura"
    1007999msgstr ""
    10081000
    1009 #: includes/class-kind-fields.php:254
     1001#: includes/class-kind-fields.php:262
    10101002msgid "(GMT+09:00) Seoul"
    10111003msgstr ""
    10121004
    1013 #: includes/class-kind-fields.php:255
     1005#: includes/class-kind-fields.php:263
    10141006msgid "(GMT+09:00) Tokyo"
    10151007msgstr ""
    10161008
    1017 #: includes/class-kind-fields.php:256
     1009#: includes/class-kind-fields.php:264
    10181010msgid "(GMT+09:00) Moscow+06 - Yakutsk"
    10191011msgstr ""
    10201012
    1021 #: includes/class-kind-fields.php:257
     1013#: includes/class-kind-fields.php:265
    10221014msgid "(GMT+09:00) Palau"
    10231015msgstr ""
    10241016
    1025 #: includes/class-kind-fields.php:258
     1017#: includes/class-kind-fields.php:266
    10261018msgid "(GMT+10:30) Central Time - Adelaide"
    10271019msgstr ""
    10281020
    1029 #: includes/class-kind-fields.php:259
     1021#: includes/class-kind-fields.php:267
    10301022msgid "(GMT+09:30) Central Time - Darwin"
    10311023msgstr ""
    10321024
    1033 #: includes/class-kind-fields.php:261
     1025#: includes/class-kind-fields.php:269
    10341026msgid "(GMT+10:00) Moscow+07 - Magadan"
    10351027msgstr ""
    10361028
    1037 #: includes/class-kind-fields.php:262
     1029#: includes/class-kind-fields.php:270
    10381030msgid "(GMT+10:00) Moscow+07 - Yuzhno-Sakhalinsk"
    10391031msgstr ""
    10401032
    1041 #: includes/class-kind-fields.php:263
     1033#: includes/class-kind-fields.php:271
    10421034msgid "(GMT+10:00) Eastern Time - Brisbane"
    10431035msgstr ""
    10441036
    1045 #: includes/class-kind-fields.php:264
     1037#: includes/class-kind-fields.php:272
    10461038msgid "(GMT+11:00) Eastern Time - Hobart"
    10471039msgstr ""
    10481040
    1049 #: includes/class-kind-fields.php:265
     1041#: includes/class-kind-fields.php:273
    10501042msgid "(GMT+11:00) Eastern Time - Melbourne, Sydney"
    10511043msgstr ""
    10521044
    1053 #: includes/class-kind-fields.php:266
     1045#: includes/class-kind-fields.php:274
    10541046msgid "(GMT+10:00) Truk"
    10551047msgstr ""
    10561048
    1057 #: includes/class-kind-fields.php:267
     1049#: includes/class-kind-fields.php:275
    10581050msgid "(GMT+10:00) Guam"
    10591051msgstr ""
    10601052
    1061 #: includes/class-kind-fields.php:268
     1053#: includes/class-kind-fields.php:276
    10621054msgid "(GMT+10:00) Port Moresby"
    10631055msgstr ""
    10641056
    1065 #: includes/class-kind-fields.php:269
     1057#: includes/class-kind-fields.php:277
    10661058msgid "(GMT+11:00) Efate"
    10671059msgstr ""
    10681060
    1069 #: includes/class-kind-fields.php:270
     1061#: includes/class-kind-fields.php:278
    10701062msgid "(GMT+11:00) Guadalcanal"
    10711063msgstr ""
    10721064
    1073 #: includes/class-kind-fields.php:271
     1065#: includes/class-kind-fields.php:279
    10741066msgid "(GMT+11:00) Kosrae"
    10751067msgstr ""
    10761068
    1077 #: includes/class-kind-fields.php:272
     1069#: includes/class-kind-fields.php:280
    10781070msgid "(GMT+11:00) Norfolk"
    10791071msgstr ""
    10801072
    1081 #: includes/class-kind-fields.php:273
     1073#: includes/class-kind-fields.php:281
    10821074msgid "(GMT+11:00) Noumea"
    10831075msgstr ""
    10841076
    1085 #: includes/class-kind-fields.php:274
     1077#: includes/class-kind-fields.php:282
    10861078msgid "(GMT+11:00) Ponape"
    10871079msgstr ""
    10881080
    1089 #: includes/class-kind-fields.php:275
     1081#: includes/class-kind-fields.php:283
    10901082msgid "(GMT+12:00) Moscow+09 - Petropavlovsk-Kamchatskiy"
    10911083msgstr ""
    10921084
    1093 #: includes/class-kind-fields.php:276
     1085#: includes/class-kind-fields.php:284
    10941086msgid "(GMT+13:00) Auckland"
    10951087msgstr ""
    10961088
    1097 #: includes/class-kind-fields.php:277
     1089#: includes/class-kind-fields.php:285
    10981090msgid "(GMT+13:00) Fiji"
    10991091msgstr ""
    11001092
    1101 #: includes/class-kind-fields.php:278
     1093#: includes/class-kind-fields.php:286
    11021094msgid "(GMT+12:00) Funafuti"
    11031095msgstr ""
    11041096
    1105 #: includes/class-kind-fields.php:279
     1097#: includes/class-kind-fields.php:287
    11061098msgid "(GMT+12:00) Kwajalein"
    11071099msgstr ""
    11081100
    1109 #: includes/class-kind-fields.php:280
     1101#: includes/class-kind-fields.php:288
    11101102msgid "(GMT+12:00) Majuro"
    11111103msgstr ""
    11121104
    1113 #: includes/class-kind-fields.php:281
     1105#: includes/class-kind-fields.php:289
    11141106msgid "(GMT+12:00) Nauru"
    11151107msgstr ""
    11161108
    1117 #: includes/class-kind-fields.php:282
     1109#: includes/class-kind-fields.php:290
    11181110msgid "(GMT+12:00) Tarawa"
    11191111msgstr ""
    11201112
    1121 #: includes/class-kind-fields.php:283
     1113#: includes/class-kind-fields.php:291
    11221114msgid "(GMT+12:00) Wake"
    11231115msgstr ""
    11241116
    1125 #: includes/class-kind-fields.php:284
     1117#: includes/class-kind-fields.php:292
    11261118msgid "(GMT+12:00) Wallis"
    11271119msgstr ""
    11281120
    1129 #: includes/class-kind-fields.php:285
     1121#: includes/class-kind-fields.php:293
    11301122msgid "(GMT+14:00) Apia"
    11311123msgstr ""
    11321124
    1133 #: includes/class-kind-fields.php:286
    1134 msgid "(GMT+13:00) Enderbury"
    1135 msgstr ""
    1136 
    1137 #: includes/class-kind-fields.php:287
     1125#: includes/class-kind-fields.php:294
     1126msgid "(GMT+13:00) Kanton"
     1127msgstr ""
     1128
     1129#: includes/class-kind-fields.php:295
    11381130msgid "(GMT+13:00) Fakaofo"
    11391131msgstr ""
    11401132
    1141 #: includes/class-kind-fields.php:288
     1133#: includes/class-kind-fields.php:296
    11421134msgid "(GMT+13:00) Tongatapu"
    11431135msgstr ""
    11441136
    1145 #: includes/class-kind-fields.php:289
     1137#: includes/class-kind-fields.php:297
    11461138msgid "(GMT+14:00) Kiritimati"
    11471139msgstr ""
    11481140
    1149 #: includes/class-kind-fields.php:396
     1141#: includes/class-kind-fields.php:427
     1142#: templates/reply-time.php:21
     1143msgid "Years"
     1144msgstr ""
     1145
     1146#: includes/class-kind-fields.php:428
     1147#: templates/reply-time.php:25
     1148msgid "Months"
     1149msgstr ""
     1150
     1151#: includes/class-kind-fields.php:429
     1152#: templates/reply-time.php:29
     1153msgid "Days"
     1154msgstr ""
     1155
     1156#: includes/class-kind-fields.php:430
     1157#: templates/reply-time.php:35
     1158msgid "Hours"
     1159msgstr ""
     1160
     1161#: includes/class-kind-fields.php:431
     1162#: templates/reply-time.php:39
     1163msgid "Minutes"
     1164msgstr ""
     1165
     1166#: includes/class-kind-fields.php:432
     1167#: templates/reply-time.php:43
     1168msgid "Seconds"
     1169msgstr ""
     1170
     1171#: includes/class-kind-fields.php:463
    11501172msgid "Author Name"
    11511173msgstr ""
    11521174
    1153 #: includes/class-kind-fields.php:400
     1175#: includes/class-kind-fields.php:467
    11541176#: templates/reply-author.php:26
    11551177msgid "Author URL"
    11561178msgstr ""
    11571179
    1158 #: includes/class-kind-fields.php:404
     1180#: includes/class-kind-fields.php:471
    11591181msgid "Author Photo"
    11601182msgstr ""
    11611183
     1184#: includes/class-kind-fields.php:493
     1185#: templates/reply-metabox.php:56
     1186msgid "Name"
     1187msgstr ""
     1188
     1189#: includes/class-kind-fields.php:497
     1190#: templates/reply-metabox.php:50
     1191msgid "URL"
     1192msgstr ""
     1193
     1194#: includes/class-kind-fields.php:501
     1195#: templates/reply-author.php:20
     1196#: templates/reply-metabox.php:45
     1197msgid "Author"
     1198msgstr ""
     1199
     1200#: includes/class-kind-fields.php:505
     1201msgid "Summary"
     1202msgstr ""
     1203
     1204#: includes/class-kind-fields.php:509
     1205msgid "Publication/Website"
     1206msgstr ""
     1207
     1208#: includes/class-kind-fields.php:513
     1209msgid "Publish Date"
     1210msgstr ""
     1211
     1212#: includes/class-kind-fields.php:517
     1213msgid "Updated Time"
     1214msgstr ""
     1215
     1216#: includes/class-kind-fields.php:521
     1217#: includes/register-kinds.php:187
     1218msgid "Tags"
     1219msgstr ""
     1220
     1221#: includes/class-kind-fields.php:525
     1222msgid "Featured Media"
     1223msgstr ""
     1224
     1225#: includes/class-kind-fields.php:567
     1226msgid "Title"
     1227msgstr ""
     1228
     1229#: includes/class-kind-fields.php:581
     1230#: includes/class-kind-metabox.php:422
     1231msgid "Rating"
     1232msgstr ""
     1233
     1234#: includes/class-kind-fields.php:583
     1235#: includes/class-kind-metabox.php:346
     1236msgid "Very Dissatisfied"
     1237msgstr ""
     1238
     1239#: includes/class-kind-fields.php:584
     1240#: includes/class-kind-metabox.php:347
     1241msgid "Dissatisfied"
     1242msgstr ""
     1243
     1244#: includes/class-kind-fields.php:585
     1245#: includes/class-kind-metabox.php:348
     1246msgid "Neutral"
     1247msgstr ""
     1248
     1249#: includes/class-kind-fields.php:586
     1250#: includes/class-kind-metabox.php:349
     1251msgid "Satisfied"
     1252msgstr ""
     1253
     1254#: includes/class-kind-fields.php:587
     1255#: includes/class-kind-metabox.php:350
     1256msgid "Very Satisfied"
     1257msgstr ""
     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
     1263msgid "RSVP"
     1264msgstr ""
     1265
     1266#: includes/class-kind-fields.php:606
     1267#: includes/class-kind-metabox.php:376
     1268msgid "Yes"
     1269msgstr ""
     1270
     1271#: includes/class-kind-fields.php:607
     1272#: includes/class-kind-metabox.php:377
     1273msgid "No"
     1274msgstr ""
     1275
     1276#: includes/class-kind-fields.php:608
     1277#: includes/class-kind-metabox.php:378
     1278msgid "Maybe"
     1279msgstr ""
     1280
     1281#: includes/class-kind-fields.php:609
     1282#: includes/class-kind-metabox.php:379
     1283msgid "Interested"
     1284msgstr ""
     1285
     1286#: includes/class-kind-fields.php:610
     1287#: includes/class-kind-metabox.php:380
     1288msgid "Remote"
     1289msgstr ""
     1290
     1291#: includes/class-kind-fields.php:625
     1292msgid "Read Status"
     1293msgstr ""
     1294
     1295#: includes/class-kind-fields.php:627
     1296msgid "Want to Read"
     1297msgstr ""
     1298
     1299#: includes/class-kind-fields.php:628
     1300msgid "Reading"
     1301msgstr ""
     1302
     1303#: includes/class-kind-fields.php:629
     1304msgid "Finished Reading"
     1305msgstr ""
     1306
     1307#: includes/class-kind-fields.php:645
     1308#: includes/register-kinds.php:215
     1309msgid "Start Date"
     1310msgstr ""
     1311
     1312#: includes/class-kind-fields.php:649
     1313#: includes/register-kinds.php:219
     1314msgid "End Date"
     1315msgstr ""
     1316
     1317#: includes/class-kind-fields.php:653
     1318#: templates/reply-time.php:18
     1319msgid "Duration"
     1320msgstr ""
     1321
    11621322#: 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
    11651326msgid "Artist"
    11661327msgstr ""
    … …  
    12331394msgstr ""
    12341395
    1235 #: includes/class-kind-metabox.php:346
    1236 msgid "Very Dissatisfied"
    1237 msgstr ""
    1238 
    1239 #: includes/class-kind-metabox.php:347
    1240 msgid "Dissatisfied"
    1241 msgstr ""
    1242 
    1243 #: includes/class-kind-metabox.php:348
    1244 msgid "Neutral"
    1245 msgstr ""
    1246 
    1247 #: includes/class-kind-metabox.php:349
    1248 msgid "Satisfied"
    1249 msgstr ""
    1250 
    1251 #: includes/class-kind-metabox.php:350
    1252 msgid "Very Satisfied"
    1253 msgstr ""
    1254 
    1255 #: includes/class-kind-metabox.php:376
    1256 #: includes/register-kinds.php:468
    1257 msgid "Yes"
    1258 msgstr ""
    1259 
    1260 #: includes/class-kind-metabox.php:377
    1261 #: includes/register-kinds.php:469
    1262 msgid "No"
    1263 msgstr ""
    1264 
    1265 #: includes/class-kind-metabox.php:378
    1266 #: includes/register-kinds.php:470
    1267 msgid "Maybe"
    1268 msgstr ""
    1269 
    1270 #: includes/class-kind-metabox.php:379
    1271 #: includes/register-kinds.php:471
    1272 msgid "Interested"
    1273 msgstr ""
    1274 
    1275 #: includes/class-kind-metabox.php:380
    1276 #: includes/register-kinds.php:472
    1277 msgid "Remote"
    1278 msgstr ""
    1279 
    1280 #: includes/class-kind-metabox.php:404
    1281 #: includes/register-kinds.php:460
    1282 #: views/kind.php:81
    1283 msgid "RSVP"
    1284 msgstr ""
    1285 
    1286 #: includes/class-kind-metabox.php:422
    1287 msgid "Rating"
    1288 msgstr ""
    1289 
    12901396#: includes/class-kind-metabox.php:461
    12911397msgid "Response Properties"
    … …  
    13211427msgstr ""
    13221428
    1323 #: includes/class-kind-taxonomy.php:609
     1429#: includes/class-kind-taxonomy.php:621
    13241430msgid "Post Kinds replaces the IndieWeb Taxonomy plugin. Deactivate IndieWeb Taxonomy, then activate Post Kinds."
    13251431msgstr ""
    13261432
    1327 #: includes/class-kind-taxonomy.php:697
     1433#: includes/class-kind-taxonomy.php:709
    13281434msgctxt "taxonomy general name"
    13291435msgid "Kinds"
    13301436msgstr ""
    13311437
    1332 #: includes/class-kind-taxonomy.php:698
     1438#: includes/class-kind-taxonomy.php:710
    13331439msgctxt "taxonomy singular name"
    13341440msgid "Kind"
    13351441msgstr ""
    13361442
    1337 #: includes/class-kind-taxonomy.php:699
     1443#: includes/class-kind-taxonomy.php:711
    13381444msgctxt "search locations"
    13391445msgid "Search Kinds"
    13401446msgstr ""
    13411447
    1342 #: includes/class-kind-taxonomy.php:700
     1448#: includes/class-kind-taxonomy.php:712
    13431449msgctxt "popular kinds"
    13441450msgid "Popular Kinds"
    13451451msgstr ""
    13461452
    1347 #: includes/class-kind-taxonomy.php:701
     1453#: includes/class-kind-taxonomy.php:713
    13481454msgctxt "all taxonomy items"
    13491455msgid "All Kinds"
    13501456msgstr ""
    13511457
    1352 #: includes/class-kind-taxonomy.php:702
     1458#: includes/class-kind-taxonomy.php:714
    13531459msgctxt "taxonomy parent item"
    13541460msgid "Parent Kind"
    13551461msgstr ""
    13561462
    1357 #: includes/class-kind-taxonomy.php:703
     1463#: includes/class-kind-taxonomy.php:715
    13581464msgctxt "taxonomy parent item with colon"
    13591465msgid "Parent Kind:"
    13601466msgstr ""
    13611467
    1362 #: includes/class-kind-taxonomy.php:704
     1468#: includes/class-kind-taxonomy.php:716
    13631469msgid "This will appear on archives as the description if your theme supports"
    13641470msgstr ""
    13651471
    1366 #: includes/class-kind-taxonomy.php:705
     1472#: includes/class-kind-taxonomy.php:717
    13671473msgctxt "edit taxonomy item"
    13681474msgid "Edit Kind"
    13691475msgstr ""
    13701476
    1371 #: includes/class-kind-taxonomy.php:706
     1477#: includes/class-kind-taxonomy.php:718
    13721478msgctxt "view taxonomy item"
    13731479msgid "View Kind"
    13741480msgstr ""
    13751481
    1376 #: includes/class-kind-taxonomy.php:707
     1482#: includes/class-kind-taxonomy.php:719
    13771483msgctxt "update taxonomy item"
    13781484msgid "Update Kind"
    13791485msgstr ""
    13801486
    1381 #: includes/class-kind-taxonomy.php:708
     1487#: includes/class-kind-taxonomy.php:720
    13821488msgctxt "add taxonomy item"
    13831489msgid "Add New Kind"
    13841490msgstr ""
    13851491
    1386 #: includes/class-kind-taxonomy.php:709
     1492#: includes/class-kind-taxonomy.php:721
    13871493msgctxt "new taxonomy item"
    13881494msgid "New Kind"
    13891495msgstr ""
    13901496
    1391 #: includes/class-kind-taxonomy.php:710
     1497#: includes/class-kind-taxonomy.php:722
    13921498msgctxt "separate kinds with commas"
    13931499msgid "Separate kinds with commas"
    13941500msgstr ""
    13951501
    1396 #: includes/class-kind-taxonomy.php:711
     1502#: includes/class-kind-taxonomy.php:723
    13971503msgctxt "add or remove items"
    13981504msgid "Add or remove kinds"
    13991505msgstr ""
    14001506
    1401 #: includes/class-kind-taxonomy.php:712
     1507#: includes/class-kind-taxonomy.php:724
    14021508msgctxt "choose most used"
    14031509msgid "Choose from the most used kinds"
    14041510msgstr ""
    14051511
    1406 #: includes/class-kind-taxonomy.php:713
     1512#: includes/class-kind-taxonomy.php:725
    14071513msgctxt "no kinds found"
    14081514msgid "No kinds found"
    14091515msgstr ""
    14101516
    1411 #: includes/class-kind-taxonomy.php:714
     1517#: includes/class-kind-taxonomy.php:726
    14121518msgctxt "no kinds"
    14131519msgid "No kinds"
    14141520msgstr ""
    14151521
    1416 #: includes/class-kind-taxonomy.php:715
     1522#: includes/class-kind-taxonomy.php:727
    14171523msgid "Back to Kinds"
    14181524msgstr ""
    14191525
    1420 #: includes/class-kind-taxonomy.php:716
     1526#: includes/class-kind-taxonomy.php:728
    14211527msgid "Kind Link"
    14221528msgstr ""
    14231529
    1424 #: includes/class-kind-taxonomy.php:717
     1530#: includes/class-kind-taxonomy.php:729
    14251531msgid "A link to a kind"
    14261532msgstr ""
    … …  
    14291535#. translators: 1: Taxonomy. 2: Month name and year
    14301536#. translators: 1. Taxonomy . 1: Date
    1431 #: includes/class-kind-taxonomy.php:1114
    1432 #: includes/class-kind-taxonomy.php:1117
    1433 #: includes/class-kind-taxonomy.php:1120
     1537#: includes/class-kind-taxonomy.php:1138
     1538#: includes/class-kind-taxonomy.php:1141
     1539#: includes/class-kind-taxonomy.php:1144
    14341540#, php-format
    14351541msgid "%1$1s - %2$2s"
    … …  
    14371543
    14381544#. translators: 1: Taxonomy. Yearly archive title. 2: Year
    1439 #: includes/class-kind-taxonomy.php:1114
     1545#: includes/class-kind-taxonomy.php:1138
    14401546msgctxt "yearly archives date format"
    14411547msgid "Y"
    … …  
    14431549
    14441550#. translators: 1: Taxonomy. 2: Month name and year
    1445 #: includes/class-kind-taxonomy.php:1117
     1551#: includes/class-kind-taxonomy.php:1141
    14461552msgctxt "monthly archives date format"
    14471553msgid "F Y"
    … …  
    14491555
    14501556#. translators: 1. Taxonomy . 1: Date
    1451 #: includes/class-kind-taxonomy.php:1120
     1557#: includes/class-kind-taxonomy.php:1144
    14521558msgctxt "daily archives date format"
    14531559msgid "F j, Y"
    … …  
    14551561
    14561562#. translators: 1. Title 2. Translated term for Firehose Feed
    1457 #: includes/class-kind-taxonomy.php:1124
     1563#: includes/class-kind-taxonomy.php:1148
    14581564#, php-format
    14591565msgid "%1$s - %2$2s"
    … …  
    14611567
    14621568#. translators: 1. Title 2. Translated term for Firehose Feed
    1463 #: includes/class-kind-taxonomy.php:1124
     1569#: includes/class-kind-taxonomy.php:1148
    14641570msgid "Firehose"
    14651571msgstr ""
    14661572
    14671573#. translators: 1: Title prefix. 2: Title.
    1468 #: includes/class-kind-taxonomy.php:1130
     1574#: includes/class-kind-taxonomy.php:1154
    14691575#, php-format
    14701576msgctxt "archive title"
    … …  
    14731579
    14741580#. translators: All
    1475 #: includes/class-kind-taxonomy.php:1455
     1581#: includes/class-kind-taxonomy.php:1481
    14761582#, php-format
    14771583msgid "All %1s"
    14781584msgstr ""
    14791585
    1480 #: includes/class-kind-taxonomy.php:1647
     1586#: includes/class-kind-taxonomy.php:1673
    14811587msgid "Invalid post"
    14821588msgstr ""
    14831589
    1484 #: includes/class-kind-taxonomy.php:1650
     1590#: includes/class-kind-taxonomy.php:1676
    14851591msgid "Invalid Kind"
    14861592msgstr ""
    14871593
    1488 #: includes/class-kind-taxonomy.php:1670
     1594#: includes/class-kind-taxonomy.php:1696
    14891595msgid "Invalid post."
    14901596msgstr ""
    14911597
    1492 #: includes/class-kind-taxonomy.php:1673
     1598#: includes/class-kind-taxonomy.php:1699
    14931599msgid "Sorry, you are not allowed to set the kind of this post."
    14941600msgstr ""
    … …  
    16131719msgstr[1] ""
    16141720
     1721#: includes/class-post-kind.php:181
     1722msgid "The title argument is deprecated. A kind has a title when its properties include a name field, such as Kind_Fields::title_field()."
     1723msgstr ""
     1724
    16151725#: includes/register-kinds.php:17
    16161726msgid "Article"
    … …  
    16211731msgstr ""
    16221732
    1623 #: includes/register-kinds.php:23
     1733#: includes/register-kinds.php:25
    16241734msgid "traditional long form content: a post with an explicit title and body"
    16251735msgstr ""
    16261736
    1627 #: includes/register-kinds.php:34
     1737#: includes/register-kinds.php:35
    16281738msgid "Note"
    16291739msgstr ""
    16301740
    1631 #: includes/register-kinds.php:35
     1741#: includes/register-kinds.php:36
    16321742msgid "Notes"
    16331743msgstr ""
    16341744
    1635 #: includes/register-kinds.php:40
     1745#: includes/register-kinds.php:41
    16361746msgid "short content: a post or status update with just plain content and typically without a title"
    16371747msgstr ""
    … …  
    16491759msgstr ""
    16501760
    1651 #: includes/register-kinds.php:58
     1761#: includes/register-kinds.php:56
     1762#: includes/register-kinds.php:591
    16521763msgid "In Reply To"
    16531764msgstr ""
    16541765
    1655 #: includes/register-kinds.php:62
     1766#: includes/register-kinds.php:59
     1767msgid "a reply to content typically on another site"
     1768msgstr ""
     1769
     1770#: includes/register-kinds.php:69
     1771#: includes/register-kinds.php:74
     1772msgid "Repost"
     1773msgstr ""
     1774
     1775#: includes/register-kinds.php:70
     1776msgid "Reposts"
     1777msgstr ""
     1778
     1779#: includes/register-kinds.php:71
     1780msgid "Reposted"
     1781msgstr ""
     1782
     1783#: includes/register-kinds.php:77
     1784msgid "a complete reposting of content from another site"
     1785msgstr ""
     1786
     1787#: includes/register-kinds.php:87
     1788#: includes/register-kinds.php:92
     1789msgid "Like"
     1790msgstr ""
     1791
     1792#: includes/register-kinds.php:88
     1793msgid "Likes"
     1794msgstr ""
     1795
     1796#: includes/register-kinds.php:89
     1797msgid "Liked"
     1798msgstr ""
     1799
     1800#: includes/register-kinds.php:95
     1801msgid "a way to pay compliments to the original post/poster of external content"
     1802msgstr ""
     1803
     1804#: includes/register-kinds.php:105
     1805msgid "Favorite"
     1806msgstr ""
     1807
     1808#: includes/register-kinds.php:106
     1809msgid "Favorites"
     1810msgstr ""
     1811
     1812#: includes/register-kinds.php:107
     1813#: includes/register-kinds.php:110
     1814msgid "Favorited"
     1815msgstr ""
     1816
     1817#: includes/register-kinds.php:113
     1818msgid "special to the author"
     1819msgstr ""
     1820
     1821#: includes/register-kinds.php:123
     1822#: includes/register-kinds.php:128
     1823msgid "Bookmark"
     1824msgstr ""
     1825
     1826#: includes/register-kinds.php:124
     1827msgid "Bookmarks"
     1828msgstr ""
     1829
     1830#: includes/register-kinds.php:125
     1831msgid "Bookmarked"
     1832msgstr ""
     1833
    16561834#: includes/register-kinds.php:131
    1657 #: includes/register-kinds.php:200
    1658 #: includes/register-kinds.php:269
     1835msgid "storing a link/bookmark for personal use or sharing with others"
     1836msgstr ""
     1837
     1838#: includes/register-kinds.php:141
     1839msgid "Photo"
     1840msgstr ""
     1841
     1842#: includes/register-kinds.php:142
     1843msgid "Photos"
     1844msgstr ""
     1845
     1846#: includes/register-kinds.php:146
     1847msgid "a post with an embedded image/photo as its primary focus"
     1848msgstr ""
     1849
     1850#: includes/register-kinds.php:156
     1851msgid "Video"
     1852msgstr ""
     1853
     1854#: includes/register-kinds.php:157
     1855msgid "Videos"
     1856msgstr ""
     1857
     1858#: includes/register-kinds.php:161
     1859msgid "a post with an embedded video as its primary focus"
     1860msgstr ""
     1861
     1862#: includes/register-kinds.php:171
     1863msgid "Audio"
     1864msgstr ""
     1865
     1866#: includes/register-kinds.php:172
     1867msgid "Audios"
     1868msgstr ""
     1869
     1870#: includes/register-kinds.php:176
     1871msgid "a post with an embedded audio file as its primary focus"
     1872msgstr ""
     1873
     1874#: includes/register-kinds.php:186
     1875msgid "Tag"
     1876msgstr ""
     1877
     1878#: includes/register-kinds.php:188
     1879msgid "Tagged"
     1880msgstr ""
     1881
     1882#: includes/register-kinds.php:191
     1883msgid "allows you to tag a post as being of a specific category or tag, or for person tagging"
     1884msgstr ""
     1885
     1886#: includes/register-kinds.php:202
     1887msgid "RSVPs"
     1888msgstr ""
     1889
     1890#: includes/register-kinds.php:203
     1891msgid "RSVPed"
     1892msgstr ""
     1893
     1894#: includes/register-kinds.php:208
     1895msgid "Event Details"
     1896msgstr ""
     1897
     1898#: includes/register-kinds.php:225
     1899msgid "a specific type of reply regarding attendance of an event"
     1900msgstr ""
     1901
     1902#: includes/register-kinds.php:235
     1903msgid "Listen"
     1904msgstr ""
     1905
     1906#: includes/register-kinds.php:236
     1907msgid "Listens"
     1908msgstr ""
     1909
     1910#: includes/register-kinds.php:237
     1911msgid "Listened"
     1912msgstr ""
     1913
     1914#: includes/register-kinds.php:242
     1915msgid "Listen To"
     1916msgstr ""
     1917
     1918#: includes/register-kinds.php:245
     1919#: includes/register-kinds.php:485
     1920msgid "Album"
     1921msgstr ""
     1922
     1923#: includes/register-kinds.php:246
     1924#: includes/register-kinds.php:277
     1925#: includes/register-kinds.php:486
     1926msgid "Release Date"
     1927msgstr ""
     1928
     1929#: includes/register-kinds.php:248
     1930#: includes/register-kinds.php:488
     1931msgid "Album Art"
     1932msgstr ""
     1933
     1934#: includes/register-kinds.php:256
     1935msgid "listening to audio; sometimes called a scrobble"
     1936msgstr ""
     1937
     1938#: includes/register-kinds.php:266
     1939msgid "Watch"
     1940msgstr ""
     1941
     1942#: includes/register-kinds.php:267
     1943msgid "Watches"
     1944msgstr ""
     1945
     1946#: includes/register-kinds.php:268
     1947msgid "Watched"
     1948msgstr ""
     1949
     1950#: includes/register-kinds.php:273
     1951msgid "Watching To"
     1952msgstr ""
     1953
     1954#: includes/register-kinds.php:276
     1955msgid "Series"
     1956msgstr ""
     1957
     1958#: includes/register-kinds.php:279
     1959msgid "Poster"
     1960msgstr ""
     1961
     1962#: includes/register-kinds.php:287
     1963msgid "watching a movie, television show, online video, play or other visual-based event"
     1964msgstr ""
     1965
     1966#: includes/register-kinds.php:297
     1967msgid "Checkin"
     1968msgstr ""
     1969
     1970#: includes/register-kinds.php:298
     1971msgid "Checkins"
     1972msgstr ""
     1973
     1974#: includes/register-kinds.php:299
     1975msgid "Checked into"
     1976msgstr ""
     1977
     1978#: includes/register-kinds.php:305
     1979msgid "Checked In"
     1980msgstr ""
     1981
     1982#: includes/register-kinds.php:311
     1983msgid "identifying you are at a particular geographic location"
     1984msgstr ""
     1985
     1986#: includes/register-kinds.php:321
     1987msgid "Wish"
     1988msgstr ""
     1989
     1990#: includes/register-kinds.php:322
     1991msgid "Wishes"
     1992msgstr ""
     1993
     1994#: includes/register-kinds.php:323
     1995msgid "Wished"
     1996msgstr ""
     1997
     1998#: includes/register-kinds.php:326
     1999msgid "a post indicating a desire/wish. The archive of which would be a wishlist, such as a gift registry or similar"
     2000msgstr ""
     2001
     2002#: includes/register-kinds.php:336
     2003msgid "Play"
     2004msgstr ""
     2005
     2006#: includes/register-kinds.php:337
     2007msgid "Playing"
     2008msgstr ""
     2009
    16592010#: includes/register-kinds.php:338
    1660 #: includes/register-kinds.php:481
    1661 #: includes/register-kinds.php:543
    1662 #: includes/register-kinds.php:608
    1663 #: includes/register-kinds.php:673
    1664 #: templates/reply-metabox.php:56
    1665 msgid "Name"
    1666 msgstr ""
    1667 
    1668 #: includes/register-kinds.php:66
    1669 #: includes/register-kinds.php:135
    1670 #: includes/register-kinds.php:204
    1671 #: includes/register-kinds.php:273
    16722011#: includes/register-kinds.php:342
    1673 #: includes/register-kinds.php:485
    1674 #: includes/register-kinds.php:547
    1675 #: includes/register-kinds.php:612
     2012msgid "Played"
     2013msgstr ""
     2014
     2015#: includes/register-kinds.php:348
     2016msgid "playing a game"
     2017msgstr ""
     2018
     2019#: includes/register-kinds.php:358
     2020#: includes/register-kinds.php:359
     2021msgid "Weather"
     2022msgstr ""
     2023
     2024#: includes/register-kinds.php:363
     2025msgid "current weather conditions"
     2026msgstr ""
     2027
     2028#: includes/register-kinds.php:373
     2029#: includes/register-kinds.php:374
     2030msgid "Exercise"
     2031msgstr ""
     2032
     2033#: includes/register-kinds.php:375
     2034msgid "Exercised"
     2035msgstr ""
     2036
     2037#: includes/register-kinds.php:378
     2038msgid "some form of physical activity or workout (examples: walk, run, cycle, hike, yoga, etc.)"
     2039msgstr ""
     2040
     2041#: includes/register-kinds.php:388
     2042msgid "Trip"
     2043msgstr ""
     2044
     2045#: includes/register-kinds.php:389
     2046msgid "Trips"
     2047msgstr ""
     2048
     2049#: includes/register-kinds.php:390
     2050#: includes/register-kinds.php:405
     2051msgid "Travelled"
     2052msgstr ""
     2053
     2054#: includes/register-kinds.php:393
     2055msgid "represents a geographic journey"
     2056msgstr ""
     2057
     2058#: includes/register-kinds.php:403
     2059msgid "Itinerary"
     2060msgstr ""
     2061
     2062#: includes/register-kinds.php:404
     2063msgid "Itineraries"
     2064msgstr ""
     2065
     2066#: includes/register-kinds.php:408
     2067msgid "parts of a scheduled trip including transit by car, plane, train, etc."
     2068msgstr ""
     2069
     2070#: includes/register-kinds.php:419
     2071#: includes/register-kinds.php:420
     2072msgid "Eat"
     2073msgstr ""
     2074
     2075#: includes/register-kinds.php:421
     2076#: includes/register-kinds.php:424
     2077msgid "Ate"
     2078msgstr ""
     2079
     2080#: includes/register-kinds.php:428
     2081msgid "what you are eating, perhaps for a food diary"
     2082msgstr ""
     2083
     2084#: includes/register-kinds.php:439
     2085msgid "Drink"
     2086msgstr ""
     2087
     2088#: includes/register-kinds.php:440
     2089msgid "Drinks"
     2090msgstr ""
     2091
     2092#: includes/register-kinds.php:441
     2093#: includes/register-kinds.php:444
     2094msgid "Drank"
     2095msgstr ""
     2096
     2097#: includes/register-kinds.php:448
     2098msgid "what you are drinking, perhaps for a food dairy"
     2099msgstr ""
     2100
     2101#: includes/register-kinds.php:459
     2102msgid "Follow"
     2103msgstr ""
     2104
     2105#: includes/register-kinds.php:460
     2106msgid "Follows"
     2107msgstr ""
     2108
     2109#: includes/register-kinds.php:461
     2110msgid "Followed"
     2111msgstr ""
     2112
     2113#: includes/register-kinds.php:464
     2114msgid "indicating you are now following or subscribing to another person`s activities online"
     2115msgstr ""
     2116
     2117#: includes/register-kinds.php:475
     2118msgid "Jam"
     2119msgstr ""
     2120
     2121#: includes/register-kinds.php:476
     2122msgid "Jams"
     2123msgstr ""
     2124
     2125#: includes/register-kinds.php:477
     2126#: includes/register-kinds.php:482
     2127msgid "Listened to"
     2128msgstr ""
     2129
     2130#: includes/register-kinds.php:496
     2131msgid "a particularly personally meaningful song (a listen with added emphasis)"
     2132msgstr ""
     2133
     2134#: includes/register-kinds.php:507
     2135#: includes/register-kinds.php:509
     2136#: includes/register-kinds.php:513
     2137msgid "Read"
     2138msgstr ""
     2139
     2140#: includes/register-kinds.php:508
     2141msgid "Reads"
     2142msgstr ""
     2143
     2144#: includes/register-kinds.php:520
     2145msgid "reading a book, magazine, newspaper, other physical document, or online post"
     2146msgstr ""
     2147
     2148#: includes/register-kinds.php:531
     2149msgid "Quote"
     2150msgstr ""
     2151
     2152#: includes/register-kinds.php:532
     2153msgid "Quotes"
     2154msgstr ""
     2155
     2156#: includes/register-kinds.php:533
     2157#: includes/register-kinds.php:536
     2158msgid "Quoted"
     2159msgstr ""
     2160
     2161#: includes/register-kinds.php:539
     2162msgid "quoted content"
     2163msgstr ""
     2164
     2165#: includes/register-kinds.php:550
     2166msgid "Mood"
     2167msgstr ""
     2168
     2169#: includes/register-kinds.php:551
     2170msgid "Moods"
     2171msgstr ""
     2172
     2173#: includes/register-kinds.php:552
     2174msgid "Felt"
     2175msgstr ""
     2176
     2177#: includes/register-kinds.php:555
     2178msgid "how you are feeling (example: happy, sad, indifferent, etc.)"
     2179msgstr ""
     2180
     2181#: includes/register-kinds.php:566
     2182msgid "Recipe"
     2183msgstr ""
     2184
     2185#: includes/register-kinds.php:567
     2186msgid "Recipes"
     2187msgstr ""
     2188
     2189#: includes/register-kinds.php:568
     2190msgid "Cooked"
     2191msgstr ""
     2192
     2193#: includes/register-kinds.php:574
     2194msgid "list of ingredients and directions for making food or drink"
     2195msgstr ""
     2196
     2197#: includes/register-kinds.php:585
     2198msgid "Issue"
     2199msgstr ""
     2200
     2201#: includes/register-kinds.php:586
     2202msgid "Issues"
     2203msgstr ""
     2204
     2205#: includes/register-kinds.php:587
     2206msgid "Filed an Issue"
     2207msgstr ""
     2208
     2209#: includes/register-kinds.php:594
     2210msgid "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."
     2211msgstr ""
     2212
     2213#: includes/register-kinds.php:605
     2214msgid "Question"
     2215msgstr ""
     2216
     2217#: includes/register-kinds.php:606
     2218msgid "Questions"
     2219msgstr ""
     2220
     2221#: includes/register-kinds.php:607
     2222msgid "Asked a question"
     2223msgstr ""
     2224
     2225#: includes/register-kinds.php:610
     2226msgid "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."
     2227msgstr ""
     2228
     2229#: includes/register-kinds.php:621
     2230msgid "Sleep"
     2231msgstr ""
     2232
     2233#: includes/register-kinds.php:622
     2234msgid "Sleeps"
     2235msgstr ""
     2236
     2237#: includes/register-kinds.php:623
     2238msgid "Slept"
     2239msgstr ""
     2240
     2241#: includes/register-kinds.php:626
     2242msgid "Sleep is a passive metrics post type that indicates how much time (and often a graph of how deeply) a person has slept."
     2243msgstr ""
     2244
     2245#: includes/register-kinds.php:637
     2246msgid "Event"
     2247msgstr ""
     2248
     2249#: includes/register-kinds.php:638
     2250msgid "Events"
     2251msgstr ""
     2252
     2253#: includes/register-kinds.php:639
     2254msgid "Planned"
     2255msgstr ""
     2256
     2257#: includes/register-kinds.php:645
     2258msgid "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."
     2259msgstr ""
     2260
     2261#: includes/register-kinds.php:655
     2262msgid "Review"
     2263msgstr ""
     2264
     2265#: includes/register-kinds.php:656
     2266msgid "Reviews"
     2267msgstr ""
     2268
     2269#: includes/register-kinds.php:657
     2270#: includes/register-kinds.php:660
     2271msgid "Reviewed"
     2272msgstr ""
     2273
     2274#: includes/register-kinds.php:664
     2275msgid "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."
     2276msgstr ""
     2277
     2278#: includes/register-kinds.php:675
     2279msgid "Acquisition"
     2280msgstr ""
     2281
     2282#: includes/register-kinds.php:676
     2283msgid "Acquisitions"
     2284msgstr ""
     2285
    16762286#: includes/register-kinds.php:677
    1677 #: templates/reply-metabox.php:50
    1678 msgid "URL"
    1679 msgstr ""
    1680 
    1681 #: includes/register-kinds.php:70
    1682 #: includes/register-kinds.php:139
    1683 #: includes/register-kinds.php:208
    1684 #: includes/register-kinds.php:277
    1685 #: includes/register-kinds.php:346
    1686 #: templates/reply-author.php:20
    1687 #: templates/reply-metabox.php:45
    1688 msgid "Author"
    1689 msgstr ""
    1690 
    1691 #: includes/register-kinds.php:77
    1692 #: includes/register-kinds.php:146
    1693 #: includes/register-kinds.php:215
    1694 #: includes/register-kinds.php:284
    1695 #: includes/register-kinds.php:353
    1696 #: includes/register-kinds.php:489
    1697 #: includes/register-kinds.php:558
    1698 #: includes/register-kinds.php:623
    1699 msgid "Summary"
    1700 msgstr ""
    1701 
    1702 #: includes/register-kinds.php:81
    1703 #: includes/register-kinds.php:150
    1704 #: includes/register-kinds.php:219
    1705 #: includes/register-kinds.php:288
    1706 #: includes/register-kinds.php:357
    1707 #: includes/register-kinds.php:493
    1708 msgid "Publication/Website"
    1709 msgstr ""
    1710 
    1711 #: includes/register-kinds.php:85
    1712 #: includes/register-kinds.php:154
    1713 #: includes/register-kinds.php:223
    1714 #: includes/register-kinds.php:292
    1715 #: includes/register-kinds.php:361
    1716 msgid "Publish Date"
    1717 msgstr ""
    1718 
    1719 #: includes/register-kinds.php:89
    1720 #: includes/register-kinds.php:158
    1721 #: includes/register-kinds.php:227
    1722 #: includes/register-kinds.php:296
    1723 #: includes/register-kinds.php:365
    1724 msgid "Updated Time"
    1725 msgstr ""
    1726 
    1727 #: includes/register-kinds.php:93
    1728 #: includes/register-kinds.php:162
    1729 #: includes/register-kinds.php:231
    1730 #: includes/register-kinds.php:300
    1731 #: includes/register-kinds.php:369
    1732 #: includes/register-kinds.php:445
    1733 #: includes/register-kinds.php:505
    1734 #: includes/register-kinds.php:570
    1735 #: includes/register-kinds.php:635
    1736 msgid "Tags"
    1737 msgstr ""
    1738 
    1739 #: includes/register-kinds.php:100
    1740 #: includes/register-kinds.php:169
    1741 #: includes/register-kinds.php:238
    1742 #: includes/register-kinds.php:307
    1743 #: includes/register-kinds.php:376
    1744 #: includes/register-kinds.php:512
    1745 msgid "Featured Media"
    1746 msgstr ""
    1747 
    1748 #: includes/register-kinds.php:109
    1749 msgid "a reply to content typically on another site"
    1750 msgstr ""
    1751 
    1752 #: includes/register-kinds.php:120
    1753 #: includes/register-kinds.php:127
    1754 msgid "Repost"
    1755 msgstr ""
    1756 
    1757 #: includes/register-kinds.php:121
    1758 msgid "Reposts"
    1759 msgstr ""
    1760 
    1761 #: includes/register-kinds.php:122
    1762 msgid "Reposted"
    1763 msgstr ""
    1764 
    1765 #: includes/register-kinds.php:178
    1766 msgid "a complete reposting of content from another site"
    1767 msgstr ""
    1768 
    1769 #: includes/register-kinds.php:189
    1770 #: includes/register-kinds.php:196
    1771 msgid "Like"
    1772 msgstr ""
    1773 
    1774 #: includes/register-kinds.php:190
    1775 msgid "Likes"
    1776 msgstr ""
    1777 
    1778 #: includes/register-kinds.php:191
    1779 msgid "Liked"
    1780 msgstr ""
    1781 
    1782 #: includes/register-kinds.php:247
    1783 msgid "a way to pay compliments to the original post/poster of external content"
    1784 msgstr ""
    1785 
    1786 #: includes/register-kinds.php:258
    1787 msgid "Favorite"
    1788 msgstr ""
    1789 
    1790 #: includes/register-kinds.php:259
    1791 msgid "Favorites"
    1792 msgstr ""
    1793 
    1794 #: includes/register-kinds.php:260
    1795 #: includes/register-kinds.php:265
    1796 msgid "Favorited"
    1797 msgstr ""
    1798 
    1799 #: includes/register-kinds.php:316
    1800 msgid "special to the author"
    1801 msgstr ""
    1802 
    1803 #: includes/register-kinds.php:327
    1804 #: includes/register-kinds.php:334
    1805 msgid "Bookmark"
    1806 msgstr ""
    1807 
    1808 #: includes/register-kinds.php:328
    1809 msgid "Bookmarks"
    1810 msgstr ""
    1811 
    1812 #: includes/register-kinds.php:329
    1813 msgid "Bookmarked"
    1814 msgstr ""
    1815 
    1816 #: includes/register-kinds.php:385
    1817 msgid "storing a link/bookmark for personal use or sharing with others"
    1818 msgstr ""
    1819 
    1820 #: includes/register-kinds.php:396
    1821 msgid "Photo"
    1822 msgstr ""
    1823 
    1824 #: includes/register-kinds.php:397
    1825 msgid "Photos"
    1826 msgstr ""
    1827 
    1828 #: includes/register-kinds.php:401
    1829 msgid "a post with an embedded image/photo as its primary focus"
    1830 msgstr ""
    1831 
    1832 #: includes/register-kinds.php:412
    1833 msgid "Video"
    1834 msgstr ""
    1835 
    1836 #: includes/register-kinds.php:413
    1837 msgid "Videos"
    1838 msgstr ""
    1839 
    1840 #: includes/register-kinds.php:417
    1841 msgid "a post with an embedded video as its primary focus"
    1842 msgstr ""
    1843 
    1844 #: includes/register-kinds.php:428
    1845 msgid "Audio"
    1846 msgstr ""
    1847 
    1848 #: includes/register-kinds.php:429
    1849 msgid "Audios"
    1850 msgstr ""
    1851 
    1852 #: includes/register-kinds.php:433
    1853 msgid "a post with an embedded audio file as its primary focus"
    1854 msgstr ""
    1855 
    1856 #: includes/register-kinds.php:444
    1857 msgid "Tag"
    1858 msgstr ""
    1859 
    1860 #: includes/register-kinds.php:446
    1861 msgid "Tagged"
    1862 msgstr ""
    1863 
    1864 #: includes/register-kinds.php:449
    1865 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:461
    1869 msgid "RSVPs"
    1870 msgstr ""
    1871 
    1872 #: includes/register-kinds.php:462
    1873 msgid "RSVPed"
    1874 msgstr ""
    1875 
    1876 #: includes/register-kinds.php:477
    1877 msgid "Event Details"
    1878 msgstr ""
    1879 
    1880 #: includes/register-kinds.php:497
    1881 msgid "Start Date"
    1882 msgstr ""
    1883 
    1884 #: includes/register-kinds.php:501
    1885 msgid "End Date"
    1886 msgstr ""
    1887 
    1888 #: includes/register-kinds.php:521
    1889 msgid "a specific type of reply regarding attendance of an event"
    1890 msgstr ""
    1891 
    1892 #: includes/register-kinds.php:532
    1893 msgid "Listen"
    1894 msgstr ""
    1895 
    1896 #: includes/register-kinds.php:533
    1897 msgid "Listens"
    1898 msgstr ""
    1899 
    1900 #: includes/register-kinds.php:534
    1901 msgid "Listened"
    1902 msgstr ""
    1903 
    1904 #: includes/register-kinds.php:539
    1905 msgid "Listen To"
    1906 msgstr ""
    1907 
    1908 #: includes/register-kinds.php:562
    1909 msgid "Album"
    1910 msgstr ""
    1911 
    1912 #: includes/register-kinds.php:566
    1913 #: includes/register-kinds.php:631
    1914 msgid "Release Date"
    1915 msgstr ""
    1916 
    1917 #: includes/register-kinds.php:577
    1918 msgid "Album Art"
    1919 msgstr ""
    1920 
    1921 #: includes/register-kinds.php:586
    1922 msgid "listening to audio; sometimes called a scrobble"
    1923 msgstr ""
    1924 
    1925 #: includes/register-kinds.php:597
    1926 msgid "Watch"
    1927 msgstr ""
    1928 
    1929 #: includes/register-kinds.php:598
    1930 msgid "Watches"
    1931 msgstr ""
    1932 
    1933 #: includes/register-kinds.php:599
    1934 msgid "Watched"
    1935 msgstr ""
    1936 
    1937 #: includes/register-kinds.php:604
    1938 msgid "Watching To"
    1939 msgstr ""
    1940 
    1941 #: includes/register-kinds.php:627
    1942 msgid "Series"
    1943 msgstr ""
    1944 
    1945 #: includes/register-kinds.php:642
    1946 msgid "Poster"
    1947 msgstr ""
    1948 
    1949 #: includes/register-kinds.php:651
    1950 msgid "watching a movie, television show, online video, play or other visual-based event"
    1951 msgstr ""
    1952 
    1953 #: includes/register-kinds.php:662
    1954 msgid "Checkin"
    1955 msgstr ""
    1956 
    1957 #: includes/register-kinds.php:663
    1958 msgid "Checkins"
    1959 msgstr ""
    1960 
    1961 #: includes/register-kinds.php:664
    1962 msgid "Checked into"
    1963 msgstr ""
    1964 
    1965 #: includes/register-kinds.php:669
    1966 msgid "Checked In"
    1967 msgstr ""
    1968 
    1969 #: includes/register-kinds.php:681
    1970 msgid "Latitude"
    1971 msgstr ""
    1972 
    1973 #: includes/register-kinds.php:689
    1974 msgid "Longitude"
    1975 msgstr ""
    1976 
    1977 #: includes/register-kinds.php:697
    1978 msgid "Street Address"
    1979 msgstr ""
    1980 
    1981 #: includes/register-kinds.php:701
    1982 msgid "Locality"
    1983 msgstr ""
    1984 
    1985 #: includes/register-kinds.php:705
    1986 msgid "Region"
    1987 msgstr ""
    1988 
    1989 #: includes/register-kinds.php:709
    1990 msgid "Country Name"
    1991 msgstr ""
    1992 
    1993 #: includes/register-kinds.php:713
    1994 msgid "Postal Code"
    1995 msgstr ""
    1996 
    1997 #: includes/register-kinds.php:719
    1998 msgid "identifying you are at a particular geographic location"
    1999 msgstr ""
    2000 
    2001 #: includes/register-kinds.php:730
    2002 msgid "Wish"
    2003 msgstr ""
    2004 
    2005 #: includes/register-kinds.php:731
    2006 msgid "Wishes"
    2007 msgstr ""
    2008 
    2009 #: includes/register-kinds.php:732
    2010 msgid "Wished"
    2011 msgstr ""
    2012 
    2013 #: includes/register-kinds.php:735
    2014 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:746
    2018 msgid "Play"
    2019 msgstr ""
    2020 
    2021 #: includes/register-kinds.php:747
    2022 msgid "Playing"
    2023 msgstr ""
    2024 
    2025 #: includes/register-kinds.php:748
    2026 msgid "Played"
    2027 msgstr ""
    2028 
    2029 #: includes/register-kinds.php:751
    2030 msgid "playing a game"
    2031 msgstr ""
    2032 
    2033 #: includes/register-kinds.php:762
    2034 #: includes/register-kinds.php:763
    2035 msgid "Weather"
    2036 msgstr ""
    2037 
    2038 #: includes/register-kinds.php:767
    2039 msgid "current weather conditions"
    2040 msgstr ""
    2041 
    2042 #: includes/register-kinds.php:778
    2043 #: includes/register-kinds.php:779
    2044 msgid "Exercise"
    2045 msgstr ""
    2046 
    2047 #: includes/register-kinds.php:780
    2048 msgid "Exercised"
    2049 msgstr ""
    2050 
    2051 #: includes/register-kinds.php:783
    2052 msgid "some form of physical activity or workout (examples: walk, run, cycle, hike, yoga, etc.)"
    2053 msgstr ""
    2054 
    2055 #: includes/register-kinds.php:794
    2056 msgid "Trip"
    2057 msgstr ""
    2058 
    2059 #: includes/register-kinds.php:795
    2060 msgid "Trips"
    2061 msgstr ""
    2062 
    2063 #: includes/register-kinds.php:796
    2064 #: includes/register-kinds.php:812
    2065 msgid "Travelled"
    2066 msgstr ""
    2067 
    2068 #: includes/register-kinds.php:799
    2069 msgid "represents a geographic journey"
    2070 msgstr ""
    2071 
    2072 #: includes/register-kinds.php:810
    2073 msgid "Itinerary"
    2074 msgstr ""
    2075 
    2076 #: includes/register-kinds.php:811
    2077 msgid "Itineraries"
    2078 msgstr ""
    2079 
    2080 #: includes/register-kinds.php:815
    2081 msgid "parts of a scheduled trip including transit by car, plane, train, etc."
    2082 msgstr ""
    2083 
    2084 #: includes/register-kinds.php:827
    2085 #: includes/register-kinds.php:828
    2086 msgid "Eat"
    2087 msgstr ""
    2088 
    2089 #: includes/register-kinds.php:829
    2090 msgid "Ate"
    2091 msgstr ""
    2092 
    2093 #: includes/register-kinds.php:832
    2094 msgid "what you are eating, perhaps for a food diary"
    2095 msgstr ""
    2096 
    2097 #: includes/register-kinds.php:844
    2098 msgid "Drink"
    2099 msgstr ""
    2100 
    2101 #: includes/register-kinds.php:845
    2102 msgid "Drinks"
    2103 msgstr ""
    2104 
    2105 #: includes/register-kinds.php:846
    2106 msgid "Drank"
    2107 msgstr ""
    2108 
    2109 #: includes/register-kinds.php:849
    2110 msgid "what you are drinking, perhaps for a food dairy"
    2111 msgstr ""
    2112 
    2113 #: includes/register-kinds.php:861
    2114 msgid "Follow"
    2115 msgstr ""
    2116 
    2117 #: includes/register-kinds.php:862
    2118 msgid "Follows"
    2119 msgstr ""
    2120 
    2121 #: includes/register-kinds.php:863
    2122 msgid "Followed"
    2123 msgstr ""
    2124 
    2125 #: includes/register-kinds.php:866
    2126 msgid "indicating you are now following or subscribing to another person`s activities online"
    2127 msgstr ""
    2128 
    2129 #: includes/register-kinds.php:878
    2130 msgid "Jam"
    2131 msgstr ""
    2132 
    2133 #: includes/register-kinds.php:879
    2134 msgid "Jams"
    2135 msgstr ""
    2136 
    2137 #: includes/register-kinds.php:880
    2138 msgid "Listened to"
    2139 msgstr ""
    2140 
    2141 #: includes/register-kinds.php:883
    2142 msgid "a particularly personally meaningful song (a listen with added emphasis)"
    2143 msgstr ""
    2144 
    2145 #: includes/register-kinds.php:895
    2146 #: includes/register-kinds.php:897
    2147 msgid "Read"
    2148 msgstr ""
    2149 
    2150 #: includes/register-kinds.php:896
    2151 msgid "Reads"
    2152 msgstr ""
    2153 
    2154 #: includes/register-kinds.php:900
    2155 msgid "reading a book, magazine, newspaper, other physical document, or online post"
    2156 msgstr ""
    2157 
    2158 #: includes/register-kinds.php:912
    2159 msgid "Quote"
    2160 msgstr ""
    2161 
    2162 #: includes/register-kinds.php:913
    2163 msgid "Quotes"
    2164 msgstr ""
    2165 
    2166 #: includes/register-kinds.php:914
    2167 msgid "Quoted"
    2168 msgstr ""
    2169 
    2170 #: includes/register-kinds.php:917
    2171 msgid "quoted content"
    2172 msgstr ""
    2173 
    2174 #: includes/register-kinds.php:929
    2175 msgid "Mood"
    2176 msgstr ""
    2177 
    2178 #: includes/register-kinds.php:930
    2179 msgid "Moods"
    2180 msgstr ""
    2181 
    2182 #: includes/register-kinds.php:931
    2183 msgid "Felt"
    2184 msgstr ""
    2185 
    2186 #: includes/register-kinds.php:934
    2187 msgid "how you are feeling (example: happy, sad, indifferent, etc.)"
    2188 msgstr ""
    2189 
    2190 #: includes/register-kinds.php:946
    2191 msgid "Recipe"
    2192 msgstr ""
    2193 
    2194 #: includes/register-kinds.php:947
    2195 msgid "Recipes"
    2196 msgstr ""
    2197 
    2198 #: includes/register-kinds.php:948
    2199 msgid "Cooked"
    2200 msgstr ""
    2201 
    2202 #: includes/register-kinds.php:951
    2203 msgid "list of ingredients and directions for making food or drink"
    2204 msgstr ""
    2205 
    2206 #: includes/register-kinds.php:963
    2207 msgid "Issue"
    2208 msgstr ""
    2209 
    2210 #: includes/register-kinds.php:964
    2211 msgid "Issues"
    2212 msgstr ""
    2213 
    2214 #: includes/register-kinds.php:965
    2215 msgid "Filed an Issue"
    2216 msgstr ""
    2217 
    2218 #: includes/register-kinds.php:968
    2219 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:980
    2223 msgid "Question"
    2224 msgstr ""
    2225 
    2226 #: includes/register-kinds.php:981
    2227 msgid "Questions"
    2228 msgstr ""
    2229 
    2230 #: includes/register-kinds.php:982
    2231 msgid "Asked a question"
    2232 msgstr ""
    2233 
    2234 #: includes/register-kinds.php:985
    2235 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:997
    2239 msgid "Sleep"
    2240 msgstr ""
    2241 
    2242 #: includes/register-kinds.php:998
    2243 msgid "Sleeps"
    2244 msgstr ""
    2245 
    2246 #: includes/register-kinds.php:999
    2247 msgid "Slept"
    2248 msgstr ""
    2249 
    2250 #: includes/register-kinds.php:1002
    2251 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:1014
    2255 msgid "Event"
    2256 msgstr ""
    2257 
    2258 #: includes/register-kinds.php:1015
    2259 msgid "Events"
    2260 msgstr ""
    2261 
    2262 #: includes/register-kinds.php:1016
    2263 msgid "Planned"
    2264 msgstr ""
    2265 
    2266 #: includes/register-kinds.php:1019
    2267 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:1030
    2271 msgid "Review"
    2272 msgstr ""
    2273 
    2274 #: includes/register-kinds.php:1031
    2275 msgid "Reviews"
    2276 msgstr ""
    2277 
    2278 #: includes/register-kinds.php:1032
    2279 msgid "Reviewed"
    2280 msgstr ""
    2281 
    2282 #: includes/register-kinds.php:1035
    2283 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:1047
    2287 msgid "Acquisition"
    2288 msgstr ""
    2289 
    2290 #: includes/register-kinds.php:1048
    2291 msgid "Acquisitions"
    2292 msgstr ""
    2293 
    2294 #: includes/register-kinds.php:1049
    22952287msgid "Acquired"
    22962288msgstr ""
    22972289
    2298 #: includes/register-kinds.php:1052
     2290#: includes/register-kinds.php:680
    22992291msgid "Purchases, gifts, found things, or objects donated"
    23002292msgstr ""
    23012293
    2302 #: includes/register-kinds.php:1063
     2294#: includes/register-kinds.php:690
    23032295msgid "Craft"
    23042296msgstr ""
    23052297
    2306 #: includes/register-kinds.php:1064
     2298#: includes/register-kinds.php:691
    23072299msgid "Crafts"
    23082300msgstr ""
    23092301
    2310 #: includes/register-kinds.php:1065
     2302#: includes/register-kinds.php:692
     2303#: includes/register-kinds.php:695
    23112304msgid "Crafted"
    23122305msgstr ""
    23132306
    2314 #: includes/register-kinds.php:1068
     2307#: includes/register-kinds.php:698
    23152308msgid "Activities like knitting, crocheting, cross stitch, wood working, restoration, 3d printing...the activity of building something."
    23162309msgstr ""
    … …  
    23882381#: templates/reply-metabox.php:47
    23892382msgid "Clear"
    2390 msgstr ""
    2391 
    2392 #: templates/reply-time.php:18
    2393 msgid "Duration"
    2394 msgstr ""
    2395 
    2396 #: templates/reply-time.php:21
    2397 msgid "Years"
    2398 msgstr ""
    2399 
    2400 #: templates/reply-time.php:25
    2401 msgid "Months"
    2402 msgstr ""
    2403 
    2404 #: templates/reply-time.php:29
    2405 msgid "Days"
    2406 msgstr ""
    2407 
    2408 #: templates/reply-time.php:35
    2409 msgid "Hours"
    2410 msgstr ""
    2411 
    2412 #: templates/reply-time.php:39
    2413 msgid "Minutes"
    2414 msgstr ""
    2415 
    2416 #: templates/reply-time.php:43
    2417 msgid "Seconds"
    24182383msgstr ""
    24192384
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-base.php

    r3738687 r3810578  
    1414 *
    1515 * Provides date ordering for feed items and sanitizers for values taken from
    16  * remote documents. The limit_* sanitizers are derived from the Press This
    17  * code that was removed from WordPress core.
     16 * remote documents. limit_string() is derived from the Press This code that
     17 * was removed from WordPress core.
    1818 *
    1919 * @since 1.0.0
    … …  
    109109
    110110        /**
    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.0
    116          *
    117          * @param array $value Array to limit.
    118          * @return array The first 100 values of $value, or an empty array if $value is
    119          *               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         /**
    134111         * Sanitizes a string and limits it to 5,000 characters.
    135112         *
    … …  
    159136
    160137        /**
    161          * Validates a URL, resolves it against the source URL, and limits its length.
    162          *
    163          * @since 1.0.0
    164          *
    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 https
    168          *                only), or an empty string if it is not a string, longer than
    169          *                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 pixels
    196          * and the WordPress.com stats image.
    197          *
    198          * @since 1.0.0
    199          *
    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.0
    247                  *
    248                  * @param string $src Absolute image URL that passed the built-in checks, or an
    249                  *                    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 are
    258          * rewritten to their watch-page form. Any other URL is kept only if it
    259          * matches a registered oEmbed provider.
    260          *
    261          * @since 1.0.0
    262          *
    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         /**
    306138         * Adds a value to an array key, turning the key into a list on repeats.
    307139         *
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-discovery.php

    r3738687 r3810578  
    295295                                                                                'type' => 'card',
    296296                                                                        );
    297                                                                         if ( wp_http_validate_url( $jf2['author'] ) ) {
     297                                                                        if ( pt_is_http_url( $jf2['author'] ) ) {
    298298                                                                                $author['url'] = $jf2['author'];
    299299                                                                        } else {
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-html.php

    r3738687 r3810578  
    9797                                $src = $video->getAttribute( 'src' );
    9898                                if ( ! empty( $src ) ) {
    99                                         $videos[] = $src;
     99                                        $videos[] = pt_make_absolute_url( $src, $url );
    100100                                }
    101101                        }
    … …  
    110110                                $src = $audio->getAttribute( 'src' );
    111111                                if ( ! empty( $src ) ) {
    112                                         $audios[] = $src;
     112                                        $audios[] = pt_make_absolute_url( $src, $url );
    113113                                }
    114114                        }
    … …  
    117117                                $src = $audio->getAttribute( 'data-audio-url' );
    118118                                if ( ! empty( $src ) ) {
    119                                         $audios[] = $src;
     119                                        $audios[] = pt_make_absolute_url( $src, $url );
    120120                                }
    121121                        }
    122122                        $jf2['audio'] = array_unique( $audios );
    123123                }
    124 
    125                 /*
    126                  For now do not search every link embed etc
    127                 // 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                 */
    188124
    189125                if ( ! empty( $args['debug'] ) ) {
    … …  
    201137         *
    202138         * @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.
    203142         *
    204143         * @param array $meta Meta values as grouped by parse_meta(), keyed by prefix
    … …  
    269208                                        $modified = $meta['article']['modified_time'] ?? $meta['article']['modified'] ?? null;
    270209                                        if ( $modified ) {
    271                                                 $jf2['modified'] = normalize_iso8601( $modified );
     210                                                $jf2['updated'] = normalize_iso8601( $modified );
    272211                                        }
    273212                                        $jf2['category'] = $meta['article']['tag'] ?? null;
    … …  
    314253                        }
    315254                }
    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'];
    324271                                } else {
    325272                                        $jf2['author'] = array();
    326                                         foreach ( $dc['Creator'] as $creator ) {
     273                                        foreach ( $dc['creator'] as $creator ) {
    327274                                                $jf2['author'][] = array(
    328275                                                        'type' => 'card',
    … …  
    332279                                }
    333280                        }
    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 );
    339287                        }
    340288                }
    … …  
    365313
    366314                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' ) );
    372317                }
    373318
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-jsonld.php

    r3738687 r3810578  
    210210                if ( ! array_key_exists( 'author', $return ) && array_key_exists( 'person', $jf2 ) ) {
    211211                        $return['author'] = $jf2['person'];
    212                 }
    213                 if ( ! array_key_exists( 'publication', $return ) && array_key_exists( 'publisher', $jf2 ) ) {
    214                         $return['publication'] = $jf2['publisher'];
    215212                }
    216213                return array_filter( $return, array( __CLASS__, 'is_set' ) );
    … …  
    538535         * Converts a MusicRelease node into a jf2 cite.
    539536         *
    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.
    541543         *
    542544         * @param array $music MusicRelease node.
    … …  
    559561                        'featured'  => self::image_to_photo( $music['image'] ?? null ),
    560562                );
    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;
    574586                                }
    575587                        }
    … …  
    630642         * Converts an Event node into a jf2 event.
    631643         *
    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.
    633648         *
    634649         * @param array $event Event or BusinessEvent node.
    … …  
    644659                        'url'       => $event['url'] ?? null,
    645660                        'summary'   => $event['description'] ?? null,
    646                         'organizer' => self::organization_to_hcard( $event['organizer'] ?? null ),
     661                        'organizer' => self::person_to_hcard( $event['organizer'] ?? null ),
    647662                        'location'  => self::place_to_hcard( $event['location'] ?? null ),
    648663                        'start'     => normalize_iso8601( $event['startDate'] ?? null ),
    … …  
    658673         * Returns the URL of an ImageObject.
    659674         *
    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.
    663680         *
    664681         * @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.
    666684         */
    667685        public static function image_to_photo( $image ) {
    … …  
    686704                 * }
    687705                 */
    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;
    689712        }
    690713
    … …  
    693716         *
    694717         * @since 1.0.0
     718         * @since 2.0.1 The transcript's plain text is content.text, not content.value.
    695719         *
    696720         * @param array|string $audio AudioObject node, or a URL.
    … …  
    717741                if ( isset( $audio['transcript'] ) ) {
    718742                        $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'] ) ),
    721745                        );
    722746                }
    … …  
    731755         *
    732756         * @since 1.0.0
     757         * @since 2.0.1 The transcript's plain text is content.text, not content.value.
    733758         *
    734759         * @param array|string $video VideoObject node, or a URL.
    … …  
    755780                if ( isset( $video['transcript'] ) ) {
    756781                        $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'] ) ),
    759784                        );
    760785                }
    … …  
    813838
    814839        /**
     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        /**
    815860         * Converts a Place node into a jf2 card.
    816861         *
    817862         * @since 1.0.0
     863         * @since 2.0.1 A plain-text address is kept as the card's label.
    818864         *
    819865         * @param array|mixed $place Place node.
    … …  
    839885
    840886                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'] ) );
    845888                }
    846889                return array_filter( $hcard );
    … …  
    927970         *
    928971         * @since 1.0.0
     972         * @since 2.0.1 A plain-text address is kept as the card's label.
    929973         *
    930974         * @param array|mixed $organization Organization, NewsMediaOrganization, NGO or
    … …  
    9631007                }
    9641008                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'] ) );
    9711010                }
    9721011                return array_filter( $publication );
    … …  
    10711110         * Converts an article or web page node into a jf2 entry.
    10721111         *
    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.
    10761118         *
    10771119         * @param array|mixed $newsarticle Article node.
    … …  
    11101152                        if ( ! is_array( $newsarticle['keywords'] ) ) {
    11111153                                $newsarticle['keywords'] = explode( ',', $newsarticle['keywords'] );
    1112                         } elseif ( is_string( $newsarticle['keywords'] ) ) {
    1113                                 $newsarticle['keywords'] = array( $newsarticle['keywords'] );
    11141154                        }
    11151155                        $jf2['category'] = array_map( 'trim', $newsarticle['keywords'] );
    … …  
    11221162                        );
    11231163                }
    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;
    11461178                        }
    11471179                }
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-mf2.php

    r3738687 r3810578  
    199199         * @since 1.0.0
    200200         * @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.
    201202         *
    202203         * @param array      $item   Microformat to find the author of.
    … …  
    219220                                        return $a;
    220221                                } elseif ( is_string( $a ) ) {
    221                                         if ( wp_http_validate_url( $a ) ) {
     222                                        if ( pt_is_http_url( $a ) ) {
    222223                                                // 5.2 "otherwise if author property is an http(s) URL, let the author-page have that URL"
    223224                                                $authorpage = $a;
    … …  
    489490         *
    490491         * 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.
    495498         *
    496499         * @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.
    498502         */
    499503        public static function normalize_feed( $input ) {
    … …  
    506510                        }
    507511                }
     512                $input['items'] = array_values( $input['items'] );
     513                $author         = $hcard ? array( 'author' => array( $hcard ) ) : array();
    508514                if ( 1 === count( $input['items'] ) ) {
    509                         if ( self::has_prop( $input['items'][0], 'author' ) ) {
     515                        if ( $hcard && ! self::has_prop( $input['items'][0], 'author' ) ) {
    510516                                $input['items'][0]['properties']['author'] = array( $hcard );
    511517                        }
    … …  
    516522                                array(
    517523                                        'type'       => array( 'h-feed' ),
    518                                         'properties' => array(
    519                                                 'author' => array( $hcard ),
    520                                         ),
     524                                        'properties' => $author,
    521525                                        'children'   => $input['items'],
    522526                                ),
    … …  
    10431047         *
    10441048         * 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.
    10491058         *
    10501059         * @param array $unknown Microformat.
    10511060         * @param array $mf      Parsed mf2 document.
    10521061         * @param array $args    Parse arguments (see Parser::parse()).
    1053          * @return array jf2 with the generic properties and the type, or an empty
    1054          *               array if the 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.
    10551064         */
    10561065        public static function parse_hunknown( $unknown, $mf, $args ) {
    … …  
    10591068                        return array();
    10601069                }
    1061                 // Parse unknown h property.
    10621070                $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                }
    10631078                if ( empty( $data ) ) {
    10641079                        return array();
    … …  
    10741089         * Reads name, published, updated, url, author, content and summary, drops
    10751090         * 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.
    10771093         *
    10781094         * @since 1.0.0
    10791095         * @since 2.0.0 Drops a name that is a prefix of the content, including a
    10801096         *              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.
    10811099         *
    10821100         * @param array $entry Microformat.
    … …  
    11081126                }
    11091127
     1128                // The page's rel=syndication links add to the item's own u-syndication;
     1129                // callers merge this result over their own properties.
    11101130                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'] ) ) );
    11191133                }
    11201134                return self::filter_empty( $data );
    … …  
    14701484                $properties = array( 'category', 'item' );
    14711485                $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                 }
    14791486                $data = array_merge( $data, self::parse_h( $entry, $mf, $args ) );
    14801487                return self::filter_empty( $data );
    … …  
    15041511                $properties = array( 'category', 'item' );
    15051512                $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                 }
    15131513                $data = array_merge( $data, self::parse_h( $entry, $mf, $args ) );
    15141514                return self::filter_empty( $data );
    … …  
    15791579                $properties = array( 'category', 'item' );
    15801580                $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                 }
    15881581                $data = array_merge( $data, self::parse_h( $item, $mf, $args ) );
    15891582                return self::filter_empty( $data );
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-restapi.php

    r3738687 r3810578  
    3232         *
    3333         * @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.
    3436         *
    3537         * @param string $key  Field name.
    3638         * @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.
    3841         */
    3942        public static function get_rendered( $key, $item ) {
    40                 if ( ! array_key_exists( $key, $item ) ) {
     43                if ( ! isset( $item[ $key ] ) || ! is_array( $item[ $key ] ) ) {
    4144                        return null;
    4245                }
    43                 if ( array_key_exists( 'rendered', $item[ $key ] ) ) {
    44                         return $item[ $key ]['rendered'];
    45                 }
    46                 return null;
     46                return $item[ $key ]['rendered'] ?? null;
    4747        }
    4848
    … …  
    279279                                return $return;
    280280                        } else {
    281                                 $content = self::fetch( $rest_url, '/wp/v2/posts?_embed=1' );
     281                                $content = self::fetch( $rest_url, '/wp/v2/posts' );
    282282                                if ( is_wp_error( $content ) || ! is_array( $content ) ) {
    283283                                        return $content;
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/class-rss.php

    r3738687 r3810578  
    102102         *
    103103         * @since 1.0.0
     104         * @since 2.0.1 An author whose name is a single link is no longer dropped.
    104105         *
    105106         * @param SimplePie_Author|SimplePie_Author[]|null $author One author or a list.
    … …  
    129130                        if ( ! empty( $names ) ) {
    130131                                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 );
    133135                                } else {
    134136                                        foreach ( $names as $name => $url ) {
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/includes/functions.php

    r3738687 r3810578  
    11731173        }
    11741174}
     1175
     1176if ( ! 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  
    372372
    373373            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') . '"') : '') . '/>';
    375375
    376376                $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                }
    378387
    379388                $ele = $this->doc->importNode($frag->documentElement, true);
    … …  
    386395            }
    387396        } 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>.");
    389398            $ele = $this->doc->createElement('invalid');
    390399        }
    … …  
    672681                return true;
    673682            }
     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            }
    674697        } while ($working = $working->parentNode);
    675698
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/Scanner.php

    r2839509 r3810578  
    3030
    3131    /**
     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    /**
    3242     * Parse errors.
    3343     */
    … …  
    247257        // Add one to $this->char because we want the number for the next
    248258        // 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        }
    250287    }
    251288
    … …  
    288325        }
    289326
    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;
    308330    }
    309331
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/Tokenizer.php

    r3738687 r3810578  
    568568    protected function quotedAttributeValue($quote)
    569569    {
    570         $stoplist = "\f" . $quote;
     570        $stoplist = $quote;
    571571        $val = '';
    572572
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Parser/UTF8Utils.php

    r3738687 r3810578  
    2828*/
    2929
    30 use Masterminds\HTML5\Exception;
    31 
    3230class UTF8Utils
    3331{
    … …  
    3937    /**
    4038     * 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.
    4240     *
    4341     * @param string $string
    … …  
    4745    public static function countChars($string)
    4846    {
    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');
    6348    }
    6449
    … …  
    8974        // which contains links to the actual but reports as well as work around
    9075        // 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.
    9580
    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);
    11790
    11891        /*
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Serializer/OutputRules.php

    r3738687 r3810578  
    279279    }
    280280
     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
    281295    public function processorInstruction($ele)
    282296    {
    … …  
    301315        foreach ($this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele) as $nsNode) {
    302316            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('"');
    304318            }
    305319        }
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/html5/HTML5/Serializer/Traverser.php

    r2110745 r3810578  
    105105                $this->rules->comment($node);
    106106                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;
    107115            // Currently we don't support embedding DTDs.
    108116            default:
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/lib/mf2/Parser.php

    r3738687 r3810578  
    6464 */
    6565function fetch($url, $convertClassic = true, &$curlInfo=null) {
     66        $version = '0';
     67        if (is_array($curl = curl_version())) {
     68                $version = $curl['version'];
     69        }
     70
    6671        $ch = curl_init();
    6772        curl_setopt($ch, CURLOPT_URL, $url);
    … …  
    7075        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    7176        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
    7286        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    7387                'Accept: text/html'
    7488        ));
    7589        $html = curl_exec($ch);
     90
     91        if ($html === false) {
     92                return null;
     93        }
     94
    7695        $info = $curlInfo = curl_getinfo($ch);
    77         curl_close($ch);
     96        if (PHP_VERSION_ID < 80000) {
     97                curl_close($ch);
     98        }
    7899
    79100        if (strpos(strtolower($info['content_type']), 'html') === false) {
    … …  
    94115 */
    95116function 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);
    97123}
    98124
    … …  
    112138
    113139function unicodeTrim($str) {
    114         // this is cheating. TODO: find a better way if this causes any problems
    115         $str = str_replace(mb_convert_encoding('&nbsp;', '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);
    118141}
    119142
    … …  
    146169
    147170/**
     171 * Registered with the XPath object and used within XPaths for finding root elements.
     172 * @param string $class
     173 * @return bool
     174 */
     175function classHasMf2RootClassname($class) {
     176        return count(mfNamesFromClass($class, 'h-')) > 0;
     177}
     178
     179/**
    148180 * Get Nested µf Property Name From Class
    149181 *
    … …  
    158190        $propertyNames = array();
    159191
    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;
    168196                }
    169197        }
    … …  
    356384         */
    357385        public function __construct($input, $url = null, $jsonMode = false) {
     386                $emptyDocDefault = '<html><body></body></html>';
    358387                libxml_use_internal_errors(true);
    359388                if (is_string($input)) {
     389                        if (empty($input)) {
     390                                        $input = $emptyDocDefault;
     391                        }
     392                               
    360393                        if (class_exists('Masterminds\\HTML5')) {
    361394                                        $doc = new \Masterminds\HTML5(array('disable_html_ns' => true));
    … …  
    369402                } else {
    370403                        $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.
    374408                $this->xpath = new DOMXPath($doc);
     409                $this->xpath->registerNamespace('php', 'http://php.net/xpath');
     410                $this->xpath->registerPhpFunctions('\\Mf2\\classHasMf2RootClassname');
    375411
    376412                $baseurl = $url;
    … …  
    405441
    406442        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());
    409445
    410446                $prefixes = $this->parsed[$e];
    … …  
    420456         */
    421457        private function isElementParsed(\DOMElement $e, $prefix) {
    422                 if (!$this->parsed->contains($e)) {
     458                if (!$this->parsed->offsetExists($e)) {
    423459                        return false;
    424460                }
    … …  
    440476         */
    441477        private function isElementUpgraded(\DOMElement $el, $property) {
    442                 if ( $this->upgraded->contains($el) ) {
     478                if ( $this->upgraded->offsetExists($el) ) {
    443479                        if ( in_array($property, $this->upgraded[$el]) ) {
    444480                                return true;
    … …  
    586622         */
    587623        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);
    589625
    590626                if ($valueClassElements->length !== 0) {
    … …  
    598634                }
    599635
    600                 $valueTitleElements = $this->xpath->query('./*[contains(concat(" ", @class, " "), " value-title ")]', $e);
     636                $valueTitleElements = $this->xpath->query('./*[contains(concat(" ", normalize-space(@class), " "), " value-title ")]', $e);
    601637
    602638                if ($valueTitleElements->length !== 0) {
    … …  
    686722        public function parseDT(\DOMElement $dt, &$dates = array(), &$impliedTimezone = null) {
    687723                // 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);
    689725                $dtValue = false;
    690726
    … …  
    938974        public function parseH(\DOMElement $e, $is_backcompat = false, $has_nested_mf = false) {
    939975                // 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)) {
    941977                        return null;
    942978                }
    … …  
    962998
    963999                // 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) {
    9651001                        // element is already parsed
    9661002                        if ($this->isElementParsed($p, 'p')) {
    … …  
    9871023
    9881024                // 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) {
    9901026                        // element is already parsed
    9911027                        if ($this->isElementParsed($u, 'u')) {
    … …  
    10121048
    10131049                // 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) {
    10151051                        // element is already parsed
    10161052                        if ($this->isElementParsed($dt, 'dt')) {
    … …  
    10471083
    10481084                // 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) {
    10501086                        // element is already parsed
    10511087                        if ($this->isElementParsed($em, 'e')) {
    … …  
    11651201                        'properties' => $return
    11661202                );
    1167                
     1203
    11681204                if(trim($e->getAttribute('id')) !== '') {
    11691205                        $parsed['id'] = trim($e->getAttribute("id"));
    … …  
    15071543                // start with mf2 root class name xpath
    15081544                $xpaths = array(
    1509                         'contains(concat(" ",normalize-space(@class)), " h-")'
     1545                        '(php:function("\\Mf2\\classHasMf2RootClassname", normalize-space(@class)))'
    15101546                );
    15111547
    … …  
    15621598                                break;
    15631599
     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':
    15641632                                case 'hreview':
    15651633                                        $item_and_vcard = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " item ") and contains(concat(" ", normalize-space(@class), " "), " vcard ")]', $el);
    … …  
    15931661                                                        if ( !$this->hasRootMf2($tempEl) ) {
    15941662                                                                $this->addMfClasses($tempEl, 'p-item h-product');
    1595                                                                 $this->backcompat($tempEl, 'vevent');
     1663                                                                $this->backcompat($tempEl, 'hproduct');
    15961664                                                                $this->addUpgraded($tempEl, array('item', 'hproduct'));
    15971665                                                        }
    … …  
    15991667                                        }
    16001668
     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
    16011688                                        $this->upgradeRelTagToCategory($el);
    16021689                                break;
    16031690
    16041691                                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 ) {
    16091696                                                        if ( !$this->hasRootMf2($tempEl) ) {
    1610                                                                 $this->addMfClasses($tempEl, 'h-card');
     1697                                                                $this->addMfClasses($tempEl, 'p-location h-card');
    16111698                                                                $this->backcompat($tempEl, 'vcard');
     1699                                                                $this->addUpgraded($tempEl, array('location', 'vcard'));
    16121700                                                        }
    16131701                                                }
    … …  
    16581746
    16591747                // 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);
    16621750                } else {
    16631751                        $this->upgraded[$el] = array_merge($this->upgraded[$el], $property);
    … …  
    16881776        public function hasRootMf2(\DOMElement $el) {
    16891777                $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;
    16991781        }
    17001782
    … …  
    17131795                // replace all roots
    17141796                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) {
    17161798                                $el->setAttribute('class', $el->getAttribute('class') . ' ' . $new);
    17171799                        }
    … …  
    17211803                        $newRoot = $this->classicRootMap[$oldRoot];
    17221804                        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) {
    17241806                                        $el->setAttribute('class', $el->getAttribute('class') . ' ' . $data['replace']);
    17251807                                }
    … …  
    17561838                'vevent' => 'h-event',
    17571839                'hreview' => 'h-review',
     1840                'hreview-aggregate' => 'h-review-aggregate',
    17581841                'hproduct' => 'h-product',
    17591842                'adr' => 'h-adr',
     1843                'geo' => 'h-geo'
    17601844        );
    17611845
    … …  
    18741958                ),
    18751959                '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                        ),
    18771973                ),
    18781974                'hentry' => array(
    … …  
    19842080                        ),
    19852081                        'location' => array(
    1986                                 'replace' => 'h-card',
    1987                                 'context' => 'vcard'
     2082                                'replace' => 'p-location',
    19882083                        ),
    19892084                        'geo' => array(
    19902085                                'replace' => 'p-location h-geo'
    19912086                        ),
     2087                        'attendee' => array(
     2088                                'replace' => 'p-attendee h-card',
     2089                                'context' => 'vcard'
     2090                        )
    19922091                ),
    19932092                'hreview' => array(
    … …  
    20022101                                'context' => 'item'
    20032102                        ),
    2004                         'reviewer' => array(
    2005                                 'replace' => 'p-author h-card',
    2006                                 'context' => 'vcard',
    2007                         ),
     2103                        # reviewer: see backcompat()
    20082104                        'dtreviewed' => array(
    20092105                                'replace' => 'dt-published'
    … …  
    20232119                        'category' => array(
    20242120                                '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'
    20252151                        ),
    20262152                ),
    … …  
    20472173                                'replace' => 'u-url',
    20482174                        ),
    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'
    20522176                        'price' => array(
    20532177                                'replace' => 'p-price'
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/parse-this.php

    r3738687 r3810578  
    44 * Plugin URI: https://github.com/dshanske/parse-this
    55 * Description: Turns URLs into structured jf2 data from microformats2, JSON-LD, meta tags and RSS, Atom and JSON feeds.
    6  * Version: 2.0.0
     6 * Version: 2.0.1
    77 * Author: David Shanske
    88 * Author URI: https://david.shanske.com
    … …  
    4545                         * @var string
    4646                         */
    47                         define( 'PARSE_THIS_VERSION', '2.0.0' );
     47                        define( 'PARSE_THIS_VERSION', '2.0.1' );
    4848                }
    4949                require_once plugin_dir_path( __FILE__ ) . 'includes/autoload.php';
  • indieweb-post-kinds/tags/4.0.2/lib/parse-this/readme.txt

    r3738687 r3810578  
    22Contributors: dshanske
    33Tags: indieweb, microformats, jf2, json-ld, feeds
    4 Stable tag: 2.0.0
     4Stable tag: 2.0.1
    55Requires at least: 6.2
    66Requires PHP: 7.4
    … …  
    8888
    8989* `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.
    9190* `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.
    9291* `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.
    … …  
    162161
    163162== Changelog ==
     163
     164= 2.0.1 ( 2026-11-18 ) =
     165
     166Bug 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.
    164177
    165178= 2.0.0 ( 2026-10-03 ) =
    … …  
    222235== Upgrade Notice ==
    223236
     237= 2.0.1 =
     238Bug 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
    224240= 2.0.0 =
    225241A 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  
    22Contributors: dshanske
    33Tags: indieweb, interaction, posts, webmention, share, like, scrobble
    4 Stable tag: 4.0.1
     4Stable tag: 4.0.2
    55Requires at least: 6.2
    66Requires PHP: 7.4
    … …  
    305305
    306306== 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
    307318
    308319= 4.0.1 ( 2026-10-28 ) =
  • indieweb-post-kinds/trunk/.gitattributes

    r3738687 r3810578  
    55/tests export-ignore
    66/bin export-ignore
     7/build export-ignore
    78/node_modules export-ignore
    89/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.
     1Developer 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.
    22
    33== Template functions ==
    … …  
    2424`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.
    2525`set_post_kind_visibility( $slug, $show = true )` - Shows or hides a kind in Settings, including the kinds reserved for future use.
     26
     27A 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.
    2628
    2729== Time functions ==
    … …  
    122124* 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.
    123125* 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.
    124127
    125128== Styling icons ==
    … …  
    132135
    133136To 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
     138When 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.
    134139
    135140Copies 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  
    1212 * Generates form fields for the posting UI from a kind's property schema.
    1313 *
    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.
    1525 * - 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().
    2532 *
    2633 * @since 3.3.4
    … …  
    3138         * Returns a list of time zones with translated labels.
    3239         *
    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.
    3444         *
    3545         * @return string[] Labels, keyed by time zone identifier.
    3646         */
    3747        public static function timezone_list() {
    38                 return array(
     48                $zones = array(
    3949                        'Pacific/Niue'                   => __( '(GMT-11:00) Niue', 'indieweb-post-kinds' ),
    4050                        'Pacific/Pago_Pago'              => __( '(GMT-11:00) Pago Pago', 'indieweb-post-kinds' ),
    … …  
    109119                        'America/Cayenne'                => __( '(GMT-03:00) Cayenne', 'indieweb-post-kinds' ),
    110120                        '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' ),
    112122                        'America/Maceio'                 => __( '(GMT-03:00) Maceio', 'indieweb-post-kinds' ),
    113123                        'America/Miquelon'               => __( '(GMT-03:00) Miquelon', 'indieweb-post-kinds' ),
    … …  
    182192                        'Europe/Istanbul'                => __( '(GMT+02:00) Istanbul', 'indieweb-post-kinds' ),
    183193                        'Europe/Kaliningrad'             => __( '(GMT+02:00) Moscow-01 - Kaliningrad', 'indieweb-post-kinds' ),
    184                         'Europe/Kiev'                    => __( '(GMT+02:00) Kiev', 'indieweb-post-kinds' ),
     194                        'Europe/Kyiv'                    => __( '(GMT+02:00) Kyiv', 'indieweb-post-kinds' ),
    185195                        'Europe/Riga'                    => __( '(GMT+02:00) Riga', 'indieweb-post-kinds' ),
    186196                        'Europe/Sofia'                   => __( '(GMT+02:00) Sofia', 'indieweb-post-kinds' ),
    … …  
    215225                        'Indian/Kerguelen'               => __( '(GMT+05:00) Kerguelen', 'indieweb-post-kinds' ),
    216226                        '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' ),
    218228                        'Asia/Colombo'                   => __( '(GMT+05:30) Colombo', 'indieweb-post-kinds' ),
    219                         'Asia/Katmandu'                  => __( '(GMT+05:45) Katmandu', 'indieweb-post-kinds' ),
     229                        'Asia/Kathmandu'                 => __( '(GMT+05:45) Kathmandu', 'indieweb-post-kinds' ),
    220230                        'Antarctica/Vostok'              => __( '(GMT+06:00) Vostok', 'indieweb-post-kinds' ),
    221231                        'Asia/Almaty'                    => __( '(GMT+06:00) Almaty', 'indieweb-post-kinds' ),
    … …  
    225235                        'Asia/Thimphu'                   => __( '(GMT+06:00) Thimphu', 'indieweb-post-kinds' ),
    226236                        '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' ),
    228238                        'Indian/Cocos'                   => __( '(GMT+06:30) Cocos', 'indieweb-post-kinds' ),
    229239                        'Antarctica/Davis'               => __( '(GMT+07:00) Davis', 'indieweb-post-kinds' ),
    … …  
    232242                        'Asia/Jakarta'                   => __( '(GMT+07:00) Jakarta', 'indieweb-post-kinds' ),
    233243                        'Asia/Krasnoyarsk'               => __( '(GMT+07:00) Moscow+04 - Krasnoyarsk', 'indieweb-post-kinds' ),
    234                         'Asia/Saigon'                    => __( '(GMT+07:00) Hanoi', 'indieweb-post-kinds' ),
    235244                        'Asia/Ho_Chi_Minh'               => __( '(GMT+07:00) Ho Chi Minh', 'indieweb-post-kinds' ),
    236245                        'Indian/Christmas'               => __( '(GMT+07:00) Christmas', 'indieweb-post-kinds' ),
    237246                        'Antarctica/Casey'               => __( '(GMT+08:00) Casey', 'indieweb-post-kinds' ),
    238247                        'Asia/Brunei'                    => __( '(GMT+08:00) Brunei', 'indieweb-post-kinds' ),
    239                         'Asia/Choibalsan'                => __( '(GMT+08:00) Choibalsan', 'indieweb-post-kinds' ),
    240248                        'Asia/Hong_Kong'                 => __( '(GMT+08:00) Hong Kong', 'indieweb-post-kinds' ),
    241249                        'Asia/Irkutsk'                   => __( '(GMT+08:00) Moscow+05 - Irkutsk', 'indieweb-post-kinds' ),
    … …  
    284292                        'Pacific/Wallis'                 => __( '(GMT+12:00) Wallis', 'indieweb-post-kinds' ),
    285293                        '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' ),
    287295                        'Pacific/Fakaofo'                => __( '(GMT+13:00) Fakaofo', 'indieweb-post-kinds' ),
    288296                        'Pacific/Tongatapu'              => __( '(GMT+13:00) Tongatapu', 'indieweb-post-kinds' ),
    289297                        'Pacific/Kiritimati'             => __( '(GMT+14:00) Kiritimati', 'indieweb-post-kinds' ),
    290298                );
     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 );
    291311        }
    292312
    … …  
    295315         *
    296316         * @since 3.3.4
     317         * @since 4.0.2 Uses get_gmt_offsets().
    297318         *
    298319         * @return string[] Offsets such as '-05:00'.
    299320         */
    300321        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"';
    315382        }
    316383
    … …  
    318385         * Renders date, time and offset inputs.
    319386         *
    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.
    324394         * @return string The inputs.
    325395         */
    326396        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() );
    332400                }
    333401                $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'] ) );
    339406                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 ) );
    341408                }
    342409                $return[] = '</select></label>';
    … …  
    345412
    346413        /**
    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.
    353422         * @return string The inputs.
    354423         */
    355424        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'] );
    362435                $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 );
    373437                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                        );
    375447                }
    376448                $return[] = '</label>';
    … …  
    379451
    380452        /**
    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(
    394461                        'name'  => array(
    395462                                'type'  => 'text',
    … …  
    405472                        ),
    406473                );
    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.
    419676         *
    420677         * @since 3.3.4
    … …  
    425682         */
    426683        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>';
    431688                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 ) );
    433690                }
    434691                $return[] = '</select></label>';
    435692                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                );
    436715        }
    437716
    … …  
    446725         */
    447726        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 );
    453728        }
    454729
    455730        /**
    456731         * 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.
    457745         *
    458746         * @since 3.3.4
    … …  
    462750         * @return string The input.
    463751         */
    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.
    479763         * @return string The input.
    480764         */
    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.4
    493          *
    494          * @param array  $args  Field arguments, as returned by validate().
    495          * @param string $value Value.
    496          * @return string The input.
    497          */
    498765        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                );
    504777        }
    505778
    … …  
    515788        public static function field_list( $args, $value ) {
    516789                if ( is_array( $value ) ) {
    517                         $value = implode( ';', $value );
     790                        $value = implode( ';', array_filter( $value, 'is_scalar' ) );
    518791                }
    519792                return self::field_textarea( $args, $value );
    … …  
    521794
    522795        /**
    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.
    529802         * @return string The inputs.
    530803         */
    531804        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.
    542815         * @return string The inputs.
    543816         */
    544817        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 : '';
    546863        }
    547864
    … …  
    581898         * Checks a field definition and fills in defaults.
    582899         *
    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.
    584906         *
    585907         * @param array $element Field definition.
    … …  
    587909         */
    588910        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 ) ) {
    591912                        return false;
    592913                }
    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.
    598914                if ( ! self::get( 'name', $element ) ) {
     915                        if ( ! self::get( 'label', $element ) ) {
     916                                return false;
     917                        }
    599918                        $element['name'] = sanitize_title( $element['label'] );
    600919                }
    601                 // If no label property then the name property copies over.
    602920                if ( ! self::get( 'label', $element ) ) {
    603921                        $element['label'] = $element['name'];
    604922                }
    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                }
    606926                if ( ! self::get( 'class', $element ) ) {
    607927                        $element['class'] = '';
    608928                }
    609                 // Class can be an array.
    610929                if ( is_array( $element['class'] ) ) {
    611930                        $element['class'] = implode( ' ', $element['class'] );
    612931                }
    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                }
    6191166                switch ( $type ) {
    6201167                        case 'cite':
    6211168                        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;
    6261205                        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;
    6311207                        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.4
    653          *
    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.
    6551231         * @return bool
    6561232         */
    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();
    7161328                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 );
    7191337                        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 ) );
    7701368        }
    7711369}
  • indieweb-post-kinds/trunk/includes/class-kind-media-metadata.php

    r3738687 r3810578  
    340340
    341341        /**
    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.
    346348         *
    347349         * @since 3.3.0
    348          *
    349          * @param array $metadata An existing array with data.
    350          *
    351          * @return array Returns array of sanitized metadata.
     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.
    352354         */
    353355        public static function wp_sanitize_media_metadata( $metadata ) {
    354356                if ( ! is_array( $metadata ) ) {
    355                                 return $metadata;
     357                        return $metadata;
    356358                }
    357359                foreach ( $metadata as $name => $value ) {
    358                         if ( ! is_string( $value ) ) {
    359                                 continue;
    360                         }
    361360                        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                        }
    368373                }
    369374                return $metadata;
  • indieweb-post-kinds/trunk/includes/class-kind-taxonomy.php

    r3771941 r3810578  
    372372
    373373        /**
    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.
    375379         *
    376380         * @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[]
    382387         */
    383388        public static function embed_template_hierarchy( $templates ) {
    384389                $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 );
    392404        }
    393405
    … …  
    10341046
    10351047        /**
    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.
    10371053         *
    10381054         * @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.
    10431058         */
    10441059        public static function get_terms_from_query() {
    10451060                global $wp_query;
    10461061                $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;
    10521074                                }
    10531075                        }
    … …  
    10691091        public static function kind_archive_prefix( $prefix ) {
    10701092                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 ) . ':';
    10751099                }
    10761100                return $prefix;
    … …  
    12871311         *     @type string $verb            The verb or action, such as 'Liked'. Default the slug.
    12881312         *     @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.
    12901315         *     @type string $format          Post format that maps to this kind. Default 'standard'.
    12911316         *     @type string $icon            Icon name. Default the slug.
    … …  
    12931318         *     @type string $description_url Link to more information.
    12941319         *     @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.
    12961322         *     @type bool   $show            Whether to show the kind in Settings. Default false.
    12971323         * }
  • indieweb-post-kinds/trunk/includes/class-post-kind.php

    r3738687 r3810578  
    8888
    8989        /**
    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.
    9395         * @var bool
    9496         */
    … …  
    170172                );
    171173                $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                }
    172188                foreach ( $args as $property_name => $property_value ) {
    173189                        if ( 'extra' !== $property_name && property_exists( $this, $property_name ) ) {
    … …  
    177193                        }
    178194                }
     195                $this->title = isset( $this->properties['name'] );
    179196        }
    180197
  • indieweb-post-kinds/trunk/includes/register-kinds.php

    r3738687 r3810578  
    1919                'verb'            => ' ',
    2020                'property'        => '',
    21                 'properties'      => array(),
     21                'properties'      => array(
     22                        'name' => Kind_Fields::title_field(),
     23                ),
    2224                'format'          => '',
    2325                'description'     => __( 'traditional long form content: a post with an explicit title and body', 'indieweb-post-kinds' ),
    2426                'description_url' => 'http://indieweb.org/article',
    2527                'shortlink'       => 'b',
    26                 'title'           => true,
    2728                'show'            => true,
    2829        )
    … …  
    4142                'description_url' => 'http://indieweb.org/note',
    4243                'shortlink'       => 't',
    43                 'title'           => false,
    4444                'show'            => false,
    4545        )
    … …  
    5454                'property'        => 'in-reply-to',
    5555                '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' ) ),
    10757                ),
    10858                'format'          => 'link',
    … …  
    11060                'description_url' => 'http://indieweb.org/reply',
    11161                'shortlink'       => 't',
    112                 'title'           => false,
    11362                'show'            => true,
    11463        )
    … …  
    12372                'property'        => 'repost-of',
    12473                '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' ) ),
    17675                ),
    17776                'format'          => '',
    … …  
    17978                'description_url' => 'http://indieweb.org/repost',
    18079                'shortlink'       => 'b',
    181                 'title'           => true,
    18280                'show'            => true,
    18381        )
    … …  
    19290                'property'        => 'like-of',
    19391                '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' ) ),
    24593                ),
    24694                'format'          => 'link',
    … …  
    24896                'description_url' => 'http://indieweb.org/like',
    24997                'shortlink'       => 'f',
    250                 'title'           => false,
    25198                'show'            => true,
    25299        )
    … …  
    261108                'property'        => 'favorite-of',
    262109                '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' ) ),
    314111                ),
    315112                'format'          => 'link',
    … …  
    317114                'description_url' => 'http://indieweb.org/favorite',
    318115                'shortlink'       => 'f',
    319                 'title'           => false,
    320116                'show'            => true,
    321117        )
    … …  
    330126                'property'        => 'bookmark-of',
    331127                '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' ) ),
    383129                ),
    384130                'format'          => 'link',
    … …  
    386132                'description_url' => 'http://indieweb.org/bookmark',
    387133                'shortlink'       => 'h',
    388                 'title'           => false,
    389134                'show'            => true,
    390135        )
    … …  
    402147                'description_url' => 'http://indieweb.org/photo',
    403148                'shortlink'       => 'p',
    404                 'title'           => false,
    405149                'show'            => true,
    406150        )
    … …  
    418162                'description_url' => 'http://indieweb.org/video',
    419163                'shortlink'       => 'a',
    420                 'title'           => false,
    421164                'show'            => true,
    422165        )
    … …  
    434177                'description_url' => 'http://indieweb.org/audio',
    435178                'shortlink'       => 'a',
    436                 'title'           => false,
    437179                'show'            => true,
    438180        )
    … …  
    450192                'description_url' => 'http://indieweb.org/tag',
    451193                'shortlink'       => 'd',
    452                 'title'           => false,
    453194                'show'            => false,
    454195        )
    … …  
    463204                'property'        => 'in-reply-to',
    464205                '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(
    496214                                                'type'  => 'datetime',
    497215                                                'label' => __( 'Start Date', 'indieweb-post-kinds' ),
    498216                                        ),
    499                                         'end'         => array(
     217                                        'end'       => array(
    500218                                                'type'  => 'datetime',
    501219                                                'label' => __( 'End Date', 'indieweb-post-kinds' ),
    502220                                        ),
    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                                )
    518222                        ),
    519223                ),
    … …  
    522226                'description_url' => 'http://indieweb.org/rsvp',
    523227                'shortlink'       => 't',
    524                 'title'           => false,
    525228                'show'            => true,
    526229        )
    … …  
    534237                'verb'            => __( 'Listened', 'indieweb-post-kinds' ),
    535238                '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                                        )
    582250                                ),
     251                                'rating'    => Kind_Fields::rating_field(),
    583252                        ),
     253                        Kind_Fields::time_fields()
    584254                ),
    585255                'format'          => 'audio',
    … …  
    587257                'description_url' => 'http://indieweb.org/listen',
    588258                'shortlink'       => 'x',
    589                 'title'           => false,
    590259                'show'            => true,
    591260        )
    … …  
    599268                'verb'            => __( 'Watched', 'indieweb-post-kinds' ),
    600269                '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                                        )
    647281                                ),
     282                                'rating'   => Kind_Fields::rating_field(),
    648283                        ),
     284                        Kind_Fields::time_fields()
    649285                ),
    650286                'format'          => 'video',
    … …  
    652288                'description_url' => 'http://indieweb.org/watch',
    653289                'shortlink'       => 'x',
    654                 'title'           => false,
    655290                'show'            => true,
    656291        )
    … …  
    664299                'verb'            => __( 'Checked into', 'indieweb-post-kinds' ),
    665300                'property'        => 'checkin',
     301                // A place reference, like a citation. Location details are left to Simple Location when it's active (#553).
    666302                'properties'      => array(
    667303                        'checkin' => array(
    668304                                'type'       => 'venue',
    669305                                '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' ) ),
    716308                        ),
    717309                ),
    … …  
    720312                'description_url' => 'http://indieweb.org/checkin',
    721313                'shortlink'       => 'g',
    722                 'title'           => false,
    723314                'show'            => true,
    724315        )
    … …  
    736327                'description_url' => '',
    737328                'shortlink'       => 'f',
    738                 'title'           => false,
    739329                'show'            => false,
    740330        )
    … …  
    748338                'verb'            => __( 'Played', 'indieweb-post-kinds' ),
    749339                '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                ),
    750347                'format'          => 'status',
    751348                'description'     => __( 'playing a game', 'indieweb-post-kinds' ),
    752349                'description_url' => 'https://indieweb.org/game_play',
    753350                'shortlink'       => 'x',
    754                 'title'           => false,
    755351                'show'            => true,
    756352        )
    … …  
    768364                'description_url' => 'https://indieweb.org/weather',
    769365                'shortlink'       => 'u',
    770                 'title'           => false,
    771366                'show'            => false,
    772367        )
    … …  
    784379                'description_url' => 'https://indieweb.org/exercise',
    785380                'shortlink'       => 'm',
    786                 'title'           => false,
    787381                'show'            => false,
    788382        )
    … …  
    800394                'description_url' => 'https://indieweb.org/trip',
    801395                'shortlink'       => 'e',
    802                 'title'           => false,
    803396                'show'            => false,
    804397        )
    … …  
    816409                'description_url' => 'https://indieweb.org/trip',
    817410                'shortlink'       => 'e',
    818                 'title'           => false,
    819411                'show'            => false,
    820412        )
    … …  
    829421                'verb'            => __( 'Ate', 'indieweb-post-kinds' ),
    830422                'property'        => 'ate',
     423                'properties'      => array(
     424                        'ate'    => Kind_Fields::cite_field( __( 'Ate', 'indieweb-post-kinds' ) ),
     425                        'rating' => Kind_Fields::rating_field(),
     426                ),
    831427                'format'          => 'status',
    832428                'description'     => __( 'what you are eating, perhaps for a food diary', 'indieweb-post-kinds' ),
    833429                'description_url' => 'https://indieweb.org/food',
    834430                'shortlink'       => 'u',
    835                 'title'           => false,
    836431                'show'            => true,
    837432        )
    … …  
    846441                'verb'            => __( 'Drank', 'indieweb-post-kinds' ),
    847442                'property'        => 'drank',
     443                'properties'      => array(
     444                        'drank'  => Kind_Fields::cite_field( __( 'Drank', 'indieweb-post-kinds' ) ),
     445                        'rating' => Kind_Fields::rating_field(),
     446                ),
    848447                'format'          => 'status',
    849448                'description'     => __( 'what you are drinking, perhaps for a food dairy', 'indieweb-post-kinds' ),
    850449                'description_url' => 'https://indieweb.org/food',
    851450                'shortlink'       => 'u',
    852                 'title'           => false,
    853451                'show'            => true,
    854452        )
    … …  
    867465                'description_url' => 'https://indieweb.org/follow',
    868466                'shortlink'       => 'f',
    869                 'title'           => false,
    870467                'show'            => false,
    871468        )
    … …  
    880477                'verb'            => __( 'Listened to', 'indieweb-post-kinds' ),
    881478                '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                ),
    882495                'format'          => 'audio',
    883496                'description'     => __( 'a particularly personally meaningful song (a listen with added emphasis)', 'indieweb-post-kinds' ),
    884497                'description_url' => 'https://indieweb.org/jam',
    885498                'shortlink'       => 'f',
    886                 'title'           => false,
    887499                'show'            => true,
    888500        )
    … …  
    897509                'verb'            => __( 'Read', 'indieweb-post-kinds' ),
    898510                '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                ),
    899519                'format'          => 'status',
    900520                'description'     => __( 'reading a book, magazine, newspaper, other physical document, or online post', 'indieweb-post-kinds' ),
    901521                'description_url' => 'https://indieweb.org/read',
    902522                'shortlink'       => 'x',
    903                 'title'           => false,
    904523                'show'            => true,
    905524        )
    … …  
    914533                'verb'            => __( 'Quoted', 'indieweb-post-kinds' ),
    915534                'property'        => 'quotation-of',
     535                'properties'      => array(
     536                        'quotation-of' => Kind_Fields::cite_field( __( 'Quoted', 'indieweb-post-kinds' ) ),
     537                ),
    916538                'format'          => 'quote',
    917539                'description'     => __( 'quoted content', 'indieweb-post-kinds' ),
    918540                'description_url' => 'https://indieweb.org/quote',
    919541                'shortlink'       => 't',
    920                 'title'           => false,
    921542                'show'            => true,
    922543        )
    … …  
    935556                'description_url' => 'https://indieweb.org/mood',
    936557                'shortlink'       => 't',
    937                 'title'           => false,
    938558                'show'            => false,
    939559        )
    … …  
    948568                'verb'            => __( 'Cooked', 'indieweb-post-kinds' ),
    949569                'property'        => 'recipe',
     570                'properties'      => array(
     571                        'name' => Kind_Fields::title_field(),
     572                ),
    950573                'format'          => '',
    951574                'description'     => __( 'list of ingredients and directions for making food or drink', 'indieweb-post-kinds' ),
    952575                'description_url' => 'https://indieweb.org/recipe',
    953576                'shortlink'       => 'b',
    954                 'title'           => true,
    955577                'show'            => false,
    956578        )
    … …  
    965587                'verb'            => __( 'Filed an Issue', 'indieweb-post-kinds' ),
    966588                '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                ),
    967593                'format'          => '',
    968594                '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' ),
    969595                'description_url' => 'https://indieweb.org/issue',
    970596                'shortlink'       => 't',
    971                 'title'           => true,
    972597                'show'            => true,
    973598        )
    … …  
    986611                'description_url' => 'https://indieweb.org/question',
    987612                'shortlink'       => 'q',
    988                 'title'           => false,
    989613                'show'            => false,
    990614        )
    … …  
    1003627                'description_url' => 'https://indieweb.org/sleep',
    1004628                'shortlink'       => 'm',
    1005                 'title'           => false,
    1006629                'show'            => false,
    1007630        )
    … …  
    1016639                'verb'            => __( 'Planned', 'indieweb-post-kinds' ),
    1017640                'property'        => 'event',
     641                'properties'      => array(
     642                        'name' => Kind_Fields::title_field(),
     643                ),
    1018644                'format'          => '',
    1019645                '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' ),
    1020646                'description_url' => 'https://indieweb.org/event',
    1021647                'shortlink'       => 'e',
    1022                 'title'           => true,
    1023648                'show'            => false,
    1024649        )
    … …  
    1032657                'verb'            => __( 'Reviewed', 'indieweb-post-kinds' ),
    1033658                'property'        => 'review-of',
     659                'properties'      => array(
     660                        'review-of' => Kind_Fields::cite_field( __( 'Reviewed', 'indieweb-post-kinds' ) ),
     661                        'rating'    => Kind_Fields::rating_field(),
     662                ),
    1034663                'format'          => '',
    1035664                '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' ),
    1036665                'description_url' => 'https://indieweb.org/review',
    1037666                'shortlink'       => 't',
    1038                 'title'           => false,
    1039667                'show'            => true,
    1040668        )
    … …  
    1053681                'description_url' => 'http://indieweb.org/acquisition',
    1054682                'shortlink'       => 'f',
    1055                 'title'           => false,
    1056683                'show'            => false,
    1057684        )
    … …  
    1065692                'verb'            => __( 'Crafted', 'indieweb-post-kinds' ),
    1066693                'property'        => 'craft-of',
     694                'properties'      => array(
     695                        'craft-of' => Kind_Fields::cite_field( __( 'Crafted', 'indieweb-post-kinds' ) ),
     696                ),
    1067697                'format'          => 'status',
    1068698                'description'     => __( 'Activities like knitting, crocheting, cross stitch, wood working, restoration, 3d printing...the activity of building something.', 'indieweb-post-kinds' ),
    1069699                'description_url' => 'https://indieweb.org/crafts',
    1070700                '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  
    123123if ( ! function_exists( 'tz_timezone_to_seconds' ) ) {
    124124        /**
    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.
    126129         *
    127130         * @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'.
    130134         * @return int|false Offset in seconds, or false if the time zone is not valid.
    131135         */
    132136        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 ) );
    138146        }
    139147}
  • indieweb-post-kinds/trunk/indieweb-post-kinds.php

    r3771941 r3810578  
    88 * Plugin URI: https://wordpress.org/plugins/indieweb-post-kinds/
    99 * 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.1
     10 * Version: 4.0.2
    1111 * Requires at least: 6.2
    1212 * Requires PHP: 7.4
  • indieweb-post-kinds/trunk/languages/indieweb-post-kinds.pot

    r3771941 r3810578  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Post Kinds 4.0.1\n"
     5"Project-Id-Version: Post Kinds 4.0.2\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/indieweb-post-kinds\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-10-29T01:48:12+00:00\n"
     12"POT-Creation-Date: 2026-11-19T03:09:43+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    147147msgstr ""
    148148
    149 #: includes/class-kind-fields.php:39
     149#: includes/class-kind-fields.php:49
    150150msgid "(GMT-11:00) Niue"
    151151msgstr ""
    152152
    153 #: includes/class-kind-fields.php:40
     153#: includes/class-kind-fields.php:50
    154154msgid "(GMT-11:00) Pago Pago"
    155155msgstr ""
    156156
    157 #: includes/class-kind-fields.php:41
     157#: includes/class-kind-fields.php:51
    158158msgid "(GMT-10:00) Hawaii Time"
    159159msgstr ""
    160160
    161 #: includes/class-kind-fields.php:42
     161#: includes/class-kind-fields.php:52
    162162msgid "(GMT-10:00) Rarotonga"
    163163msgstr ""
    164164
    165 #: includes/class-kind-fields.php:43
     165#: includes/class-kind-fields.php:53
    166166msgid "(GMT-10:00) Tahiti"
    167167msgstr ""
    168168
    169 #: includes/class-kind-fields.php:44
     169#: includes/class-kind-fields.php:54
    170170msgid "(GMT-09:30) Marquesas"
    171171msgstr ""
    172172
    173 #: includes/class-kind-fields.php:45
     173#: includes/class-kind-fields.php:55
    174174msgid "(GMT-09:00) Alaska Time"
    175175msgstr ""
    176176
    177 #: includes/class-kind-fields.php:46
     177#: includes/class-kind-fields.php:56
    178178msgid "(GMT-09:00) Gambier"
    179179msgstr ""
    180180
    181 #: includes/class-kind-fields.php:47
     181#: includes/class-kind-fields.php:57
    182182msgid "(GMT-08:00) Pacific Time"
    183183msgstr ""
    184184
    185 #: includes/class-kind-fields.php:48
     185#: includes/class-kind-fields.php:58
    186186msgid "(GMT-08:00) Pacific Time - Tijuana"
    187187msgstr ""
    188188
    189 #: includes/class-kind-fields.php:49
     189#: includes/class-kind-fields.php:59
    190190msgid "(GMT-08:00) Pacific Time - Vancouver"
    191191msgstr ""
    192192
    193 #: includes/class-kind-fields.php:50
     193#: includes/class-kind-fields.php:60
    194194msgid "(GMT-08:00) Pacific Time - Whitehorse"
    195195msgstr ""
    196196
    197 #: includes/class-kind-fields.php:51
     197#: includes/class-kind-fields.php:61
    198198msgid "(GMT-08:00) Pitcairn"
    199199msgstr ""
    200200
    201 #: includes/class-kind-fields.php:52
     201#: includes/class-kind-fields.php:62
    202202msgid "(GMT-07:00) Mountain Time - Dawson Creek"
    203203msgstr ""
    204204
    205 #: includes/class-kind-fields.php:53
     205#: includes/class-kind-fields.php:63
    206206msgid "(GMT-07:00) Mountain Time"
    207207msgstr ""
    208208
    209 #: includes/class-kind-fields.php:54
     209#: includes/class-kind-fields.php:64
    210210msgid "(GMT-07:00) Mountain Time - Edmonton"
    211211msgstr ""
    212212
    213 #: includes/class-kind-fields.php:55
     213#: includes/class-kind-fields.php:65
    214214msgid "(GMT-07:00) Mountain Time - Hermosillo"
    215215msgstr ""
    216216
    217 #: includes/class-kind-fields.php:56
     217#: includes/class-kind-fields.php:66
    218218msgid "(GMT-07:00) Mountain Time - Chihuahua, Mazatlan"
    219219msgstr ""
    220220
    221 #: includes/class-kind-fields.php:57
     221#: includes/class-kind-fields.php:67
    222222msgid "(GMT-07:00) Mountain Time - Arizona"
    223223msgstr ""
    224224
    225 #: includes/class-kind-fields.php:58
     225#: includes/class-kind-fields.php:68
    226226msgid "(GMT-07:00) Mountain Time - Yellowknife"
    227227msgstr ""
    228228
    229 #: includes/class-kind-fields.php:59
     229#: includes/class-kind-fields.php:69
    230230msgid "(GMT-06:00) Belize"
    231231msgstr ""
    232232
    233 #: includes/class-kind-fields.php:60
     233#: includes/class-kind-fields.php:70
    234234msgid "(GMT-06:00) Central Time"
    235235msgstr ""
    236236
    237 #: includes/class-kind-fields.php:61
     237#: includes/class-kind-fields.php:71
    238238msgid "(GMT-06:00) Costa Rica"
    239239msgstr ""
    240240
    241 #: includes/class-kind-fields.php:62
     241#: includes/class-kind-fields.php:72
    242242msgid "(GMT-06:00) El Salvador"
    243243msgstr ""
    244244
    245 #: includes/class-kind-fields.php:63
     245#: includes/class-kind-fields.php:73
    246246msgid "(GMT-06:00) Guatemala"
    247247msgstr ""
    248248
    249 #: includes/class-kind-fields.php:64
     249#: includes/class-kind-fields.php:74
    250250msgid "(GMT-06:00) Managua"
    251251msgstr ""
    252252
    253 #: includes/class-kind-fields.php:65
     253#: includes/class-kind-fields.php:75
    254254msgid "(GMT-06:00) Central Time - Mexico City"
    255255msgstr ""
    256256
    257 #: includes/class-kind-fields.php:66
     257#: includes/class-kind-fields.php:76
    258258msgid "(GMT-06:00) Central Time - Regina"
    259259msgstr ""
    260260
    261 #: includes/class-kind-fields.php:67
     261#: includes/class-kind-fields.php:77
    262262msgid "(GMT-06:00) Central Time - Tegucigalpa"
    263263msgstr ""
    264264
    265 #: includes/class-kind-fields.php:68
     265#: includes/class-kind-fields.php:78
    266266msgid "(GMT-06:00) Central Time - Winnipeg"
    267267msgstr ""
    268268
    269 #: includes/class-kind-fields.php:69
     269#: includes/class-kind-fields.php:79
    270270msgid "(GMT-06:00) Galapagos"
    271271msgstr ""
    272272
    273 #: includes/class-kind-fields.php:70
     273#: includes/class-kind-fields.php:80
    274274msgid "(GMT-05:00) Bogota"
    275275msgstr ""
    276276
    277 #: includes/class-kind-fields.php:71
     277#: includes/class-kind-fields.php:81
    278278msgid "(GMT-05:00) America Cancun"
    279279msgstr ""
    280280
    281 #: includes/class-kind-fields.php:72
     281#: includes/class-kind-fields.php:82
    282282msgid "(GMT-05:00) Cayman"
    283283msgstr ""
    284284
    285 #: includes/class-kind-fields.php:73
     285#: includes/class-kind-fields.php:83
    286286msgid "(GMT-05:00) Guayaquil"
    287287msgstr ""
    288288
    289 #: includes/class-kind-fields.php:74
     289#: includes/class-kind-fields.php:84
    290290msgid "(GMT-05:00) Havana"
    291291msgstr ""
    292292
    293 #: includes/class-kind-fields.php:75
     293#: includes/class-kind-fields.php:85
    294294msgid "(GMT-05:00) Eastern Time - Iqaluit"
    295295msgstr ""
    296296
    297 #: includes/class-kind-fields.php:76
     297#: includes/class-kind-fields.php:86
    298298msgid "(GMT-05:00) Jamaica"
    299299msgstr ""
    300300
    301 #: includes/class-kind-fields.php:77
     301#: includes/class-kind-fields.php:87
    302302msgid "(GMT-05:00) Lima"
    303303msgstr ""
    304304
    305 #: includes/class-kind-fields.php:78
     305#: includes/class-kind-fields.php:88
    306306msgid "(GMT-05:00) Nassau"
    307307msgstr ""
    308308
    309 #: includes/class-kind-fields.php:79
     309#: includes/class-kind-fields.php:89
    310310msgid "(GMT-05:00) Eastern Time"
    311311msgstr ""
    312312
    313 #: includes/class-kind-fields.php:80
     313#: includes/class-kind-fields.php:90
    314314msgid "(GMT-05:00) Panama"
    315315msgstr ""
    316316
    317 #: includes/class-kind-fields.php:81
     317#: includes/class-kind-fields.php:91
    318318msgid "(GMT-05:00) Port-au-Prince"
    319319msgstr ""
    320320
    321 #: includes/class-kind-fields.php:82
     321#: includes/class-kind-fields.php:92
    322322msgid "(GMT-05:00) Rio Branco"
    323323msgstr ""
    324324
    325 #: includes/class-kind-fields.php:83
     325#: includes/class-kind-fields.php:93
    326326msgid "(GMT-05:00) Eastern Time - Toronto"
    327327msgstr ""
    328328
    329 #: includes/class-kind-fields.php:84
     329#: includes/class-kind-fields.php:94
    330330msgid "(GMT-05:00) Easter Island"
    331331msgstr ""
    332332
    333 #: includes/class-kind-fields.php:85
     333#: includes/class-kind-fields.php:95
    334334msgid "(GMT-04:30) Caracas"
    335335msgstr ""
    336336
    337 #: includes/class-kind-fields.php:86
     337#: includes/class-kind-fields.php:96
    338338msgid "(GMT-03:00) Asuncion"
    339339msgstr ""
    340340
    341 #: includes/class-kind-fields.php:87
     341#: includes/class-kind-fields.php:97
    342342msgid "(GMT-04:00) Barbados"
    343343msgstr ""
    344344
    345 #: includes/class-kind-fields.php:88
     345#: includes/class-kind-fields.php:98
    346346msgid "(GMT-04:00) Boa Vista"
    347347msgstr ""
    348348
    349 #: includes/class-kind-fields.php:89
     349#: includes/class-kind-fields.php:99
    350350msgid "(GMT-03:00) Campo Grande"
    351351msgstr ""
    352352
    353 #: includes/class-kind-fields.php:90
     353#: includes/class-kind-fields.php:100
    354354msgid "(GMT-03:00) Cuiaba"
    355355msgstr ""
    356356
    357 #: includes/class-kind-fields.php:91
     357#: includes/class-kind-fields.php:101
    358358msgid "(GMT-04:00) Curacao"
    359359msgstr ""
    360360
    361 #: includes/class-kind-fields.php:92
     361#: includes/class-kind-fields.php:102
    362362msgid "(GMT-04:00) Grand Turk"
    363363msgstr ""
    364364
    365 #: includes/class-kind-fields.php:93
     365#: includes/class-kind-fields.php:103
    366366msgid "(GMT-04:00) Guyana"
    367367msgstr ""
    368368
    369 #: includes/class-kind-fields.php:94
     369#: includes/class-kind-fields.php:104
    370370msgid "(GMT-04:00) Atlantic Time - Halifax"
    371371msgstr ""
    372372
    373 #: includes/class-kind-fields.php:95
     373#: includes/class-kind-fields.php:105
    374374msgid "(GMT-04:00) La Paz"
    375375msgstr ""
    376376
    377 #: includes/class-kind-fields.php:96
     377#: includes/class-kind-fields.php:106
    378378msgid "(GMT-04:00) Manaus"
    379379msgstr ""
    380380
    381 #: includes/class-kind-fields.php:97
     381#: includes/class-kind-fields.php:107
    382382msgid "(GMT-04:00) Martinique"
    383383msgstr ""
    384384
    385 #: includes/class-kind-fields.php:98
     385#: includes/class-kind-fields.php:108
    386386msgid "(GMT-04:00) Port of Spain"
    387387msgstr ""
    388388
    389 #: includes/class-kind-fields.php:99
     389#: includes/class-kind-fields.php:109
    390390msgid "(GMT-04:00) Porto Velho"
    391391msgstr ""
    392392
    393 #: includes/class-kind-fields.php:100
     393#: includes/class-kind-fields.php:110
    394394msgid "(GMT-04:00) Puerto Rico"
    395395msgstr ""
    396396
    397 #: includes/class-kind-fields.php:101
     397#: includes/class-kind-fields.php:111
    398398msgid "(GMT-04:00) Santo Domingo"
    399399msgstr ""
    400400
    401 #: includes/class-kind-fields.php:102
     401#: includes/class-kind-fields.php:112
    402402msgid "(GMT-04:00) Thule"
    403403msgstr ""
    404404
    405 #: includes/class-kind-fields.php:103
     405#: includes/class-kind-fields.php:113
    406406msgid "(GMT-04:00) Bermuda"
    407407msgstr ""
    408408
    409 #: includes/class-kind-fields.php:104
     409#: includes/class-kind-fields.php:114
    410410msgid "(GMT-03:30) Newfoundland Time - St. Johns"
    411411msgstr ""
    412412
    413 #: includes/class-kind-fields.php:105
     413#: includes/class-kind-fields.php:115
    414414msgid "(GMT-03:00) Araguaina"
    415415msgstr ""
    416416
    417 #: includes/class-kind-fields.php:106
     417#: includes/class-kind-fields.php:116
    418418msgid "(GMT-03:00) Buenos Aires"
    419419msgstr ""
    420420
    421 #: includes/class-kind-fields.php:107
     421#: includes/class-kind-fields.php:117
    422422msgid "(GMT-03:00) Salvador"
    423423msgstr ""
    424424
    425 #: includes/class-kind-fields.php:108
     425#: includes/class-kind-fields.php:118
    426426msgid "(GMT-03:00) Belem"
    427427msgstr ""
    428428
    429 #: includes/class-kind-fields.php:109
     429#: includes/class-kind-fields.php:119
    430430msgid "(GMT-03:00) Cayenne"
    431431msgstr ""
    432432
    433 #: includes/class-kind-fields.php:110
     433#: includes/class-kind-fields.php:120
    434434msgid "(GMT-03:00) Fortaleza"
    435435msgstr ""
    436436
    437 #: includes/class-kind-fields.php:111
    438 msgid "(GMT-03:00) Godthab"
    439 msgstr ""
    440 
    441 #: includes/class-kind-fields.php:112
     437#: includes/class-kind-fields.php:121
     438msgid "(GMT-02:00) Nuuk"
     439msgstr ""
     440
     441#: includes/class-kind-fields.php:122
    442442msgid "(GMT-03:00) Maceio"
    443443msgstr ""
    444444
    445 #: includes/class-kind-fields.php:113
     445#: includes/class-kind-fields.php:123
    446446msgid "(GMT-03:00) Miquelon"
    447447msgstr ""
    448448
    449 #: includes/class-kind-fields.php:114
     449#: includes/class-kind-fields.php:124
    450450msgid "(GMT-03:00) Montevideo"
    451451msgstr ""
    452452
    453 #: includes/class-kind-fields.php:115
     453#: includes/class-kind-fields.php:125
    454454msgid "(GMT-03:00) Paramaribo"
    455455msgstr ""
    456456
    457 #: includes/class-kind-fields.php:116
     457#: includes/class-kind-fields.php:126
    458458msgid "(GMT-03:00) Recife"
    459459msgstr ""
    460460
    461 #: includes/class-kind-fields.php:117
     461#: includes/class-kind-fields.php:127
    462462msgid "(GMT-03:00) Santiago"
    463463msgstr ""
    464464
    465 #: includes/class-kind-fields.php:118
     465#: includes/class-kind-fields.php:128
    466466msgid "(GMT-02:00) Sao Paulo"
    467467msgstr ""
    468468
    469 #: includes/class-kind-fields.php:119
     469#: includes/class-kind-fields.php:129
    470470msgid "(GMT-03:00) Palmer"
    471471msgstr ""
    472472
    473 #: includes/class-kind-fields.php:120
     473#: includes/class-kind-fields.php:130
    474474msgid "(GMT-03:00) Rothera"
    475475msgstr ""
    476476
    477 #: includes/class-kind-fields.php:121
     477#: includes/class-kind-fields.php:131
    478478msgid "(GMT-03:00) Stanley"
    479479msgstr ""
    480480
    481 #: includes/class-kind-fields.php:122
     481#: includes/class-kind-fields.php:132
    482482msgid "(GMT-02:00) Noronha"
    483483msgstr ""
    484484
    485 #: includes/class-kind-fields.php:123
     485#: includes/class-kind-fields.php:133
    486486msgid "(GMT-02:00) South Georgia"
    487487msgstr ""
    488488
    489 #: includes/class-kind-fields.php:124
     489#: includes/class-kind-fields.php:134
    490490msgid "(GMT-01:00) Scoresbysund"
    491491msgstr ""
    492492
    493 #: includes/class-kind-fields.php:125
     493#: includes/class-kind-fields.php:135
    494494msgid "(GMT-01:00) Azores"
    495495msgstr ""
    496496
    497 #: includes/class-kind-fields.php:126
     497#: includes/class-kind-fields.php:136
    498498msgid "(GMT-01:00) Cape Verde"
    499499msgstr ""
    500500
    501 #: includes/class-kind-fields.php:127
     501#: includes/class-kind-fields.php:137
    502502msgid "(GMT+00:00) Abidjan"
    503503msgstr ""
    504504
    505 #: includes/class-kind-fields.php:128
     505#: includes/class-kind-fields.php:138
    506506msgid "(GMT+00:00) Accra"
    507507msgstr ""
    508508
    509 #: includes/class-kind-fields.php:129
     509#: includes/class-kind-fields.php:139
    510510msgid "(GMT+00:00) Bissau"
    511511msgstr ""
    512512
    513 #: includes/class-kind-fields.php:130
     513#: includes/class-kind-fields.php:140
    514514msgid "(GMT+00:00) Casablanca"
    515515msgstr ""
    516516
    517 #: includes/class-kind-fields.php:131
     517#: includes/class-kind-fields.php:141
    518518msgid "(GMT+00:00) El Aaiun"
    519519msgstr ""
    520520
    521 #: includes/class-kind-fields.php:132
     521#: includes/class-kind-fields.php:142
    522522msgid "(GMT+00:00) Monrovia"
    523523msgstr ""
    524524
    525 #: includes/class-kind-fields.php:133
     525#: includes/class-kind-fields.php:143
    526526msgid "(GMT+00:00) Danmarkshavn"
    527527msgstr ""
    528528
    529 #: includes/class-kind-fields.php:134
     529#: includes/class-kind-fields.php:144
    530530msgid "(GMT+00:00) Canary Islands"
    531531msgstr ""
    532532
    533 #: includes/class-kind-fields.php:135
     533#: includes/class-kind-fields.php:145
    534534msgid "(GMT+00:00) Faeroe"
    535535msgstr ""
    536536
    537 #: includes/class-kind-fields.php:136
     537#: includes/class-kind-fields.php:146
    538538msgid "(GMT+00:00) Reykjavik"
    539539msgstr ""
    540540
    541 #: includes/class-kind-fields.php:137
     541#: includes/class-kind-fields.php:147
    542542msgid "(GMT+00:00) GMT (no daylight saving)"
    543543msgstr ""
    544544
    545 #: includes/class-kind-fields.php:138
     545#: includes/class-kind-fields.php:148
    546546msgid "(GMT+00:00) Dublin"
    547547msgstr ""
    548548
    549 #: includes/class-kind-fields.php:139
     549#: includes/class-kind-fields.php:149
    550550msgid "(GMT+00:00) Lisbon"
    551551msgstr ""
    552552
    553 #: includes/class-kind-fields.php:140
     553#: includes/class-kind-fields.php:150
    554554msgid "(GMT+00:00) London"
    555555msgstr ""
    556556
    557 #: includes/class-kind-fields.php:141
     557#: includes/class-kind-fields.php:151
    558558msgid "(GMT+01:00) Algiers"
    559559msgstr ""
    560560
    561 #: includes/class-kind-fields.php:142
     561#: includes/class-kind-fields.php:152
    562562msgid "(GMT+01:00) Ceuta"
    563563msgstr ""
    564564
    565 #: includes/class-kind-fields.php:143
     565#: includes/class-kind-fields.php:153
    566566msgid "(GMT+01:00) Lagos"
    567567msgstr ""
    568568
    569 #: includes/class-kind-fields.php:144
     569#: includes/class-kind-fields.php:154
    570570msgid "(GMT+01:00) Ndjamena"
    571571msgstr ""
    572572
    573 #: includes/class-kind-fields.php:145
     573#: includes/class-kind-fields.php:155
    574574msgid "(GMT+01:00) Tunis"
    575575msgstr ""
    576576
    577 #: includes/class-kind-fields.php:146
     577#: includes/class-kind-fields.php:156
    578578msgid "(GMT+02:00) Windhoek"
    579579msgstr ""
    580580
    581 #: includes/class-kind-fields.php:147
     581#: includes/class-kind-fields.php:157
    582582msgid "(GMT+01:00) Amsterdam"
    583583msgstr ""
    584584
    585 #: includes/class-kind-fields.php:148
     585#: includes/class-kind-fields.php:158
    586586msgid "(GMT+01:00) Andorra"
    587587msgstr ""
    588588
    589 #: includes/class-kind-fields.php:149
     589#: includes/class-kind-fields.php:159
    590590msgid "(GMT+01:00) Central European Time - Belgrade"
    591591msgstr ""
    592592
    593 #: includes/class-kind-fields.php:150
     593#: includes/class-kind-fields.php:160
    594594msgid "(GMT+01:00) Berlin"
    595595msgstr ""
    596596
    597 #: includes/class-kind-fields.php:151
     597#: includes/class-kind-fields.php:161
    598598msgid "(GMT+01:00) Brussels"
    599599msgstr ""
    600600
    601 #: includes/class-kind-fields.php:152
     601#: includes/class-kind-fields.php:162
    602602msgid "(GMT+01:00) Budapest"
    603603msgstr ""
    604604
    605 #: includes/class-kind-fields.php:153
     605#: includes/class-kind-fields.php:163
    606606msgid "(GMT+01:00) Copenhagen"
    607607msgstr ""
    608608
    609 #: includes/class-kind-fields.php:154
     609#: includes/class-kind-fields.php:164
    610610msgid "(GMT+01:00) Gibraltar"
    611611msgstr ""
    612612
    613 #: includes/class-kind-fields.php:155
     613#: includes/class-kind-fields.php:165
    614614msgid "(GMT+01:00) Luxembourg"
    615615msgstr ""
    616616
    617 #: includes/class-kind-fields.php:156
     617#: includes/class-kind-fields.php:166
    618618msgid "(GMT+01:00) Madrid"
    619619msgstr ""
    620620
    621 #: includes/class-kind-fields.php:157
     621#: includes/class-kind-fields.php:167
    622622msgid "(GMT+01:00) Malta"
    623623msgstr ""
    624624
    625 #: includes/class-kind-fields.php:158
     625#: includes/class-kind-fields.php:168
    626626msgid "(GMT+01:00) Monaco"
    627627msgstr ""
    628628
    629 #: includes/class-kind-fields.php:159
     629#: includes/class-kind-fields.php:169
    630630msgid "(GMT+01:00) Oslo"
    631631msgstr ""
    632632
    633 #: includes/class-kind-fields.php:160
     633#: includes/class-kind-fields.php:170
    634634msgid "(GMT+01:00) Paris"
    635635msgstr ""
    636636
    637 #: includes/class-kind-fields.php:161
     637#: includes/class-kind-fields.php:171
    638638msgid "(GMT+01:00) Central European Time - Prague"
    639639msgstr ""
    640640
    641 #: includes/class-kind-fields.php:162
     641#: includes/class-kind-fields.php:172
    642642msgid "(GMT+01:00) Rome"
    643643msgstr ""
    644644
    645 #: includes/class-kind-fields.php:163
     645#: includes/class-kind-fields.php:173
    646646msgid "(GMT+01:00) Stockholm"
    647647msgstr ""
    648648
    649 #: includes/class-kind-fields.php:164
     649#: includes/class-kind-fields.php:174
    650650msgid "(GMT+01:00) Tirane"
    651651msgstr ""
    652652
    653 #: includes/class-kind-fields.php:165
     653#: includes/class-kind-fields.php:175
    654654msgid "(GMT+01:00) Vienna"
    655655msgstr ""
    656656
    657 #: includes/class-kind-fields.php:166
     657#: includes/class-kind-fields.php:176
    658658msgid "(GMT+01:00) Warsaw"
    659659msgstr ""
    660660
    661 #: includes/class-kind-fields.php:167
     661#: includes/class-kind-fields.php:177
    662662msgid "(GMT+01:00) Zurich"
    663663msgstr ""
    664664
    665 #: includes/class-kind-fields.php:168
     665#: includes/class-kind-fields.php:178
    666666msgid "(GMT+02:00) Cairo"
    667667msgstr ""
    668668
    669 #: includes/class-kind-fields.php:169
     669#: includes/class-kind-fields.php:179
    670670msgid "(GMT+02:00) Johannesburg"
    671671msgstr ""
    672672
    673 #: includes/class-kind-fields.php:170
     673#: includes/class-kind-fields.php:180
    674674msgid "(GMT+02:00) Maputo"
    675675msgstr ""
    676676
    677 #: includes/class-kind-fields.php:171
     677#: includes/class-kind-fields.php:181
    678678msgid "(GMT+02:00) Tripoli"
    679679msgstr ""
    680680
    681 #: includes/class-kind-fields.php:172
     681#: includes/class-kind-fields.php:182
    682682msgid "(GMT+02:00) Amman"
    683683msgstr ""
    684684
    685 #: includes/class-kind-fields.php:173
     685#: includes/class-kind-fields.php:183
    686686msgid "(GMT+02:00) Beirut"
    687687msgstr ""
    688688
    689 #: includes/class-kind-fields.php:174
     689#: includes/class-kind-fields.php:184
    690690msgid "(GMT+02:00) Damascus"
    691691msgstr ""
    692692
    693 #: includes/class-kind-fields.php:175
     693#: includes/class-kind-fields.php:185
    694694msgid "(GMT+02:00) Gaza"
    695695msgstr ""
    696696
    697 #: includes/class-kind-fields.php:176
     697#: includes/class-kind-fields.php:186
    698698msgid "(GMT+02:00) Jerusalem"
    699699msgstr ""
    700700
    701 #: includes/class-kind-fields.php:177
     701#: includes/class-kind-fields.php:187
    702702msgid "(GMT+02:00) Nicosia"
    703703msgstr ""
    704704
    705 #: includes/class-kind-fields.php:178
     705#: includes/class-kind-fields.php:188
    706706msgid "(GMT+02:00) Athens"
    707707msgstr ""
    708708
    709 #: includes/class-kind-fields.php:179
     709#: includes/class-kind-fields.php:189
    710710msgid "(GMT+02:00) Bucharest"
    711711msgstr ""
    712712
    713 #: includes/class-kind-fields.php:180
     713#: includes/class-kind-fields.php:190
    714714msgid "(GMT+02:00) Chisinau"
    715715msgstr ""
    716716
    717 #: includes/class-kind-fields.php:181
     717#: includes/class-kind-fields.php:191
    718718msgid "(GMT+02:00) Helsinki"
    719719msgstr ""
    720720
    721 #: includes/class-kind-fields.php:182
     721#: includes/class-kind-fields.php:192
    722722msgid "(GMT+02:00) Istanbul"
    723723msgstr ""
    724724
    725 #: includes/class-kind-fields.php:183
     725#: includes/class-kind-fields.php:193
    726726msgid "(GMT+02:00) Moscow-01 - Kaliningrad"
    727727msgstr ""
    728728
    729 #: includes/class-kind-fields.php:184
    730 msgid "(GMT+02:00) Kiev"
    731 msgstr ""
    732 
    733 #: includes/class-kind-fields.php:185
     729#: includes/class-kind-fields.php:194
     730msgid "(GMT+02:00) Kyiv"
     731msgstr ""
     732
     733#: includes/class-kind-fields.php:195
    734734msgid "(GMT+02:00) Riga"
    735735msgstr ""
    736736
    737 #: includes/class-kind-fields.php:186
     737#: includes/class-kind-fields.php:196
    738738msgid "(GMT+02:00) Sofia"
    739739msgstr ""
    740740
    741 #: includes/class-kind-fields.php:187
     741#: includes/class-kind-fields.php:197
    742742msgid "(GMT+02:00) Tallinn"
    743743msgstr ""
    744744
    745 #: includes/class-kind-fields.php:188
     745#: includes/class-kind-fields.php:198
    746746msgid "(GMT+02:00) Vilnius"
    747747msgstr ""
    748748
    749 #: includes/class-kind-fields.php:189
     749#: includes/class-kind-fields.php:199
    750750msgid "(GMT+03:00) Khartoum"
    751751msgstr ""
    752752
    753 #: includes/class-kind-fields.php:190
     753#: includes/class-kind-fields.php:200
    754754msgid "(GMT+03:00) Nairobi"
    755755msgstr ""
    756756
    757 #: includes/class-kind-fields.php:191
     757#: includes/class-kind-fields.php:201
    758758msgid "(GMT+03:00) Syowa"
    759759msgstr ""
    760760
    761 #: includes/class-kind-fields.php:192
     761#: includes/class-kind-fields.php:202
    762762msgid "(GMT+03:00) Baghdad"
    763763msgstr ""
    764764
    765 #: includes/class-kind-fields.php:193
     765#: includes/class-kind-fields.php:203
    766766msgid "(GMT+03:00) Qatar"
    767767msgstr ""
    768768
    769 #: includes/class-kind-fields.php:194
     769#: includes/class-kind-fields.php:204
    770770msgid "(GMT+03:00) Riyadh"
    771771msgstr ""
    772772
    773 #: includes/class-kind-fields.php:195
     773#: includes/class-kind-fields.php:205
    774774msgid "(GMT+03:00) Minsk"
    775775msgstr ""
    776776
    777 #: includes/class-kind-fields.php:196
     777#: includes/class-kind-fields.php:206
    778778msgid "(GMT+03:00) Moscow+00 - Moscow"
    779779msgstr ""
    780780
    781 #: includes/class-kind-fields.php:197
     781#: includes/class-kind-fields.php:207
    782782msgid "(GMT+03:30) Tehran"
    783783msgstr ""
    784784
    785 #: includes/class-kind-fields.php:198
     785#: includes/class-kind-fields.php:208
    786786msgid "(GMT+04:00) Baku"
    787787msgstr ""
    788788
    789 #: includes/class-kind-fields.php:199
     789#: includes/class-kind-fields.php:209
    790790msgid "(GMT+04:00) Dubai"
    791791msgstr ""
    792792
    793 #: includes/class-kind-fields.php:200
     793#: includes/class-kind-fields.php:210
    794794msgid "(GMT+04:00) Tbilisi"
    795795msgstr ""
    796796
    797 #: includes/class-kind-fields.php:201
     797#: includes/class-kind-fields.php:211
    798798msgid "(GMT+04:00) Yerevan"
    799799msgstr ""
    800800
    801 #: includes/class-kind-fields.php:202
     801#: includes/class-kind-fields.php:212
    802802msgid "(GMT+04:00) Moscow+01 - Samara"
    803803msgstr ""
    804804
    805 #: includes/class-kind-fields.php:203
     805#: includes/class-kind-fields.php:213
    806806msgid "(GMT+04:00) Mahe"
    807807msgstr ""
    808808
    809 #: includes/class-kind-fields.php:204
     809#: includes/class-kind-fields.php:214
    810810msgid "(GMT+04:00) Mauritius"
    811811msgstr ""
    812812
    813 #: includes/class-kind-fields.php:205
     813#: includes/class-kind-fields.php:215
    814814msgid "(GMT+04:00) Reunion"
    815815msgstr ""
    816816
    817 #: includes/class-kind-fields.php:206
     817#: includes/class-kind-fields.php:216
    818818msgid "(GMT+04:30) Kabul"
    819819msgstr ""
    820820
    821 #: includes/class-kind-fields.php:207
     821#: includes/class-kind-fields.php:217
    822822msgid "(GMT+05:00) Mawson"
    823823msgstr ""
    824824
    825 #: includes/class-kind-fields.php:208
     825#: includes/class-kind-fields.php:218
    826826msgid "(GMT+05:00) Aqtau"
    827827msgstr ""
    828828
    829 #: includes/class-kind-fields.php:209
     829#: includes/class-kind-fields.php:219
    830830msgid "(GMT+05:00) Aqtobe"
    831831msgstr ""
    832832
    833 #: includes/class-kind-fields.php:210
     833#: includes/class-kind-fields.php:220
    834834msgid "(GMT+05:00) Ashgabat"
    835835msgstr ""
    836836
    837 #: includes/class-kind-fields.php:211
     837#: includes/class-kind-fields.php:221
    838838msgid "(GMT+05:00) Dushanbe"
    839839msgstr ""
    840840
    841 #: includes/class-kind-fields.php:212
     841#: includes/class-kind-fields.php:222
    842842msgid "(GMT+05:00) Karachi"
    843843msgstr ""
    844844
    845 #: includes/class-kind-fields.php:213
     845#: includes/class-kind-fields.php:223
    846846msgid "(GMT+05:00) Tashkent"
    847847msgstr ""
    848848
    849 #: includes/class-kind-fields.php:214
     849#: includes/class-kind-fields.php:224
    850850msgid "(GMT+05:00) Moscow+02 - Yekaterinburg"
    851851msgstr ""
    852852
    853 #: includes/class-kind-fields.php:215
     853#: includes/class-kind-fields.php:225
    854854msgid "(GMT+05:00) Kerguelen"
    855855msgstr ""
    856856
    857 #: includes/class-kind-fields.php:216
     857#: includes/class-kind-fields.php:226
    858858msgid "(GMT+05:00) Maldives"
    859859msgstr ""
    860860
    861 #: includes/class-kind-fields.php:217
     861#: includes/class-kind-fields.php:227
    862862msgid "(GMT+05:30) India Standard Time"
    863863msgstr ""
    864864
    865 #: includes/class-kind-fields.php:218
     865#: includes/class-kind-fields.php:228
    866866msgid "(GMT+05:30) Colombo"
    867867msgstr ""
    868868
    869 #: includes/class-kind-fields.php:219
    870 msgid "(GMT+05:45) Katmandu"
    871 msgstr ""
    872 
    873 #: includes/class-kind-fields.php:220
     869#: includes/class-kind-fields.php:229
     870msgid "(GMT+05:45) Kathmandu"
     871msgstr ""
     872
     873#: includes/class-kind-fields.php:230
    874874msgid "(GMT+06:00) Vostok"
    875875msgstr ""
    876876
    877 #: includes/class-kind-fields.php:221
     877#: includes/class-kind-fields.php:231
    878878msgid "(GMT+06:00) Almaty"
    879879msgstr ""
    880880
    881 #: includes/class-kind-fields.php:222
     881#: includes/class-kind-fields.php:232
    882882msgid "(GMT+06:00) Bishkek"
    883883msgstr ""
    884884
    885 #: includes/class-kind-fields.php:223
     885#: includes/class-kind-fields.php:233
    886886msgid "(GMT+06:00) Dhaka"
    887887msgstr ""
    888888
    889 #: includes/class-kind-fields.php:224
     889#: includes/class-kind-fields.php:234
    890890msgid "(GMT+06:00) Moscow+03 - Omsk, Novosibirsk"
    891891msgstr ""
    892892
    893 #: includes/class-kind-fields.php:225
     893#: includes/class-kind-fields.php:235
    894894msgid "(GMT+06:00) Thimphu"
    895895msgstr ""
    896896
    897 #: includes/class-kind-fields.php:226
     897#: includes/class-kind-fields.php:236
    898898msgid "(GMT+06:00) Chagos"
    899899msgstr ""
    900900
    901 #: includes/class-kind-fields.php:227
    902 msgid "(GMT+06:30) Rangoon"
    903 msgstr ""
    904 
    905 #: includes/class-kind-fields.php:228
     901#: includes/class-kind-fields.php:237
     902msgid "(GMT+06:30) Yangon"
     903msgstr ""
     904
     905#: includes/class-kind-fields.php:238
    906906msgid "(GMT+06:30) Cocos"
    907907msgstr ""
    908908
    909 #: includes/class-kind-fields.php:229
     909#: includes/class-kind-fields.php:239
    910910msgid "(GMT+07:00) Davis"
    911911msgstr ""
    912912
    913 #: includes/class-kind-fields.php:230
     913#: includes/class-kind-fields.php:240
    914914msgid "(GMT+07:00) Bangkok"
    915915msgstr ""
    916916
    917 #: includes/class-kind-fields.php:231
     917#: includes/class-kind-fields.php:241
    918918msgid "(GMT+07:00) Hovd"
    919919msgstr ""
    920920
    921 #: includes/class-kind-fields.php:232
     921#: includes/class-kind-fields.php:242
    922922msgid "(GMT+07:00) Jakarta"
    923923msgstr ""
    924924
    925 #: includes/class-kind-fields.php:233
     925#: includes/class-kind-fields.php:243
    926926msgid "(GMT+07:00) Moscow+04 - Krasnoyarsk"
    927927msgstr ""
    928928
    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
    934930msgid "(GMT+07:00) Ho Chi Minh"
    935931msgstr ""
    936932
    937 #: includes/class-kind-fields.php:236
     933#: includes/class-kind-fields.php:245
    938934msgid "(GMT+07:00) Christmas"
    939935msgstr ""
    940936
    941 #: includes/class-kind-fields.php:237
     937#: includes/class-kind-fields.php:246
    942938msgid "(GMT+08:00) Casey"
    943939msgstr ""
    944940
    945 #: includes/class-kind-fields.php:238
     941#: includes/class-kind-fields.php:247
    946942msgid "(GMT+08:00) Brunei"
    947943msgstr ""
    948944
    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
    954946msgid "(GMT+08:00) Hong Kong"
    955947msgstr ""
    956948
    957 #: includes/class-kind-fields.php:241
     949#: includes/class-kind-fields.php:249
    958950msgid "(GMT+08:00) Moscow+05 - Irkutsk"
    959951msgstr ""
    960952
    961 #: includes/class-kind-fields.php:242
     953#: includes/class-kind-fields.php:250
    962954msgid "(GMT+08:00) Kuala Lumpur"
    963955msgstr ""
    964956
    965 #: includes/class-kind-fields.php:243
     957#: includes/class-kind-fields.php:251
    966958msgid "(GMT+08:00) Macau"
    967959msgstr ""
    968960
    969 #: includes/class-kind-fields.php:244
     961#: includes/class-kind-fields.php:252
    970962msgid "(GMT+08:00) Makassar"
    971963msgstr ""
    972964
    973 #: includes/class-kind-fields.php:245
     965#: includes/class-kind-fields.php:253
    974966msgid "(GMT+08:00) Manila"
    975967msgstr ""
    976968
    977 #: includes/class-kind-fields.php:246
     969#: includes/class-kind-fields.php:254
    978970msgid "(GMT+08:00) China Time - Beijing"
    979971msgstr ""
    980972
    981 #: includes/class-kind-fields.php:247
     973#: includes/class-kind-fields.php:255
    982974msgid "(GMT+08:00) Singapore"
    983975msgstr ""
    984976
    985 #: includes/class-kind-fields.php:248
     977#: includes/class-kind-fields.php:256
    986978msgid "(GMT+08:00) Taipei"
    987979msgstr ""
    988980
    989 #: includes/class-kind-fields.php:249
     981#: includes/class-kind-fields.php:257
    990982msgid "(GMT+08:00) Ulaanbaatar"
    991983msgstr ""
    992984
    993 #: includes/class-kind-fields.php:250
     985#: includes/class-kind-fields.php:258
    994986msgid "(GMT+08:00) Western Time - Perth"
    995987msgstr ""
    996988
    997 #: includes/class-kind-fields.php:251
     989#: includes/class-kind-fields.php:259
    998990msgid "(GMT+08:30) Pyongyang"
    999991msgstr ""
    1000992
    1001 #: includes/class-kind-fields.php:252
     993#: includes/class-kind-fields.php:260
    1002994msgid "(GMT+09:00) Dili"
    1003995msgstr ""
    1004996
    1005 #: includes/class-kind-fields.php:253
     997#: includes/class-kind-fields.php:261
    1006998msgid "(GMT+09:00) Jayapura"
    1007999msgstr ""
    10081000
    1009 #: includes/class-kind-fields.php:254
     1001#: includes/class-kind-fields.php:262
    10101002msgid "(GMT+09:00) Seoul"
    10111003msgstr ""
    10121004
    1013 #: includes/class-kind-fields.php:255
     1005#: includes/class-kind-fields.php:263
    10141006msgid "(GMT+09:00) Tokyo"
    10151007msgstr ""
    10161008
    1017 #: includes/class-kind-fields.php:256
     1009#: includes/class-kind-fields.php:264
    10181010msgid "(GMT+09:00) Moscow+06 - Yakutsk"
    10191011msgstr ""
    10201012
    1021 #: includes/class-kind-fields.php:257
     1013#: includes/class-kind-fields.php:265
    10221014msgid "(GMT+09:00) Palau"
    10231015msgstr ""
    10241016
    1025 #: includes/class-kind-fields.php:258
     1017#: includes/class-kind-fields.php:266
    10261018msgid "(GMT+10:30) Central Time - Adelaide"
    10271019msgstr ""
    10281020
    1029 #: includes/class-kind-fields.php:259
     1021#: includes/class-kind-fields.php:267
    10301022msgid "(GMT+09:30) Central Time - Darwin"
    10311023msgstr ""
    10321024
    1033 #: includes/class-kind-fields.php:261
     1025#: includes/class-kind-fields.php:269
    10341026msgid "(GMT+10:00) Moscow+07 - Magadan"
    10351027msgstr ""
    10361028
    1037 #: includes/class-kind-fields.php:262
     1029#: includes/class-kind-fields.php:270
    10381030msgid "(GMT+10:00) Moscow+07 - Yuzhno-Sakhalinsk"
    10391031msgstr ""
    10401032
    1041 #: includes/class-kind-fields.php:263
     1033#: includes/class-kind-fields.php:271
    10421034msgid "(GMT+10:00) Eastern Time - Brisbane"
    10431035msgstr ""
    10441036
    1045 #: includes/class-kind-fields.php:264
     1037#: includes/class-kind-fields.php:272
    10461038msgid "(GMT+11:00) Eastern Time - Hobart"
    10471039msgstr ""
    10481040
    1049 #: includes/class-kind-fields.php:265
     1041#: includes/class-kind-fields.php:273
    10501042msgid "(GMT+11:00) Eastern Time - Melbourne, Sydney"
    10511043msgstr ""
    10521044
    1053 #: includes/class-kind-fields.php:266
     1045#: includes/class-kind-fields.php:274
    10541046msgid "(GMT+10:00) Truk"
    10551047msgstr ""
    10561048
    1057 #: includes/class-kind-fields.php:267
     1049#: includes/class-kind-fields.php:275
    10581050msgid "(GMT+10:00) Guam"
    10591051msgstr ""
    10601052
    1061 #: includes/class-kind-fields.php:268
     1053#: includes/class-kind-fields.php:276
    10621054msgid "(GMT+10:00) Port Moresby"
    10631055msgstr ""
    10641056
    1065 #: includes/class-kind-fields.php:269
     1057#: includes/class-kind-fields.php:277
    10661058msgid "(GMT+11:00) Efate"
    10671059msgstr ""
    10681060
    1069 #: includes/class-kind-fields.php:270
     1061#: includes/class-kind-fields.php:278
    10701062msgid "(GMT+11:00) Guadalcanal"
    10711063msgstr ""
    10721064
    1073 #: includes/class-kind-fields.php:271
     1065#: includes/class-kind-fields.php:279
    10741066msgid "(GMT+11:00) Kosrae"
    10751067msgstr ""
    10761068
    1077 #: includes/class-kind-fields.php:272
     1069#: includes/class-kind-fields.php:280
    10781070msgid "(GMT+11:00) Norfolk"
    10791071msgstr ""
    10801072
    1081 #: includes/class-kind-fields.php:273
     1073#: includes/class-kind-fields.php:281
    10821074msgid "(GMT+11:00) Noumea"
    10831075msgstr ""
    10841076
    1085 #: includes/class-kind-fields.php:274
     1077#: includes/class-kind-fields.php:282
    10861078msgid "(GMT+11:00) Ponape"
    10871079msgstr ""
    10881080
    1089 #: includes/class-kind-fields.php:275
     1081#: includes/class-kind-fields.php:283
    10901082msgid "(GMT+12:00) Moscow+09 - Petropavlovsk-Kamchatskiy"
    10911083msgstr ""
    10921084
    1093 #: includes/class-kind-fields.php:276
     1085#: includes/class-kind-fields.php:284
    10941086msgid "(GMT+13:00) Auckland"
    10951087msgstr ""
    10961088
    1097 #: includes/class-kind-fields.php:277
     1089#: includes/class-kind-fields.php:285
    10981090msgid "(GMT+13:00) Fiji"
    10991091msgstr ""
    11001092
    1101 #: includes/class-kind-fields.php:278
     1093#: includes/class-kind-fields.php:286
    11021094msgid "(GMT+12:00) Funafuti"
    11031095msgstr ""
    11041096
    1105 #: includes/class-kind-fields.php:279
     1097#: includes/class-kind-fields.php:287
    11061098msgid "(GMT+12:00) Kwajalein"
    11071099msgstr ""
    11081100
    1109 #: includes/class-kind-fields.php:280
     1101#: includes/class-kind-fields.php:288
    11101102msgid "(GMT+12:00) Majuro"
    11111103msgstr ""
    11121104
    1113 #: includes/class-kind-fields.php:281
     1105#: includes/class-kind-fields.php:289
    11141106msgid "(GMT+12:00) Nauru"
    11151107msgstr ""
    11161108
    1117 #: includes/class-kind-fields.php:282
     1109#: includes/class-kind-fields.php:290
    11181110msgid "(GMT+12:00) Tarawa"
    11191111msgstr ""
    11201112
    1121 #: includes/class-kind-fields.php:283
     1113#: includes/class-kind-fields.php:291
    11221114msgid "(GMT+12:00) Wake"
    11231115msgstr ""
    11241116
    1125 #: includes/class-kind-fields.php:284
     1117#: includes/class-kind-fields.php:292
    11261118msgid "(GMT+12:00) Wallis"
    11271119msgstr ""
    11281120
    1129 #: includes/class-kind-fields.php:285
     1121#: includes/class-kind-fields.php:293
    11301122msgid "(GMT+14:00) Apia"
    11311123msgstr ""
    11321124
    1133 #: includes/class-kind-fields.php:286
    1134 msgid "(GMT+13:00) Enderbury"
    1135 msgstr ""
    1136 
    1137 #: includes/class-kind-fields.php:287
     1125#: includes/class-kind-fields.php:294
     1126msgid "(GMT+13:00) Kanton"
     1127msgstr ""
     1128
     1129#: includes/class-kind-fields.php:295
    11381130msgid "(GMT+13:00) Fakaofo"
    11391131msgstr ""
    11401132
    1141 #: includes/class-kind-fields.php:288
     1133#: includes/class-kind-fields.php:296
    11421134msgid "(GMT+13:00) Tongatapu"
    11431135msgstr ""
    11441136
    1145 #: includes/class-kind-fields.php:289
     1137#: includes/class-kind-fields.php:297
    11461138msgid "(GMT+14:00) Kiritimati"
    11471139msgstr ""
    11481140
    1149 #: includes/class-kind-fields.php:396
     1141#: includes/class-kind-fields.php:427
     1142#: templates/reply-time.php:21
     1143msgid "Years"
     1144msgstr ""
     1145
     1146#: includes/class-kind-fields.php:428
     1147#: templates/reply-time.php:25
     1148msgid "Months"
     1149msgstr ""
     1150
     1151#: includes/class-kind-fields.php:429
     1152#: templates/reply-time.php:29
     1153msgid "Days"
     1154msgstr ""
     1155
     1156#: includes/class-kind-fields.php:430
     1157#: templates/reply-time.php:35
     1158msgid "Hours"
     1159msgstr ""
     1160
     1161#: includes/class-kind-fields.php:431
     1162#: templates/reply-time.php:39
     1163msgid "Minutes"
     1164msgstr ""
     1165
     1166#: includes/class-kind-fields.php:432
     1167#: templates/reply-time.php:43
     1168msgid "Seconds"
     1169msgstr ""
     1170
     1171#: includes/class-kind-fields.php:463
    11501172msgid "Author Name"
    11511173msgstr ""
    11521174
    1153 #: includes/class-kind-fields.php:400
     1175#: includes/class-kind-fields.php:467
    11541176#: templates/reply-author.php:26
    11551177msgid "Author URL"
    11561178msgstr ""
    11571179
    1158 #: includes/class-kind-fields.php:404
     1180#: includes/class-kind-fields.php:471
    11591181msgid "Author Photo"
    11601182msgstr ""
    11611183
     1184#: includes/class-kind-fields.php:493
     1185#: templates/reply-metabox.php:56
     1186msgid "Name"
     1187msgstr ""
     1188
     1189#: includes/class-kind-fields.php:497
     1190#: templates/reply-metabox.php:50
     1191msgid "URL"
     1192msgstr ""
     1193
     1194#: includes/class-kind-fields.php:501
     1195#: templates/reply-author.php:20
     1196#: templates/reply-metabox.php:45
     1197msgid "Author"
     1198msgstr ""
     1199
     1200#: includes/class-kind-fields.php:505
     1201msgid "Summary"
     1202msgstr ""
     1203
     1204#: includes/class-kind-fields.php:509
     1205msgid "Publication/Website"
     1206msgstr ""
     1207
     1208#: includes/class-kind-fields.php:513
     1209msgid "Publish Date"
     1210msgstr ""
     1211
     1212#: includes/class-kind-fields.php:517
     1213msgid "Updated Time"
     1214msgstr ""
     1215
     1216#: includes/class-kind-fields.php:521
     1217#: includes/register-kinds.php:187
     1218msgid "Tags"
     1219msgstr ""
     1220
     1221#: includes/class-kind-fields.php:525
     1222msgid "Featured Media"
     1223msgstr ""
     1224
     1225#: includes/class-kind-fields.php:567
     1226msgid "Title"
     1227msgstr ""
     1228
     1229#: includes/class-kind-fields.php:581
     1230#: includes/class-kind-metabox.php:422
     1231msgid "Rating"
     1232msgstr ""
     1233
     1234#: includes/class-kind-fields.php:583
     1235#: includes/class-kind-metabox.php:346
     1236msgid "Very Dissatisfied"
     1237msgstr ""
     1238
     1239#: includes/class-kind-fields.php:584
     1240#: includes/class-kind-metabox.php:347
     1241msgid "Dissatisfied"
     1242msgstr ""
     1243
     1244#: includes/class-kind-fields.php:585
     1245#: includes/class-kind-metabox.php:348
     1246msgid "Neutral"
     1247msgstr ""
     1248
     1249#: includes/class-kind-fields.php:586
     1250#: includes/class-kind-metabox.php:349
     1251msgid "Satisfied"
     1252msgstr ""
     1253
     1254#: includes/class-kind-fields.php:587
     1255#: includes/class-kind-metabox.php:350
     1256msgid "Very Satisfied"
     1257msgstr ""
     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
     1263msgid "RSVP"
     1264msgstr ""
     1265
     1266#: includes/class-kind-fields.php:606
     1267#: includes/class-kind-metabox.php:376
     1268msgid "Yes"
     1269msgstr ""
     1270
     1271#: includes/class-kind-fields.php:607
     1272#: includes/class-kind-metabox.php:377
     1273msgid "No"
     1274msgstr ""
     1275
     1276#: includes/class-kind-fields.php:608
     1277#: includes/class-kind-metabox.php:378
     1278msgid "Maybe"
     1279msgstr ""
     1280
     1281#: includes/class-kind-fields.php:609
     1282#: includes/class-kind-metabox.php:379
     1283msgid "Interested"
     1284msgstr ""
     1285
     1286#: includes/class-kind-fields.php:610
     1287#: includes/class-kind-metabox.php:380
     1288msgid "Remote"
     1289msgstr ""
     1290
     1291#: includes/class-kind-fields.php:625
     1292msgid "Read Status"
     1293msgstr ""
     1294
     1295#: includes/class-kind-fields.php:627
     1296msgid "Want to Read"
     1297msgstr ""
     1298
     1299#: includes/class-kind-fields.php:628
     1300msgid "Reading"
     1301msgstr ""
     1302
     1303#: includes/class-kind-fields.php:629
     1304msgid "Finished Reading"
     1305msgstr ""
     1306
     1307#: includes/class-kind-fields.php:645
     1308#: includes/register-kinds.php:215
     1309msgid "Start Date"
     1310msgstr ""
     1311
     1312#: includes/class-kind-fields.php:649
     1313#: includes/register-kinds.php:219
     1314msgid "End Date"
     1315msgstr ""
     1316
     1317#: includes/class-kind-fields.php:653
     1318#: templates/reply-time.php:18
     1319msgid "Duration"
     1320msgstr ""
     1321
    11621322#: 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
    11651326msgid "Artist"
    11661327msgstr ""
    … …  
    12331394msgstr ""
    12341395
    1235 #: includes/class-kind-metabox.php:346
    1236 msgid "Very Dissatisfied"
    1237 msgstr ""
    1238 
    1239 #: includes/class-kind-metabox.php:347
    1240 msgid "Dissatisfied"
    1241 msgstr ""
    1242 
    1243 #: includes/class-kind-metabox.php:348
    1244 msgid "Neutral"
    1245 msgstr ""
    1246 
    1247 #: includes/class-kind-metabox.php:349
    1248 msgid "Satisfied"
    1249 msgstr ""
    1250 
    1251 #: includes/class-kind-metabox.php:350
    1252 msgid "Very Satisfied"
    1253 msgstr ""
    1254 
    1255 #: includes/class-kind-metabox.php:376
    1256 #: includes/register-kinds.php:468
    1257 msgid "Yes"
    1258 msgstr ""
    1259 
    1260 #: includes/class-kind-metabox.php:377
    1261 #: includes/register-kinds.php:469
    1262 msgid "No"
    1263 msgstr ""
    1264 
    1265 #: includes/class-kind-metabox.php:378
    1266 #: includes/register-kinds.php:470
    1267 msgid "Maybe"
    1268 msgstr ""
    1269 
    1270 #: includes/class-kind-metabox.php:379
    1271 #: includes/register-kinds.php:471
    1272 msgid "Interested"
    1273 msgstr ""
    1274 
    1275 #: includes/class-kind-metabox.php:380
    1276 #: includes/register-kinds.php:472
    1277 msgid "Remote"
    1278 msgstr ""
    1279 
    1280 #: includes/class-kind-metabox.php:404
    1281 #: includes/register-kinds.php:460
    1282 #: views/kind.php:81
    1283 msgid "RSVP"
    1284 msgstr ""
    1285 
    1286 #: includes/class-kind-metabox.php:422
    1287 msgid "Rating"
    1288 msgstr ""
    1289 
    12901396#: includes/class-kind-metabox.php:461
    12911397msgid "Response Properties"
    … …  
    13211427msgstr ""
    13221428
    1323 #: includes/class-kind-taxonomy.php:609
     1429#: includes/class-kind-taxonomy.php:621
    13241430msgid "Post Kinds replaces the IndieWeb Taxonomy plugin. Deactivate IndieWeb Taxonomy, then activate Post Kinds."
    13251431msgstr ""
    13261432
    1327 #: includes/class-kind-taxonomy.php:697
     1433#: includes/class-kind-taxonomy.php:709
    13281434msgctxt "taxonomy general name"
    13291435msgid "Kinds"
    13301436msgstr ""
    13311437
    1332 #: includes/class-kind-taxonomy.php:698
     1438#: includes/class-kind-taxonomy.php:710
    13331439msgctxt "taxonomy singular name"
    13341440msgid "Kind"
    13351441msgstr ""
    13361442
    1337 #: includes/class-kind-taxonomy.php:699
     1443#: includes/class-kind-taxonomy.php:711
    13381444msgctxt "search locations"
    13391445msgid "Search Kinds"
    13401446msgstr ""
    13411447
    1342 #: includes/class-kind-taxonomy.php:700
     1448#: includes/class-kind-taxonomy.php:712
    13431449msgctxt "popular kinds"
    13441450msgid "Popular Kinds"
    13451451msgstr ""
    13461452
    1347 #: includes/class-kind-taxonomy.php:701
     1453#: includes/class-kind-taxonomy.php:713
    13481454msgctxt "all taxonomy items"
    13491455msgid "All Kinds"
    13501456msgstr ""
    13511457
    1352 #: includes/class-kind-taxonomy.php:702
     1458#: includes/class-kind-taxonomy.php:714
    13531459msgctxt "taxonomy parent item"
    13541460msgid "Parent Kind"
    13551461msgstr ""
    13561462
    1357 #: includes/class-kind-taxonomy.php:703
     1463#: includes/class-kind-taxonomy.php:715
    13581464msgctxt "taxonomy parent item with colon"
    13591465msgid "Parent Kind:"
    13601466msgstr ""
    13611467
    1362 #: includes/class-kind-taxonomy.php:704
     1468#: includes/class-kind-taxonomy.php:716
    13631469msgid "This will appear on archives as the description if your theme supports"
    13641470msgstr ""
    13651471
    1366 #: includes/class-kind-taxonomy.php:705
     1472#: includes/class-kind-taxonomy.php:717
    13671473msgctxt "edit taxonomy item"
    13681474msgid "Edit Kind"
    13691475msgstr ""
    13701476
    1371 #: includes/class-kind-taxonomy.php:706
     1477#: includes/class-kind-taxonomy.php:718
    13721478msgctxt "view taxonomy item"
    13731479msgid "View Kind"
    13741480msgstr ""
    13751481
    1376 #: includes/class-kind-taxonomy.php:707
     1482#: includes/class-kind-taxonomy.php:719
    13771483msgctxt "update taxonomy item"
    13781484msgid "Update Kind"
    13791485msgstr ""
    13801486
    1381 #: includes/class-kind-taxonomy.php:708
     1487#: includes/class-kind-taxonomy.php:720
    13821488msgctxt "add taxonomy item"
    13831489msgid "Add New Kind"
    13841490msgstr ""
    13851491
    1386 #: includes/class-kind-taxonomy.php:709
     1492#: includes/class-kind-taxonomy.php:721
    13871493msgctxt "new taxonomy item"
    13881494msgid "New Kind"
    13891495msgstr ""
    13901496
    1391 #: includes/class-kind-taxonomy.php:710
     1497#: includes/class-kind-taxonomy.php:722
    13921498msgctxt "separate kinds with commas"
    13931499msgid "Separate kinds with commas"
    13941500msgstr ""
    13951501
    1396 #: includes/class-kind-taxonomy.php:711
     1502#: includes/class-kind-taxonomy.php:723
    13971503msgctxt "add or remove items"
    13981504msgid "Add or remove kinds"
    13991505msgstr ""
    14001506
    1401 #: includes/class-kind-taxonomy.php:712
     1507#: includes/class-kind-taxonomy.php:724
    14021508msgctxt "choose most used"
    14031509msgid "Choose from the most used kinds"
    14041510msgstr ""
    14051511
    1406 #: includes/class-kind-taxonomy.php:713
     1512#: includes/class-kind-taxonomy.php:725
    14071513msgctxt "no kinds found"
    14081514msgid "No kinds found"
    14091515msgstr ""
    14101516
    1411 #: includes/class-kind-taxonomy.php:714
     1517#: includes/class-kind-taxonomy.php:726
    14121518msgctxt "no kinds"
    14131519msgid "No kinds"
    14141520msgstr ""
    14151521
    1416 #: includes/class-kind-taxonomy.php:715
     1522#: includes/class-kind-taxonomy.php:727
    14171523msgid "Back to Kinds"
    14181524msgstr ""
    14191525
    1420 #: includes/class-kind-taxonomy.php:716
     1526#: includes/class-kind-taxonomy.php:728
    14211527msgid "Kind Link"
    14221528msgstr ""
    14231529
    1424 #: includes/class-kind-taxonomy.php:717
     1530#: includes/class-kind-taxonomy.php:729
    14251531msgid "A link to a kind"
    14261532msgstr ""
    … …  
    14291535#. translators: 1: Taxonomy. 2: Month name and year
    14301536#. translators: 1. Taxonomy . 1: Date
    1431 #: includes/class-kind-taxonomy.php:1114
    1432 #: includes/class-kind-taxonomy.php:1117
    1433 #: includes/class-kind-taxonomy.php:1120
     1537#: includes/class-kind-taxonomy.php:1138
     1538#: includes/class-kind-taxonomy.php:1141
     1539#: includes/class-kind-taxonomy.php:1144
    14341540#, php-format
    14351541msgid "%1$1s - %2$2s"
    … …  
    14371543
    14381544#. translators: 1: Taxonomy. Yearly archive title. 2: Year
    1439 #: includes/class-kind-taxonomy.php:1114
     1545#: includes/class-kind-taxonomy.php:1138
    14401546msgctxt "yearly archives date format"
    14411547msgid "Y"
    … …  
    14431549
    14441550#. translators: 1: Taxonomy. 2: Month name and year
    1445 #: includes/class-kind-taxonomy.php:1117
     1551#: includes/class-kind-taxonomy.php:1141
    14461552msgctxt "monthly archives date format"
    14471553msgid "F Y"
    … …  
    14491555
    14501556#. translators: 1. Taxonomy . 1: Date
    1451 #: includes/class-kind-taxonomy.php:1120
     1557#: includes/class-kind-taxonomy.php:1144
    14521558msgctxt "daily archives date format"
    14531559msgid "F j, Y"
    … …  
    14551561
    14561562#. translators: 1. Title 2. Translated term for Firehose Feed
    1457 #: includes/class-kind-taxonomy.php:1124
     1563#: includes/class-kind-taxonomy.php:1148
    14581564#, php-format
    14591565msgid "%1$s - %2$2s"
    … …  
    14611567
    14621568#. translators: 1. Title 2. Translated term for Firehose Feed
    1463 #: includes/class-kind-taxonomy.php:1124
     1569#: includes/class-kind-taxonomy.php:1148
    14641570msgid "Firehose"
    14651571msgstr ""
    14661572
    14671573#. translators: 1: Title prefix. 2: Title.
    1468 #: includes/class-kind-taxonomy.php:1130
     1574#: includes/class-kind-taxonomy.php:1154
    14691575#, php-format
    14701576msgctxt "archive title"
    … …  
    14731579
    14741580#. translators: All
    1475 #: includes/class-kind-taxonomy.php:1455
     1581#: includes/class-kind-taxonomy.php:1481
    14761582#, php-format
    14771583msgid "All %1s"
    14781584msgstr ""
    14791585
    1480 #: includes/class-kind-taxonomy.php:1647
     1586#: includes/class-kind-taxonomy.php:1673
    14811587msgid "Invalid post"
    14821588msgstr ""
    14831589
    1484 #: includes/class-kind-taxonomy.php:1650
     1590#: includes/class-kind-taxonomy.php:1676
    14851591msgid "Invalid Kind"
    14861592msgstr ""
    14871593
    1488 #: includes/class-kind-taxonomy.php:1670
     1594#: includes/class-kind-taxonomy.php:1696
    14891595msgid "Invalid post."
    14901596msgstr ""
    14911597
    1492 #: includes/class-kind-taxonomy.php:1673
     1598#: includes/class-kind-taxonomy.php:1699
    14931599msgid "Sorry, you are not allowed to set the kind of this post."
    14941600msgstr ""
    … …  
    16131719msgstr[1] ""
    16141720
     1721#: includes/class-post-kind.php:181
     1722msgid "The title argument is deprecated. A kind has a title when its properties include a name field, such as Kind_Fields::title_field()."
     1723msgstr ""
     1724
    16151725#: includes/register-kinds.php:17
    16161726msgid "Article"
    … …  
    16211731msgstr ""
    16221732
    1623 #: includes/register-kinds.php:23
     1733#: includes/register-kinds.php:25
    16241734msgid "traditional long form content: a post with an explicit title and body"
    16251735msgstr ""
    16261736
    1627 #: includes/register-kinds.php:34
     1737#: includes/register-kinds.php:35
    16281738msgid "Note"
    16291739msgstr ""
    16301740
    1631 #: includes/register-kinds.php:35
     1741#: includes/register-kinds.php:36
    16321742msgid "Notes"
    16331743msgstr ""
    16341744
    1635 #: includes/register-kinds.php:40
     1745#: includes/register-kinds.php:41
    16361746msgid "short content: a post or status update with just plain content and typically without a title"
    16371747msgstr ""
    … …  
    16491759msgstr ""
    16501760
    1651 #: includes/register-kinds.php:58
     1761#: includes/register-kinds.php:56
     1762#: includes/register-kinds.php:591
    16521763msgid "In Reply To"
    16531764msgstr ""
    16541765
    1655 #: includes/register-kinds.php:62
     1766#: includes/register-kinds.php:59
     1767msgid "a reply to content typically on another site"
     1768msgstr ""
     1769
     1770#: includes/register-kinds.php:69
     1771#: includes/register-kinds.php:74
     1772msgid "Repost"
     1773msgstr ""
     1774
     1775#: includes/register-kinds.php:70
     1776msgid "Reposts"
     1777msgstr ""
     1778
     1779#: includes/register-kinds.php:71
     1780msgid "Reposted"
     1781msgstr ""
     1782
     1783#: includes/register-kinds.php:77
     1784msgid "a complete reposting of content from another site"
     1785msgstr ""
     1786
     1787#: includes/register-kinds.php:87
     1788#: includes/register-kinds.php:92
     1789msgid "Like"
     1790msgstr ""
     1791
     1792#: includes/register-kinds.php:88
     1793msgid "Likes"
     1794msgstr ""
     1795
     1796#: includes/register-kinds.php:89
     1797msgid "Liked"
     1798msgstr ""
     1799
     1800#: includes/register-kinds.php:95
     1801msgid "a way to pay compliments to the original post/poster of external content"
     1802msgstr ""
     1803
     1804#: includes/register-kinds.php:105
     1805msgid "Favorite"
     1806msgstr ""
     1807
     1808#: includes/register-kinds.php:106
     1809msgid "Favorites"
     1810msgstr ""
     1811
     1812#: includes/register-kinds.php:107
     1813#: includes/register-kinds.php:110
     1814msgid "Favorited"
     1815msgstr ""
     1816
     1817#: includes/register-kinds.php:113
     1818msgid "special to the author"
     1819msgstr ""
     1820
     1821#: includes/register-kinds.php:123
     1822#: includes/register-kinds.php:128
     1823msgid "Bookmark"
     1824msgstr ""
     1825
     1826#: includes/register-kinds.php:124
     1827msgid "Bookmarks"
     1828msgstr ""
     1829
     1830#: includes/register-kinds.php:125
     1831msgid "Bookmarked"
     1832msgstr ""
     1833
    16561834#: includes/register-kinds.php:131
    1657 #: includes/register-kinds.php:200
    1658 #: includes/register-kinds.php:269
     1835msgid "storing a link/bookmark for personal use or sharing with others"
     1836msgstr ""
     1837
     1838#: includes/register-kinds.php:141
     1839msgid "Photo"
     1840msgstr ""
     1841
     1842#: includes/register-kinds.php:142
     1843msgid "Photos"
     1844msgstr ""
     1845
     1846#: includes/register-kinds.php:146
     1847msgid "a post with an embedded image/photo as its primary focus"
     1848msgstr ""
     1849
     1850#: includes/register-kinds.php:156
     1851msgid "Video"
     1852msgstr ""
     1853
     1854#: includes/register-kinds.php:157
     1855msgid "Videos"
     1856msgstr ""
     1857
     1858#: includes/register-kinds.php:161
     1859msgid "a post with an embedded video as its primary focus"
     1860msgstr ""
     1861
     1862#: includes/register-kinds.php:171
     1863msgid "Audio"
     1864msgstr ""
     1865
     1866#: includes/register-kinds.php:172
     1867msgid "Audios"
     1868msgstr ""
     1869
     1870#: includes/register-kinds.php:176
     1871msgid "a post with an embedded audio file as its primary focus"
     1872msgstr ""
     1873
     1874#: includes/register-kinds.php:186
     1875msgid "Tag"
     1876msgstr ""
     1877
     1878#: includes/register-kinds.php:188
     1879msgid "Tagged"
     1880msgstr ""
     1881
     1882#: includes/register-kinds.php:191
     1883msgid "allows you to tag a post as being of a specific category or tag, or for person tagging"
     1884msgstr ""
     1885
     1886#: includes/register-kinds.php:202
     1887msgid "RSVPs"
     1888msgstr ""
     1889
     1890#: includes/register-kinds.php:203
     1891msgid "RSVPed"
     1892msgstr ""
     1893
     1894#: includes/register-kinds.php:208
     1895msgid "Event Details"
     1896msgstr ""
     1897
     1898#: includes/register-kinds.php:225
     1899msgid "a specific type of reply regarding attendance of an event"
     1900msgstr ""
     1901
     1902#: includes/register-kinds.php:235
     1903msgid "Listen"
     1904msgstr ""
     1905
     1906#: includes/register-kinds.php:236
     1907msgid "Listens"
     1908msgstr ""
     1909
     1910#: includes/register-kinds.php:237
     1911msgid "Listened"
     1912msgstr ""
     1913
     1914#: includes/register-kinds.php:242
     1915msgid "Listen To"
     1916msgstr ""
     1917
     1918#: includes/register-kinds.php:245
     1919#: includes/register-kinds.php:485
     1920msgid "Album"
     1921msgstr ""
     1922
     1923#: includes/register-kinds.php:246
     1924#: includes/register-kinds.php:277
     1925#: includes/register-kinds.php:486
     1926msgid "Release Date"
     1927msgstr ""
     1928
     1929#: includes/register-kinds.php:248
     1930#: includes/register-kinds.php:488
     1931msgid "Album Art"
     1932msgstr ""
     1933
     1934#: includes/register-kinds.php:256
     1935msgid "listening to audio; sometimes called a scrobble"
     1936msgstr ""
     1937
     1938#: includes/register-kinds.php:266
     1939msgid "Watch"
     1940msgstr ""
     1941
     1942#: includes/register-kinds.php:267
     1943msgid "Watches"
     1944msgstr ""
     1945
     1946#: includes/register-kinds.php:268
     1947msgid "Watched"
     1948msgstr ""
     1949
     1950#: includes/register-kinds.php:273
     1951msgid "Watching To"
     1952msgstr ""
     1953
     1954#: includes/register-kinds.php:276
     1955msgid "Series"
     1956msgstr ""
     1957
     1958#: includes/register-kinds.php:279
     1959msgid "Poster"
     1960msgstr ""
     1961
     1962#: includes/register-kinds.php:287
     1963msgid "watching a movie, television show, online video, play or other visual-based event"
     1964msgstr ""
     1965
     1966#: includes/register-kinds.php:297
     1967msgid "Checkin"
     1968msgstr ""
     1969
     1970#: includes/register-kinds.php:298
     1971msgid "Checkins"
     1972msgstr ""
     1973
     1974#: includes/register-kinds.php:299
     1975msgid "Checked into"
     1976msgstr ""
     1977
     1978#: includes/register-kinds.php:305
     1979msgid "Checked In"
     1980msgstr ""
     1981
     1982#: includes/register-kinds.php:311
     1983msgid "identifying you are at a particular geographic location"
     1984msgstr ""
     1985
     1986#: includes/register-kinds.php:321
     1987msgid "Wish"
     1988msgstr ""
     1989
     1990#: includes/register-kinds.php:322
     1991msgid "Wishes"
     1992msgstr ""
     1993
     1994#: includes/register-kinds.php:323
     1995msgid "Wished"
     1996msgstr ""
     1997
     1998#: includes/register-kinds.php:326
     1999msgid "a post indicating a desire/wish. The archive of which would be a wishlist, such as a gift registry or similar"
     2000msgstr ""
     2001
     2002#: includes/register-kinds.php:336
     2003msgid "Play"
     2004msgstr ""
     2005
     2006#: includes/register-kinds.php:337
     2007msgid "Playing"
     2008msgstr ""
     2009
    16592010#: includes/register-kinds.php:338
    1660 #: includes/register-kinds.php:481
    1661 #: includes/register-kinds.php:543
    1662 #: includes/register-kinds.php:608
    1663 #: includes/register-kinds.php:673
    1664 #: templates/reply-metabox.php:56
    1665 msgid "Name"
    1666 msgstr ""
    1667 
    1668 #: includes/register-kinds.php:66
    1669 #: includes/register-kinds.php:135
    1670 #: includes/register-kinds.php:204
    1671 #: includes/register-kinds.php:273
    16722011#: includes/register-kinds.php:342
    1673 #: includes/register-kinds.php:485
    1674 #: includes/register-kinds.php:547
    1675 #: includes/register-kinds.php:612
     2012msgid "Played"
     2013msgstr ""
     2014
     2015#: includes/register-kinds.php:348
     2016msgid "playing a game"
     2017msgstr ""
     2018
     2019#: includes/register-kinds.php:358
     2020#: includes/register-kinds.php:359
     2021msgid "Weather"
     2022msgstr ""
     2023
     2024#: includes/register-kinds.php:363
     2025msgid "current weather conditions"
     2026msgstr ""
     2027
     2028#: includes/register-kinds.php:373
     2029#: includes/register-kinds.php:374
     2030msgid "Exercise"
     2031msgstr ""
     2032
     2033#: includes/register-kinds.php:375
     2034msgid "Exercised"
     2035msgstr ""
     2036
     2037#: includes/register-kinds.php:378
     2038msgid "some form of physical activity or workout (examples: walk, run, cycle, hike, yoga, etc.)"
     2039msgstr ""
     2040
     2041#: includes/register-kinds.php:388
     2042msgid "Trip"
     2043msgstr ""
     2044
     2045#: includes/register-kinds.php:389
     2046msgid "Trips"
     2047msgstr ""
     2048
     2049#: includes/register-kinds.php:390
     2050#: includes/register-kinds.php:405
     2051msgid "Travelled"
     2052msgstr ""
     2053
     2054#: includes/register-kinds.php:393
     2055msgid "represents a geographic journey"
     2056msgstr ""
     2057
     2058#: includes/register-kinds.php:403
     2059msgid "Itinerary"
     2060msgstr ""
     2061
     2062#: includes/register-kinds.php:404
     2063msgid "Itineraries"
     2064msgstr ""
     2065
     2066#: includes/register-kinds.php:408
     2067msgid "parts of a scheduled trip including transit by car, plane, train, etc."
     2068msgstr ""
     2069
     2070#: includes/register-kinds.php:419
     2071#: includes/register-kinds.php:420
     2072msgid "Eat"
     2073msgstr ""
     2074
     2075#: includes/register-kinds.php:421
     2076#: includes/register-kinds.php:424
     2077msgid "Ate"
     2078msgstr ""
     2079
     2080#: includes/register-kinds.php:428
     2081msgid "what you are eating, perhaps for a food diary"
     2082msgstr ""
     2083
     2084#: includes/register-kinds.php:439
     2085msgid "Drink"
     2086msgstr ""
     2087
     2088#: includes/register-kinds.php:440
     2089msgid "Drinks"
     2090msgstr ""
     2091
     2092#: includes/register-kinds.php:441
     2093#: includes/register-kinds.php:444
     2094msgid "Drank"
     2095msgstr ""
     2096
     2097#: includes/register-kinds.php:448
     2098msgid "what you are drinking, perhaps for a food dairy"
     2099msgstr ""
     2100
     2101#: includes/register-kinds.php:459
     2102msgid "Follow"
     2103msgstr ""
     2104
     2105#: includes/register-kinds.php:460
     2106msgid "Follows"
     2107msgstr ""
     2108
     2109#: includes/register-kinds.php:461
     2110msgid "Followed"
     2111msgstr ""
     2112
     2113#: includes/register-kinds.php:464
     2114msgid "indicating you are now following or subscribing to another person`s activities online"
     2115msgstr ""
     2116
     2117#: includes/register-kinds.php:475
     2118msgid "Jam"
     2119msgstr ""
     2120
     2121#: includes/register-kinds.php:476
     2122msgid "Jams"
     2123msgstr ""
     2124
     2125#: includes/register-kinds.php:477
     2126#: includes/register-kinds.php:482
     2127msgid "Listened to"
     2128msgstr ""
     2129
     2130#: includes/register-kinds.php:496
     2131msgid "a particularly personally meaningful song (a listen with added emphasis)"
     2132msgstr ""
     2133
     2134#: includes/register-kinds.php:507
     2135#: includes/register-kinds.php:509
     2136#: includes/register-kinds.php:513
     2137msgid "Read"
     2138msgstr ""
     2139
     2140#: includes/register-kinds.php:508
     2141msgid "Reads"
     2142msgstr ""
     2143
     2144#: includes/register-kinds.php:520
     2145msgid "reading a book, magazine, newspaper, other physical document, or online post"
     2146msgstr ""
     2147
     2148#: includes/register-kinds.php:531
     2149msgid "Quote"
     2150msgstr ""
     2151
     2152#: includes/register-kinds.php:532
     2153msgid "Quotes"
     2154msgstr ""
     2155
     2156#: includes/register-kinds.php:533
     2157#: includes/register-kinds.php:536
     2158msgid "Quoted"
     2159msgstr ""
     2160
     2161#: includes/register-kinds.php:539
     2162msgid "quoted content"
     2163msgstr ""
     2164
     2165#: includes/register-kinds.php:550
     2166msgid "Mood"
     2167msgstr ""
     2168
     2169#: includes/register-kinds.php:551
     2170msgid "Moods"
     2171msgstr ""
     2172
     2173#: includes/register-kinds.php:552
     2174msgid "Felt"
     2175msgstr ""
     2176
     2177#: includes/register-kinds.php:555
     2178msgid "how you are feeling (example: happy, sad, indifferent, etc.)"
     2179msgstr ""
     2180
     2181#: includes/register-kinds.php:566
     2182msgid "Recipe"
     2183msgstr ""
     2184
     2185#: includes/register-kinds.php:567
     2186msgid "Recipes"
     2187msgstr ""
     2188
     2189#: includes/register-kinds.php:568
     2190msgid "Cooked"
     2191msgstr ""
     2192
     2193#: includes/register-kinds.php:574
     2194msgid "list of ingredients and directions for making food or drink"
     2195msgstr ""
     2196
     2197#: includes/register-kinds.php:585
     2198msgid "Issue"
     2199msgstr ""
     2200
     2201#: includes/register-kinds.php:586
     2202msgid "Issues"
     2203msgstr ""
     2204
     2205#: includes/register-kinds.php:587
     2206msgid "Filed an Issue"
     2207msgstr ""
     2208
     2209#: includes/register-kinds.php:594
     2210msgid "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."
     2211msgstr ""
     2212
     2213#: includes/register-kinds.php:605
     2214msgid "Question"
     2215msgstr ""
     2216
     2217#: includes/register-kinds.php:606
     2218msgid "Questions"
     2219msgstr ""
     2220
     2221#: includes/register-kinds.php:607
     2222msgid "Asked a question"
     2223msgstr ""
     2224
     2225#: includes/register-kinds.php:610
     2226msgid "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."
     2227msgstr ""
     2228
     2229#: includes/register-kinds.php:621
     2230msgid "Sleep"
     2231msgstr ""
     2232
     2233#: includes/register-kinds.php:622
     2234msgid "Sleeps"
     2235msgstr ""
     2236
     2237#: includes/register-kinds.php:623
     2238msgid "Slept"
     2239msgstr ""
     2240
     2241#: includes/register-kinds.php:626
     2242msgid "Sleep is a passive metrics post type that indicates how much time (and often a graph of how deeply) a person has slept."
     2243msgstr ""
     2244
     2245#: includes/register-kinds.php:637
     2246msgid "Event"
     2247msgstr ""
     2248
     2249#: includes/register-kinds.php:638
     2250msgid "Events"
     2251msgstr ""
     2252
     2253#: includes/register-kinds.php:639
     2254msgid "Planned"
     2255msgstr ""
     2256
     2257#: includes/register-kinds.php:645
     2258msgid "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."
     2259msgstr ""
     2260
     2261#: includes/register-kinds.php:655
     2262msgid "Review"
     2263msgstr ""
     2264
     2265#: includes/register-kinds.php:656
     2266msgid "Reviews"
     2267msgstr ""
     2268
     2269#: includes/register-kinds.php:657
     2270#: includes/register-kinds.php:660
     2271msgid "Reviewed"
     2272msgstr ""
     2273
     2274#: includes/register-kinds.php:664
     2275msgid "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."
     2276msgstr ""
     2277
     2278#: includes/register-kinds.php:675
     2279msgid "Acquisition"
     2280msgstr ""
     2281
     2282#: includes/register-kinds.php:676
     2283msgid "Acquisitions"
     2284msgstr ""
     2285
    16762286#: includes/register-kinds.php:677
    1677 #: templates/reply-metabox.php:50
    1678 msgid "URL"
    1679 msgstr ""
    1680 
    1681 #: includes/register-kinds.php:70
    1682 #: includes/register-kinds.php:139
    1683 #: includes/register-kinds.php:208
    1684 #: includes/register-kinds.php:277
    1685 #: includes/register-kinds.php:346
    1686 #: templates/reply-author.php:20
    1687 #: templates/reply-metabox.php:45
    1688 msgid "Author"
    1689 msgstr ""
    1690 
    1691 #: includes/register-kinds.php:77
    1692 #: includes/register-kinds.php:146
    1693 #: includes/register-kinds.php:215
    1694 #: includes/register-kinds.php:284
    1695 #: includes/register-kinds.php:353
    1696 #: includes/register-kinds.php:489
    1697 #: includes/register-kinds.php:558
    1698 #: includes/register-kinds.php:623
    1699 msgid "Summary"
    1700 msgstr ""
    1701 
    1702 #: includes/register-kinds.php:81
    1703 #: includes/register-kinds.php:150
    1704 #: includes/register-kinds.php:219
    1705 #: includes/register-kinds.php:288
    1706 #: includes/register-kinds.php:357
    1707 #: includes/register-kinds.php:493
    1708 msgid "Publication/Website"
    1709 msgstr ""
    1710 
    1711 #: includes/register-kinds.php:85
    1712 #: includes/register-kinds.php:154
    1713 #: includes/register-kinds.php:223
    1714 #: includes/register-kinds.php:292
    1715 #: includes/register-kinds.php:361
    1716 msgid "Publish Date"
    1717 msgstr ""
    1718 
    1719 #: includes/register-kinds.php:89
    1720 #: includes/register-kinds.php:158
    1721 #: includes/register-kinds.php:227
    1722 #: includes/register-kinds.php:296
    1723 #: includes/register-kinds.php:365
    1724 msgid "Updated Time"
    1725 msgstr ""
    1726 
    1727 #: includes/register-kinds.php:93
    1728 #: includes/register-kinds.php:162
    1729 #: includes/register-kinds.php:231
    1730 #: includes/register-kinds.php:300
    1731 #: includes/register-kinds.php:369
    1732 #: includes/register-kinds.php:445
    1733 #: includes/register-kinds.php:505
    1734 #: includes/register-kinds.php:570
    1735 #: includes/register-kinds.php:635
    1736 msgid "Tags"
    1737 msgstr ""
    1738 
    1739 #: includes/register-kinds.php:100
    1740 #: includes/register-kinds.php:169
    1741 #: includes/register-kinds.php:238
    1742 #: includes/register-kinds.php:307
    1743 #: includes/register-kinds.php:376
    1744 #: includes/register-kinds.php:512
    1745 msgid "Featured Media"
    1746 msgstr ""
    1747 
    1748 #: includes/register-kinds.php:109
    1749 msgid "a reply to content typically on another site"
    1750 msgstr ""
    1751 
    1752 #: includes/register-kinds.php:120
    1753 #: includes/register-kinds.php:127
    1754 msgid "Repost"
    1755 msgstr ""
    1756 
    1757 #: includes/register-kinds.php:121
    1758 msgid "Reposts"
    1759 msgstr ""
    1760 
    1761 #: includes/register-kinds.php:122
    1762 msgid "Reposted"
    1763 msgstr ""
    1764 
    1765 #: includes/register-kinds.php:178
    1766 msgid "a complete reposting of content from another site"
    1767 msgstr ""
    1768 
    1769 #: includes/register-kinds.php:189
    1770 #: includes/register-kinds.php:196
    1771 msgid "Like"
    1772 msgstr ""
    1773 
    1774 #: includes/register-kinds.php:190
    1775 msgid "Likes"
    1776 msgstr ""
    1777 
    1778 #: includes/register-kinds.php:191
    1779 msgid "Liked"
    1780 msgstr ""
    1781 
    1782 #: includes/register-kinds.php:247
    1783 msgid "a way to pay compliments to the original post/poster of external content"
    1784 msgstr ""
    1785 
    1786 #: includes/register-kinds.php:258
    1787 msgid "Favorite"
    1788 msgstr ""
    1789 
    1790 #: includes/register-kinds.php:259
    1791 msgid "Favorites"
    1792 msgstr ""
    1793 
    1794 #: includes/register-kinds.php:260
    1795 #: includes/register-kinds.php:265
    1796 msgid "Favorited"
    1797 msgstr ""
    1798 
    1799 #: includes/register-kinds.php:316
    1800 msgid "special to the author"
    1801 msgstr ""
    1802 
    1803 #: includes/register-kinds.php:327
    1804 #: includes/register-kinds.php:334
    1805 msgid "Bookmark"
    1806 msgstr ""
    1807 
    1808 #: includes/register-kinds.php:328
    1809 msgid "Bookmarks"
    1810 msgstr ""
    1811 
    1812 #: includes/register-kinds.php:329
    1813 msgid "Bookmarked"
    1814 msgstr ""
    1815 
    1816 #: includes/register-kinds.php:385
    1817 msgid "storing a link/bookmark for personal use or sharing with others"
    1818 msgstr ""
    1819 
    1820 #: includes/register-kinds.php:396
    1821 msgid "Photo"
    1822 msgstr ""
    1823 
    1824 #: includes/register-kinds.php:397
    1825 msgid "Photos"
    1826 msgstr ""
    1827 
    1828 #: includes/register-kinds.php:401
    1829 msgid "a post with an embedded image/photo as its primary focus"
    1830 msgstr ""
    1831 
    1832 #: includes/register-kinds.php:412
    1833 msgid "Video"
    1834 msgstr ""
    1835 
    1836 #: includes/register-kinds.php:413
    1837 msgid "Videos"
    1838 msgstr ""
    1839 
    1840 #: includes/register-kinds.php:417
    1841 msgid "a post with an embedded video as its primary focus"
    1842 msgstr ""
    1843 
    1844 #: includes/register-kinds.php:428
    1845 msgid "Audio"
    1846 msgstr ""
    1847 
    1848 #: includes/register-kinds.php:429
    1849 msgid "Audios"
    1850 msgstr ""
    1851 
    1852 #: includes/register-kinds.php:433
    1853 msgid "a post with an embedded audio file as its primary focus"
    1854 msgstr ""
    1855 
    1856 #: includes/register-kinds.php:444
    1857 msgid "Tag"
    1858 msgstr ""
    1859 
    1860 #: includes/register-kinds.php:446
    1861 msgid "Tagged"
    1862 msgstr ""
    1863 
    1864 #: includes/register-kinds.php:449
    1865 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:461
    1869 msgid "RSVPs"
    1870 msgstr ""
    1871 
    1872 #: includes/register-kinds.php:462
    1873 msgid "RSVPed"
    1874 msgstr ""
    1875 
    1876 #: includes/register-kinds.php:477
    1877 msgid "Event Details"
    1878 msgstr ""
    1879 
    1880 #: includes/register-kinds.php:497
    1881 msgid "Start Date"
    1882 msgstr ""
    1883 
    1884 #: includes/register-kinds.php:501
    1885 msgid "End Date"
    1886 msgstr ""
    1887 
    1888 #: includes/register-kinds.php:521
    1889 msgid "a specific type of reply regarding attendance of an event"
    1890 msgstr ""
    1891 
    1892 #: includes/register-kinds.php:532
    1893 msgid "Listen"
    1894 msgstr ""
    1895 
    1896 #: includes/register-kinds.php:533
    1897 msgid "Listens"
    1898 msgstr ""
    1899 
    1900 #: includes/register-kinds.php:534
    1901 msgid "Listened"
    1902 msgstr ""
    1903 
    1904 #: includes/register-kinds.php:539
    1905 msgid "Listen To"
    1906 msgstr ""
    1907 
    1908 #: includes/register-kinds.php:562
    1909 msgid "Album"
    1910 msgstr ""
    1911 
    1912 #: includes/register-kinds.php:566
    1913 #: includes/register-kinds.php:631
    1914 msgid "Release Date"
    1915 msgstr ""
    1916 
    1917 #: includes/register-kinds.php:577
    1918 msgid "Album Art"
    1919 msgstr ""
    1920 
    1921 #: includes/register-kinds.php:586
    1922 msgid "listening to audio; sometimes called a scrobble"
    1923 msgstr ""
    1924 
    1925 #: includes/register-kinds.php:597
    1926 msgid "Watch"
    1927 msgstr ""
    1928 
    1929 #: includes/register-kinds.php:598
    1930 msgid "Watches"
    1931 msgstr ""
    1932 
    1933 #: includes/register-kinds.php:599
    1934 msgid "Watched"
    1935 msgstr ""
    1936 
    1937 #: includes/register-kinds.php:604
    1938 msgid "Watching To"
    1939 msgstr ""
    1940 
    1941 #: includes/register-kinds.php:627
    1942 msgid "Series"
    1943 msgstr ""
    1944 
    1945 #: includes/register-kinds.php:642
    1946 msgid "Poster"
    1947 msgstr ""
    1948 
    1949 #: includes/register-kinds.php:651
    1950 msgid "watching a movie, television show, online video, play or other visual-based event"
    1951 msgstr ""
    1952 
    1953 #: includes/register-kinds.php:662
    1954 msgid "Checkin"
    1955 msgstr ""
    1956 
    1957 #: includes/register-kinds.php:663
    1958 msgid "Checkins"
    1959 msgstr ""
    1960 
    1961 #: includes/register-kinds.php:664
    1962 msgid "Checked into"
    1963 msgstr ""
    1964 
    1965 #: includes/register-kinds.php:669
    1966 msgid "Checked In"
    1967 msgstr ""
    1968 
    1969 #: includes/register-kinds.php:681
    1970 msgid "Latitude"
    1971 msgstr ""
    1972 
    1973 #: includes/register-kinds.php:689
    1974 msgid "Longitude"
    1975 msgstr ""
    1976 
    1977 #: includes/register-kinds.php:697
    1978 msgid "Street Address"
    1979 msgstr ""
    1980 
    1981 #: includes/register-kinds.php:701
    1982 msgid "Locality"
    1983 msgstr ""
    1984 
    1985 #: includes/register-kinds.php:705
    1986 msgid "Region"
    1987 msgstr ""
    1988 
    1989 #: includes/register-kinds.php:709
    1990 msgid "Country Name"
    1991 msgstr ""
    1992 
    1993 #: includes/register-kinds.php:713
    1994 msgid "Postal Code"
    1995 msgstr ""
    1996 
    1997 #: includes/register-kinds.php:719
    1998 msgid "identifying you are at a particular geographic location"
    1999 msgstr ""
    2000 
    2001 #: includes/register-kinds.php:730
    2002 msgid "Wish"
    2003 msgstr ""
    2004 
    2005 #: includes/register-kinds.php:731
    2006 msgid "Wishes"
    2007 msgstr ""
    2008 
    2009 #: includes/register-kinds.php:732
    2010 msgid "Wished"
    2011 msgstr ""
    2012 
    2013 #: includes/register-kinds.php:735
    2014 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:746
    2018 msgid "Play"
    2019 msgstr ""
    2020 
    2021 #: includes/register-kinds.php:747
    2022 msgid "Playing"
    2023 msgstr ""
    2024 
    2025 #: includes/register-kinds.php:748
    2026 msgid "Played"
    2027 msgstr ""
    2028 
    2029 #: includes/register-kinds.php:751
    2030 msgid "playing a game"
    2031 msgstr ""
    2032 
    2033 #: includes/register-kinds.php:762
    2034 #: includes/register-kinds.php:763
    2035 msgid "Weather"
    2036 msgstr ""
    2037 
    2038 #: includes/register-kinds.php:767
    2039 msgid "current weather conditions"
    2040 msgstr ""
    2041 
    2042 #: includes/register-kinds.php:778
    2043 #: includes/register-kinds.php:779
    2044 msgid "Exercise"
    2045 msgstr ""
    2046 
    2047 #: includes/register-kinds.php:780
    2048 msgid "Exercised"
    2049 msgstr ""
    2050 
    2051 #: includes/register-kinds.php:783
    2052 msgid "some form of physical activity or workout (examples: walk, run, cycle, hike, yoga, etc.)"
    2053 msgstr ""
    2054 
    2055 #: includes/register-kinds.php:794
    2056 msgid "Trip"
    2057 msgstr ""
    2058 
    2059 #: includes/register-kinds.php:795
    2060 msgid "Trips"
    2061 msgstr ""
    2062 
    2063 #: includes/register-kinds.php:796
    2064 #: includes/register-kinds.php:812
    2065 msgid "Travelled"
    2066 msgstr ""
    2067 
    2068 #: includes/register-kinds.php:799
    2069 msgid "represents a geographic journey"
    2070 msgstr ""
    2071 
    2072 #: includes/register-kinds.php:810
    2073 msgid "Itinerary"
    2074 msgstr ""
    2075 
    2076 #: includes/register-kinds.php:811
    2077 msgid "Itineraries"
    2078 msgstr ""
    2079 
    2080 #: includes/register-kinds.php:815
    2081 msgid "parts of a scheduled trip including transit by car, plane, train, etc."
    2082 msgstr ""
    2083 
    2084 #: includes/register-kinds.php:827
    2085 #: includes/register-kinds.php:828
    2086 msgid "Eat"
    2087 msgstr ""
    2088 
    2089 #: includes/register-kinds.php:829
    2090 msgid "Ate"
    2091 msgstr ""
    2092 
    2093 #: includes/register-kinds.php:832
    2094 msgid "what you are eating, perhaps for a food diary"
    2095 msgstr ""
    2096 
    2097 #: includes/register-kinds.php:844
    2098 msgid "Drink"
    2099 msgstr ""
    2100 
    2101 #: includes/register-kinds.php:845
    2102 msgid "Drinks"
    2103 msgstr ""
    2104 
    2105 #: includes/register-kinds.php:846
    2106 msgid "Drank"
    2107 msgstr ""
    2108 
    2109 #: includes/register-kinds.php:849
    2110 msgid "what you are drinking, perhaps for a food dairy"
    2111 msgstr ""
    2112 
    2113 #: includes/register-kinds.php:861
    2114 msgid "Follow"
    2115 msgstr ""
    2116 
    2117 #: includes/register-kinds.php:862
    2118 msgid "Follows"
    2119 msgstr ""
    2120 
    2121 #: includes/register-kinds.php:863
    2122 msgid "Followed"
    2123 msgstr ""
    2124 
    2125 #: includes/register-kinds.php:866
    2126 msgid "indicating you are now following or subscribing to another person`s activities online"
    2127 msgstr ""
    2128 
    2129 #: includes/register-kinds.php:878
    2130 msgid "Jam"
    2131 msgstr ""
    2132 
    2133 #: includes/register-kinds.php:879
    2134 msgid "Jams"
    2135 msgstr ""
    2136 
    2137 #: includes/register-kinds.php:880
    2138 msgid "Listened to"
    2139 msgstr ""
    2140 
    2141 #: includes/register-kinds.php:883
    2142 msgid "a particularly personally meaningful song (a listen with added emphasis)"
    2143 msgstr ""
    2144 
    2145 #: includes/register-kinds.php:895
    2146 #: includes/register-kinds.php:897
    2147 msgid "Read"
    2148 msgstr ""
    2149 
    2150 #: includes/register-kinds.php:896
    2151 msgid "Reads"
    2152 msgstr ""
    2153 
    2154 #: includes/register-kinds.php:900
    2155 msgid "reading a book, magazine, newspaper, other physical document, or online post"
    2156 msgstr ""
    2157 
    2158 #: includes/register-kinds.php:912
    2159 msgid "Quote"
    2160 msgstr ""
    2161 
    2162 #: includes/register-kinds.php:913
    2163 msgid "Quotes"
    2164 msgstr ""
    2165 
    2166 #: includes/register-kinds.php:914
    2167 msgid "Quoted"
    2168 msgstr ""
    2169 
    2170 #: includes/register-kinds.php:917
    2171 msgid "quoted content"
    2172 msgstr ""
    2173 
    2174 #: includes/register-kinds.php:929
    2175 msgid "Mood"
    2176 msgstr ""
    2177 
    2178 #: includes/register-kinds.php:930
    2179 msgid "Moods"
    2180 msgstr ""
    2181 
    2182 #: includes/register-kinds.php:931
    2183 msgid "Felt"
    2184 msgstr ""
    2185 
    2186 #: includes/register-kinds.php:934
    2187 msgid "how you are feeling (example: happy, sad, indifferent, etc.)"
    2188 msgstr ""
    2189 
    2190 #: includes/register-kinds.php:946
    2191 msgid "Recipe"
    2192 msgstr ""
    2193 
    2194 #: includes/register-kinds.php:947
    2195 msgid "Recipes"
    2196 msgstr ""
    2197 
    2198 #: includes/register-kinds.php:948
    2199 msgid "Cooked"
    2200 msgstr ""
    2201 
    2202 #: includes/register-kinds.php:951
    2203 msgid "list of ingredients and directions for making food or drink"
    2204 msgstr ""
    2205 
    2206 #: includes/register-kinds.php:963
    2207 msgid "Issue"
    2208 msgstr ""
    2209 
    2210 #: includes/register-kinds.php:964
    2211 msgid "Issues"
    2212 msgstr ""
    2213 
    2214 #: includes/register-kinds.php:965
    2215 msgid "Filed an Issue"
    2216 msgstr ""
    2217 
    2218 #: includes/register-kinds.php:968
    2219 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:980
    2223 msgid "Question"
    2224 msgstr ""
    2225 
    2226 #: includes/register-kinds.php:981
    2227 msgid "Questions"
    2228 msgstr ""
    2229 
    2230 #: includes/register-kinds.php:982
    2231 msgid "Asked a question"
    2232 msgstr ""
    2233 
    2234 #: includes/register-kinds.php:985
    2235 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:997
    2239 msgid "Sleep"
    2240 msgstr ""
    2241 
    2242 #: includes/register-kinds.php:998
    2243 msgid "Sleeps"
    2244 msgstr ""
    2245 
    2246 #: includes/register-kinds.php:999
    2247 msgid "Slept"
    2248 msgstr ""
    2249 
    2250 #: includes/register-kinds.php:1002
    2251 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:1014
    2255 msgid "Event"
    2256 msgstr ""
    2257 
    2258 #: includes/register-kinds.php:1015
    2259 msgid "Events"
    2260 msgstr ""
    2261 
    2262 #: includes/register-kinds.php:1016
    2263 msgid "Planned"
    2264 msgstr ""
    2265 
    2266 #: includes/register-kinds.php:1019
    2267 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:1030
    2271 msgid "Review"
    2272 msgstr ""
    2273 
    2274 #: includes/register-kinds.php:1031
    2275 msgid "Reviews"
    2276 msgstr ""
    2277 
    2278 #: includes/register-kinds.php:1032
    2279 msgid "Reviewed"
    2280 msgstr ""
    2281 
    2282 #: includes/register-kinds.php:1035
    2283 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:1047
    2287 msgid "Acquisition"
    2288 msgstr ""
    2289 
    2290 #: includes/register-kinds.php:1048
    2291 msgid "Acquisitions"
    2292 msgstr ""
    2293 
    2294 #: includes/register-kinds.php:1049
    22952287msgid "Acquired"
    22962288msgstr ""
    22972289
    2298 #: includes/register-kinds.php:1052
     2290#: includes/register-kinds.php:680
    22992291msgid "Purchases, gifts, found things, or objects donated"
    23002292msgstr ""
    23012293
    2302 #: includes/register-kinds.php:1063
     2294#: includes/register-kinds.php:690
    23032295msgid "Craft"
    23042296msgstr ""
    23052297
    2306 #: includes/register-kinds.php:1064
     2298#: includes/register-kinds.php:691
    23072299msgid "Crafts"
    23082300msgstr ""
    23092301
    2310 #: includes/register-kinds.php:1065
     2302#: includes/register-kinds.php:692
     2303#: includes/register-kinds.php:695
    23112304msgid "Crafted"
    23122305msgstr ""
    23132306
    2314 #: includes/register-kinds.php:1068
     2307#: includes/register-kinds.php:698
    23152308msgid "Activities like knitting, crocheting, cross stitch, wood working, restoration, 3d printing...the activity of building something."
    23162309msgstr ""
    … …  
    23882381#: templates/reply-metabox.php:47
    23892382msgid "Clear"
    2390 msgstr ""
    2391 
    2392 #: templates/reply-time.php:18
    2393 msgid "Duration"
    2394 msgstr ""
    2395 
    2396 #: templates/reply-time.php:21
    2397 msgid "Years"
    2398 msgstr ""
    2399 
    2400 #: templates/reply-time.php:25
    2401 msgid "Months"
    2402 msgstr ""
    2403 
    2404 #: templates/reply-time.php:29
    2405 msgid "Days"
    2406 msgstr ""
    2407 
    2408 #: templates/reply-time.php:35
    2409 msgid "Hours"
    2410 msgstr ""
    2411 
    2412 #: templates/reply-time.php:39
    2413 msgid "Minutes"
    2414 msgstr ""
    2415 
    2416 #: templates/reply-time.php:43
    2417 msgid "Seconds"
    24182383msgstr ""
    24192384
  • indieweb-post-kinds/trunk/lib/parse-this/includes/class-base.php

    r3738687 r3810578  
    1414 *
    1515 * Provides date ordering for feed items and sanitizers for values taken from
    16  * remote documents. The limit_* sanitizers are derived from the Press This
    17  * code that was removed from WordPress core.
     16 * remote documents. limit_string() is derived from the Press This code that
     17 * was removed from WordPress core.
    1818 *
    1919 * @since 1.0.0
    … …  
    109109
    110110        /**
    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.0
    116          *
    117          * @param array $value Array to limit.
    118          * @return array The first 100 values of $value, or an empty array if $value is
    119          *               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         /**
    134111         * Sanitizes a string and limits it to 5,000 characters.
    135112         *
    … …  
    159136
    160137        /**
    161          * Validates a URL, resolves it against the source URL, and limits its length.
    162          *
    163          * @since 1.0.0
    164          *
    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 https
    168          *                only), or an empty string if it is not a string, longer than
    169          *                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 pixels
    196          * and the WordPress.com stats image.
    197          *
    198          * @since 1.0.0
    199          *
    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.0
    247                  *
    248                  * @param string $src Absolute image URL that passed the built-in checks, or an
    249                  *                    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 are
    258          * rewritten to their watch-page form. Any other URL is kept only if it
    259          * matches a registered oEmbed provider.
    260          *
    261          * @since 1.0.0
    262          *
    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         /**
    306138         * Adds a value to an array key, turning the key into a list on repeats.
    307139         *
  • indieweb-post-kinds/trunk/lib/parse-this/includes/class-discovery.php

    r3738687 r3810578  
    295295                                                                                'type' => 'card',
    296296                                                                        );
    297                                                                         if ( wp_http_validate_url( $jf2['author'] ) ) {
     297                                                                        if ( pt_is_http_url( $jf2['author'] ) ) {
    298298                                                                                $author['url'] = $jf2['author'];
    299299                                                                        } else {
  • indieweb-post-kinds/trunk/lib/parse-this/includes/class-html.php

    r3738687 r3810578  
    9797                                $src = $video->getAttribute( 'src' );
    9898                                if ( ! empty( $src ) ) {
    99                                         $videos[] = $src;
     99                                        $videos[] = pt_make_absolute_url( $src, $url );
    100100                                }
    101101                        }
    … …  
    110110                                $src = $audio->getAttribute( 'src' );
    111111                                if ( ! empty( $src ) ) {
    112                                         $audios[] = $src;
     112                                        $audios[] = pt_make_absolute_url( $src, $url );
    113113                                }
    114114                        }
    … …  
    117117                                $src = $audio->getAttribute( 'data-audio-url' );
    118118                                if ( ! empty( $src ) ) {
    119                                         $audios[] = $src;
     119                                        $audios[] = pt_make_absolute_url( $src, $url );
    120120                                }
    121121                        }
    122122                        $jf2['audio'] = array_unique( $audios );
    123123                }
    124 
    125                 /*
    126                  For now do not search every link embed etc
    127                 // 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                 */
    188124
    189125                if ( ! empty( $args['debug'] ) ) {
    … …  
    201137         *
    202138         * @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.
    203142         *
    204143         * @param array $meta Meta values as grouped by parse_meta(), keyed by prefix
    … …  
    269208                                        $modified = $meta['article']['modified_time'] ?? $meta['article']['modified'] ?? null;
    270209                                        if ( $modified ) {
    271                                                 $jf2['modified'] = normalize_iso8601( $modified );
     210                                                $jf2['updated'] = normalize_iso8601( $modified );
    272211                                        }
    273212                                        $jf2['category'] = $meta['article']['tag'] ?? null;
    … …  
    314253                        }
    315254                }
    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'];
    324271                                } else {
    325272                                        $jf2['author'] = array();
    326                                         foreach ( $dc['Creator'] as $creator ) {
     273                                        foreach ( $dc['creator'] as $creator ) {
    327274                                                $jf2['author'][] = array(
    328275                                                        'type' => 'card',
    … …  
    332279                                }
    333280                        }
    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 );
    339287                        }
    340288                }
    … …  
    365313
    366314                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' ) );
    372317                }
    373318
  • indieweb-post-kinds/trunk/lib/parse-this/includes/class-jsonld.php

    r3738687 r3810578  
    210210                if ( ! array_key_exists( 'author', $return ) && array_key_exists( 'person', $jf2 ) ) {
    211211                        $return['author'] = $jf2['person'];
    212                 }
    213                 if ( ! array_key_exists( 'publication', $return ) && array_key_exists( 'publisher', $jf2 ) ) {
    214                         $return['publication'] = $jf2['publisher'];
    215212                }
    216213                return array_filter( $return, array( __CLASS__, 'is_set' ) );
    … …  
    538535         * Converts a MusicRelease node into a jf2 cite.
    539536         *
    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.
    541543         *
    542544         * @param array $music MusicRelease node.
    … …  
    559561                        'featured'  => self::image_to_photo( $music['image'] ?? null ),
    560562                );
    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;
    574586                                }
    575587                        }
    … …  
    630642         * Converts an Event node into a jf2 event.
    631643         *
    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.
    633648         *
    634649         * @param array $event Event or BusinessEvent node.
    … …  
    644659                        'url'       => $event['url'] ?? null,
    645660                        'summary'   => $event['description'] ?? null,
    646                         'organizer' => self::organization_to_hcard( $event['organizer'] ?? null ),
     661                        'organizer' => self::person_to_hcard( $event['organizer'] ?? null ),
    647662                        'location'  => self::place_to_hcard( $event['location'] ?? null ),
    648663                        'start'     => normalize_iso8601( $event['startDate'] ?? null ),
    … …  
    658673         * Returns the URL of an ImageObject.
    659674         *
    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.
    663680         *
    664681         * @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.
    666684         */
    667685        public static function image_to_photo( $image ) {
    … …  
    686704                 * }
    687705                 */
    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;
    689712        }
    690713
    … …  
    693716         *
    694717         * @since 1.0.0
     718         * @since 2.0.1 The transcript's plain text is content.text, not content.value.
    695719         *
    696720         * @param array|string $audio AudioObject node, or a URL.
    … …  
    717741                if ( isset( $audio['transcript'] ) ) {
    718742                        $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'] ) ),
    721745                        );
    722746                }
    … …  
    731755         *
    732756         * @since 1.0.0
     757         * @since 2.0.1 The transcript's plain text is content.text, not content.value.
    733758         *
    734759         * @param array|string $video VideoObject node, or a URL.
    … …  
    755780                if ( isset( $video['transcript'] ) ) {
    756781                        $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'] ) ),
    759784                        );
    760785                }
    … …  
    813838
    814839        /**
     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        /**
    815860         * Converts a Place node into a jf2 card.
    816861         *
    817862         * @since 1.0.0
     863         * @since 2.0.1 A plain-text address is kept as the card's label.
    818864         *
    819865         * @param array|mixed $place Place node.
    … …  
    839885
    840886                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'] ) );
    845888                }
    846889                return array_filter( $hcard );
    … …  
    927970         *
    928971         * @since 1.0.0
     972         * @since 2.0.1 A plain-text address is kept as the card's label.
    929973         *
    930974         * @param array|mixed $organization Organization, NewsMediaOrganization, NGO or
    … …  
    9631007                }
    9641008                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'] ) );
    9711010                }
    9721011                return array_filter( $publication );
    … …  
    10711110         * Converts an article or web page node into a jf2 entry.
    10721111         *
    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.
    10761118         *
    10771119         * @param array|mixed $newsarticle Article node.
    … …  
    11101152                        if ( ! is_array( $newsarticle['keywords'] ) ) {
    11111153                                $newsarticle['keywords'] = explode( ',', $newsarticle['keywords'] );
    1112                         } elseif ( is_string( $newsarticle['keywords'] ) ) {
    1113                                 $newsarticle['keywords'] = array( $newsarticle['keywords'] );
    11141154                        }
    11151155                        $jf2['category'] = array_map( 'trim', $newsarticle['keywords'] );
    … …  
    11221162                        );
    11231163                }
    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;
    11461178                        }
    11471179                }
  • indieweb-post-kinds/trunk/lib/parse-this/includes/class-mf2.php

    r3738687 r3810578  
    199199         * @since 1.0.0
    200200         * @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.
    201202         *
    202203         * @param array      $item   Microformat to find the author of.
    … …  
    219220                                        return $a;
    220221                                } elseif ( is_string( $a ) ) {
    221                                         if ( wp_http_validate_url( $a ) ) {
     222                                        if ( pt_is_http_url( $a ) ) {
    222223                                                // 5.2 "otherwise if author property is an http(s) URL, let the author-page have that URL"
    223224                                                $authorpage = $a;
    … …  
    489490         *
    490491         * 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.
    495498         *
    496499         * @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.
    498502         */
    499503        public static function normalize_feed( $input ) {
    … …  
    506510                        }
    507511                }
     512                $input['items'] = array_values( $input['items'] );
     513                $author         = $hcard ? array( 'author' => array( $hcard ) ) : array();
    508514                if ( 1 === count( $input['items'] ) ) {
    509                         if ( self::has_prop( $input['items'][0], 'author' ) ) {
     515                        if ( $hcard && ! self::has_prop( $input['items'][0], 'author' ) ) {
    510516                                $input['items'][0]['properties']['author'] = array( $hcard );
    511517                        }
    … …  
    516522                                array(
    517523                                        'type'       => array( 'h-feed' ),
    518                                         'properties' => array(
    519                                                 'author' => array( $hcard ),
    520                                         ),
     524                                        'properties' => $author,
    521525                                        'children'   => $input['items'],
    522526                                ),
    … …  
    10431047         *
    10441048         * 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.
    10491058         *
    10501059         * @param array $unknown Microformat.
    10511060         * @param array $mf      Parsed mf2 document.
    10521061         * @param array $args    Parse arguments (see Parser::parse()).
    1053          * @return array jf2 with the generic properties and the type, or an empty
    1054          *               array if the 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.
    10551064         */
    10561065        public static function parse_hunknown( $unknown, $mf, $args ) {
    … …  
    10591068                        return array();
    10601069                }
    1061                 // Parse unknown h property.
    10621070                $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                }
    10631078                if ( empty( $data ) ) {
    10641079                        return array();
    … …  
    10741089         * Reads name, published, updated, url, author, content and summary, drops
    10751090         * 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.
    10771093         *
    10781094         * @since 1.0.0
    10791095         * @since 2.0.0 Drops a name that is a prefix of the content, including a
    10801096         *              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.
    10811099         *
    10821100         * @param array $entry Microformat.
    … …  
    11081126                }
    11091127
     1128                // The page's rel=syndication links add to the item's own u-syndication;
     1129                // callers merge this result over their own properties.
    11101130                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'] ) ) );
    11191133                }
    11201134                return self::filter_empty( $data );
    … …  
    14701484                $properties = array( 'category', 'item' );
    14711485                $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                 }
    14791486                $data = array_merge( $data, self::parse_h( $entry, $mf, $args ) );
    14801487                return self::filter_empty( $data );
    … …  
    15041511                $properties = array( 'category', 'item' );
    15051512                $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                 }
    15131513                $data = array_merge( $data, self::parse_h( $entry, $mf, $args ) );
    15141514                return self::filter_empty( $data );
    … …  
    15791579                $properties = array( 'category', 'item' );
    15801580                $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                 }
    15881581                $data = array_merge( $data, self::parse_h( $item, $mf, $args ) );
    15891582                return self::filter_empty( $data );
  • indieweb-post-kinds/trunk/lib/parse-this/includes/class-restapi.php

    r3738687 r3810578  
    3232         *
    3333         * @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.
    3436         *
    3537         * @param string $key  Field name.
    3638         * @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.
    3841         */
    3942        public static function get_rendered( $key, $item ) {
    40                 if ( ! array_key_exists( $key, $item ) ) {
     43                if ( ! isset( $item[ $key ] ) || ! is_array( $item[ $key ] ) ) {
    4144                        return null;
    4245                }
    43                 if ( array_key_exists( 'rendered', $item[ $key ] ) ) {
    44                         return $item[ $key ]['rendered'];
    45                 }
    46                 return null;
     46                return $item[ $key ]['rendered'] ?? null;
    4747        }
    4848
    … …  
    279279                                return $return;
    280280                        } else {
    281                                 $content = self::fetch( $rest_url, '/wp/v2/posts?_embed=1' );
     281                                $content = self::fetch( $rest_url, '/wp/v2/posts' );
    282282                                if ( is_wp_error( $content ) || ! is_array( $content ) ) {
    283283                                        return $content;
  • indieweb-post-kinds/trunk/lib/parse-this/includes/class-rss.php

    r3738687 r3810578  
    102102         *
    103103         * @since 1.0.0
     104         * @since 2.0.1 An author whose name is a single link is no longer dropped.
    104105         *
    105106         * @param SimplePie_Author|SimplePie_Author[]|null $author One author or a list.
    … …  
    129130                        if ( ! empty( $names ) ) {
    130131                                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 );
    133135                                } else {
    134136                                        foreach ( $names as $name => $url ) {
  • indieweb-post-kinds/trunk/lib/parse-this/includes/functions.php

    r3738687 r3810578  
    11731173        }
    11741174}
     1175
     1176if ( ! 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  
    372372
    373373            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') . '"') : '') . '/>';
    375375
    376376                $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                }
    378387
    379388                $ele = $this->doc->importNode($frag->documentElement, true);
    … …  
    386395            }
    387396        } 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>.");
    389398            $ele = $this->doc->createElement('invalid');
    390399        }
    … …  
    672681                return true;
    673682            }
     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            }
    674697        } while ($working = $working->parentNode);
    675698
  • indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Parser/Scanner.php

    r2839509 r3810578  
    3030
    3131    /**
     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    /**
    3242     * Parse errors.
    3343     */
    … …  
    247257        // Add one to $this->char because we want the number for the next
    248258        // 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        }
    250287    }
    251288
    … …  
    288325        }
    289326
    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;
    308330    }
    309331
  • indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Parser/Tokenizer.php

    r3738687 r3810578  
    568568    protected function quotedAttributeValue($quote)
    569569    {
    570         $stoplist = "\f" . $quote;
     570        $stoplist = $quote;
    571571        $val = '';
    572572
  • indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Parser/UTF8Utils.php

    r3738687 r3810578  
    2828*/
    2929
    30 use Masterminds\HTML5\Exception;
    31 
    3230class UTF8Utils
    3331{
    … …  
    3937    /**
    4038     * 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.
    4240     *
    4341     * @param string $string
    … …  
    4745    public static function countChars($string)
    4846    {
    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');
    6348    }
    6449
    … …  
    8974        // which contains links to the actual but reports as well as work around
    9075        // 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.
    9580
    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);
    11790
    11891        /*
  • indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Serializer/OutputRules.php

    r3738687 r3810578  
    279279    }
    280280
     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
    281295    public function processorInstruction($ele)
    282296    {
    … …  
    301315        foreach ($this->xpath->query('namespace::*[not(.=../../namespace::*)]', $ele) as $nsNode) {
    302316            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('"');
    304318            }
    305319        }
  • indieweb-post-kinds/trunk/lib/parse-this/lib/html5/HTML5/Serializer/Traverser.php

    r2110745 r3810578  
    105105                $this->rules->comment($node);
    106106                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;
    107115            // Currently we don't support embedding DTDs.
    108116            default:
  • indieweb-post-kinds/trunk/lib/parse-this/lib/mf2/Parser.php

    r3738687 r3810578  
    6464 */
    6565function fetch($url, $convertClassic = true, &$curlInfo=null) {
     66        $version = '0';
     67        if (is_array($curl = curl_version())) {
     68                $version = $curl['version'];
     69        }
     70
    6671        $ch = curl_init();
    6772        curl_setopt($ch, CURLOPT_URL, $url);
    … …  
    7075        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
    7176        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
    7286        curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    7387                'Accept: text/html'
    7488        ));
    7589        $html = curl_exec($ch);
     90
     91        if ($html === false) {
     92                return null;
     93        }
     94
    7695        $info = $curlInfo = curl_getinfo($ch);
    77         curl_close($ch);
     96        if (PHP_VERSION_ID < 80000) {
     97                curl_close($ch);
     98        }
    7899
    79100        if (strpos(strtolower($info['content_type']), 'html') === false) {
    … …  
    94115 */
    95116function 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);
    97123}
    98124
    … …  
    112138
    113139function unicodeTrim($str) {
    114         // this is cheating. TODO: find a better way if this causes any problems
    115         $str = str_replace(mb_convert_encoding('&nbsp;', '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);
    118141}
    119142
    … …  
    146169
    147170/**
     171 * Registered with the XPath object and used within XPaths for finding root elements.
     172 * @param string $class
     173 * @return bool
     174 */
     175function classHasMf2RootClassname($class) {
     176        return count(mfNamesFromClass($class, 'h-')) > 0;
     177}
     178
     179/**
    148180 * Get Nested µf Property Name From Class
    149181 *
    … …  
    158190        $propertyNames = array();
    159191
    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;
    168196                }
    169197        }
    … …  
    356384         */
    357385        public function __construct($input, $url = null, $jsonMode = false) {
     386                $emptyDocDefault = '<html><body></body></html>';
    358387                libxml_use_internal_errors(true);
    359388                if (is_string($input)) {
     389                        if (empty($input)) {
     390                                        $input = $emptyDocDefault;
     391                        }
     392                               
    360393                        if (class_exists('Masterminds\\HTML5')) {
    361394                                        $doc = new \Masterminds\HTML5(array('disable_html_ns' => true));
    … …  
    369402                } else {
    370403                        $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.
    374408                $this->xpath = new DOMXPath($doc);
     409                $this->xpath->registerNamespace('php', 'http://php.net/xpath');
     410                $this->xpath->registerPhpFunctions('\\Mf2\\classHasMf2RootClassname');
    375411
    376412                $baseurl = $url;
    … …  
    405441
    406442        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());
    409445
    410446                $prefixes = $this->parsed[$e];
    … …  
    420456         */
    421457        private function isElementParsed(\DOMElement $e, $prefix) {
    422                 if (!$this->parsed->contains($e)) {
     458                if (!$this->parsed->offsetExists($e)) {
    423459                        return false;
    424460                }
    … …  
    440476         */
    441477        private function isElementUpgraded(\DOMElement $el, $property) {
    442                 if ( $this->upgraded->contains($el) ) {
     478                if ( $this->upgraded->offsetExists($el) ) {
    443479                        if ( in_array($property, $this->upgraded[$el]) ) {
    444480                                return true;
    … …  
    586622         */
    587623        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);
    589625
    590626                if ($valueClassElements->length !== 0) {
    … …  
    598634                }
    599635
    600                 $valueTitleElements = $this->xpath->query('./*[contains(concat(" ", @class, " "), " value-title ")]', $e);
     636                $valueTitleElements = $this->xpath->query('./*[contains(concat(" ", normalize-space(@class), " "), " value-title ")]', $e);
    601637
    602638                if ($valueTitleElements->length !== 0) {
    … …  
    686722        public function parseDT(\DOMElement $dt, &$dates = array(), &$impliedTimezone = null) {
    687723                // 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);
    689725                $dtValue = false;
    690726
    … …  
    938974        public function parseH(\DOMElement $e, $is_backcompat = false, $has_nested_mf = false) {
    939975                // 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)) {
    941977                        return null;
    942978                }
    … …  
    962998
    963999                // 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) {
    9651001                        // element is already parsed
    9661002                        if ($this->isElementParsed($p, 'p')) {
    … …  
    9871023
    9881024                // 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) {
    9901026                        // element is already parsed
    9911027                        if ($this->isElementParsed($u, 'u')) {
    … …  
    10121048
    10131049                // 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) {
    10151051                        // element is already parsed
    10161052                        if ($this->isElementParsed($dt, 'dt')) {
    … …  
    10471083
    10481084                // 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) {
    10501086                        // element is already parsed
    10511087                        if ($this->isElementParsed($em, 'e')) {
    … …  
    11651201                        'properties' => $return
    11661202                );
    1167                
     1203
    11681204                if(trim($e->getAttribute('id')) !== '') {
    11691205                        $parsed['id'] = trim($e->getAttribute("id"));
    … …  
    15071543                // start with mf2 root class name xpath
    15081544                $xpaths = array(
    1509                         'contains(concat(" ",normalize-space(@class)), " h-")'
     1545                        '(php:function("\\Mf2\\classHasMf2RootClassname", normalize-space(@class)))'
    15101546                );
    15111547
    … …  
    15621598                                break;
    15631599
     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':
    15641632                                case 'hreview':
    15651633                                        $item_and_vcard = $this->xpath->query('.//*[contains(concat(" ", normalize-space(@class), " "), " item ") and contains(concat(" ", normalize-space(@class), " "), " vcard ")]', $el);
    … …  
    15931661                                                        if ( !$this->hasRootMf2($tempEl) ) {
    15941662                                                                $this->addMfClasses($tempEl, 'p-item h-product');
    1595                                                                 $this->backcompat($tempEl, 'vevent');
     1663                                                                $this->backcompat($tempEl, 'hproduct');
    15961664                                                                $this->addUpgraded($tempEl, array('item', 'hproduct'));
    15971665                                                        }
    … …  
    15991667                                        }
    16001668
     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
    16011688                                        $this->upgradeRelTagToCategory($el);
    16021689                                break;
    16031690
    16041691                                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 ) {
    16091696                                                        if ( !$this->hasRootMf2($tempEl) ) {
    1610                                                                 $this->addMfClasses($tempEl, 'h-card');
     1697                                                                $this->addMfClasses($tempEl, 'p-location h-card');
    16111698                                                                $this->backcompat($tempEl, 'vcard');
     1699                                                                $this->addUpgraded($tempEl, array('location', 'vcard'));
    16121700                                                        }
    16131701                                                }
    … …  
    16581746
    16591747                // 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);
    16621750                } else {
    16631751                        $this->upgraded[$el] = array_merge($this->upgraded[$el], $property);
    … …  
    16881776        public function hasRootMf2(\DOMElement $el) {
    16891777                $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;
    16991781        }
    17001782
    … …  
    17131795                // replace all roots
    17141796                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) {
    17161798                                $el->setAttribute('class', $el->getAttribute('class') . ' ' . $new);
    17171799                        }
    … …  
    17211803                        $newRoot = $this->classicRootMap[$oldRoot];
    17221804                        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) {
    17241806                                        $el->setAttribute('class', $el->getAttribute('class') . ' ' . $data['replace']);
    17251807                                }
    … …  
    17561838                'vevent' => 'h-event',
    17571839                'hreview' => 'h-review',
     1840                'hreview-aggregate' => 'h-review-aggregate',
    17581841                'hproduct' => 'h-product',
    17591842                'adr' => 'h-adr',
     1843                'geo' => 'h-geo'
    17601844        );
    17611845
    … …  
    18741958                ),
    18751959                '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                        ),
    18771973                ),
    18781974                'hentry' => array(
    … …  
    19842080                        ),
    19852081                        'location' => array(
    1986                                 'replace' => 'h-card',
    1987                                 'context' => 'vcard'
     2082                                'replace' => 'p-location',
    19882083                        ),
    19892084                        'geo' => array(
    19902085                                'replace' => 'p-location h-geo'
    19912086                        ),
     2087                        'attendee' => array(
     2088                                'replace' => 'p-attendee h-card',
     2089                                'context' => 'vcard'
     2090                        )
    19922091                ),
    19932092                'hreview' => array(
    … …  
    20022101                                'context' => 'item'
    20032102                        ),
    2004                         'reviewer' => array(
    2005                                 'replace' => 'p-author h-card',
    2006                                 'context' => 'vcard',
    2007                         ),
     2103                        # reviewer: see backcompat()
    20082104                        'dtreviewed' => array(
    20092105                                'replace' => 'dt-published'
    … …  
    20232119                        'category' => array(
    20242120                                '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'
    20252151                        ),
    20262152                ),
    … …  
    20472173                                'replace' => 'u-url',
    20482174                        ),
    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'
    20522176                        'price' => array(
    20532177                                'replace' => 'p-price'
  • indieweb-post-kinds/trunk/lib/parse-this/parse-this.php

    r3738687 r3810578  
    44 * Plugin URI: https://github.com/dshanske/parse-this
    55 * Description: Turns URLs into structured jf2 data from microformats2, JSON-LD, meta tags and RSS, Atom and JSON feeds.
    6  * Version: 2.0.0
     6 * Version: 2.0.1
    77 * Author: David Shanske
    88 * Author URI: https://david.shanske.com
    … …  
    4545                         * @var string
    4646                         */
    47                         define( 'PARSE_THIS_VERSION', '2.0.0' );
     47                        define( 'PARSE_THIS_VERSION', '2.0.1' );
    4848                }
    4949                require_once plugin_dir_path( __FILE__ ) . 'includes/autoload.php';
  • indieweb-post-kinds/trunk/lib/parse-this/readme.txt

    r3738687 r3810578  
    22Contributors: dshanske
    33Tags: indieweb, microformats, jf2, json-ld, feeds
    4 Stable tag: 2.0.0
     4Stable tag: 2.0.1
    55Requires at least: 6.2
    66Requires PHP: 7.4
    … …  
    8888
    8989* `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.
    9190* `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.
    9291* `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.
    … …  
    162161
    163162== Changelog ==
     163
     164= 2.0.1 ( 2026-11-18 ) =
     165
     166Bug 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.
    164177
    165178= 2.0.0 ( 2026-10-03 ) =
    … …  
    222235== Upgrade Notice ==
    223236
     237= 2.0.1 =
     238Bug 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
    224240= 2.0.0 =
    225241A 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  
    22Contributors: dshanske
    33Tags: indieweb, interaction, posts, webmention, share, like, scrobble
    4 Stable tag: 4.0.1
     4Stable tag: 4.0.2
    55Requires at least: 6.2
    66Requires PHP: 7.4
    … …  
    305305
    306306== 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
    307318
    308319= 4.0.1 ( 2026-10-28 ) =
Note: See TracChangeset for help on using the changeset viewer.