Plugin Directory

Changeset 3832003


Ignore:
Timestamp:
11/28/2026 06:46:18 PM (less than one hour ago)
Author:
pfefferle
Message:

Update to version 3.1.0 from GitHub

Location:
opengraph
Files:
4 edited
1 copied

Legend:

Unmodified
Added
Removed
  • opengraph/tags/3.1.0/opengraph.php

    r3712623 r3832003  
    66 * Author: Will Norris & Matthias Pfefferle
    77 * Author URI: https://github.com/pfefferle/wordpress-opengraph
    8  * Version: 3.0.1
     8 * Version: 3.1.0
    99 * License: Apache License, Version 2.0
    1010 * License URI: https://www.apache.org/licenses/LICENSE-2.0.html
    … …  
    4545                ' ',
    4646                array_map(
    47                         function ( $k, $v ) {
    48                                 return $k . ': ' . $v;
    49                         },
     47                        fn( $k, $v ) => $k . ': ' . $v,
    5048                        array_keys( $prefixes ),
    5149                        $prefixes
    … …  
    124122                        'fediverse',
    125123                        array(
    126                                 'creator' => array(),
     124                                'creator' => '',
    127125                        ),
    128126                ),
    129127        );
    130128
    131         foreach ( $namespaces as $namespace => list( $filter_prefix, $properties ) ) {
     129        foreach ( $namespaces as $namespace => [ $filter_prefix, $properties ] ) {
    132130                foreach ( $properties as $property => $default ) {
    133131                        /**
    … …  
    147145        }
    148146
     147        // Cap the images after all callbacks ran, so later ones can not exceed the maximum.
     148        $metadata['og:image'] = array_slice( array_unique( array_filter( (array) $metadata['og:image'] ) ), 0, opengraph_max_images() );
     149
    149150        /**
    150151         * Filter the Open Graph metadata.
    … …  
    217218                        $title = opengraph_default_description( null, 5 );
    218219                }
    219         } elseif ( is_author() ) {
    220                 $author = get_queried_object();
    221                 $title  = $author->display_name;
     220        } elseif ( is_author() && get_queried_object() instanceof WP_User ) {
     221                $title = get_queried_object()->display_name;
    222222        } elseif ( ( is_category() || is_tag() ) && single_term_title( '', false ) ) {
    223223                $title = single_term_title( '', false );
    … …  
    240240 */
    241241function opengraph_default_type( $type = '' ) {
    242         if ( empty( $type ) ) {
    243                 if ( is_singular( array( 'post', 'page' ) ) ) {
    244                         $type = 'article';
    245                 } elseif ( is_author() ) {
    246                         $type = 'profile';
    247                 } else {
    248                         $type = 'website';
    249                 }
    250         }
    251 
    252         return $type;
     242        if ( $type ) {
     243                return $type;
     244        }
     245
     246        if ( is_singular( array( 'post', 'page' ) ) ) {
     247                return 'article';
     248        }
     249
     250        if ( is_author() ) {
     251                return 'profile';
     252        }
     253
     254        return 'website';
    253255}
    254256
    … …  
    270272        }
    271273
    272         $max_images = opengraph_max_images();
    273         $limit      = $max_images - count( $image );
    274 
     274        $limit   = opengraph_max_images() - count( $image );
    275275        $post_id = get_queried_object_id();
    276276
    … …  
    281281        }
    282282
    283         $image = array_values( array_unique( array_filter( $image ) ) );
    284 
    285         return array_slice( $image, 0, $max_images );
     283        return array_values( array_unique( array_filter( $image ) ) );
    286284}
    287285
    … …  
    326324
    327325        foreach ( $sources as $source ) {
    328                 foreach ( call_user_func( $source, $post_id ) as $id ) {
     326                foreach ( $source( $post_id ) as $id ) {
    329327                        $id = (int) $id;
    330328
    … …  
    432430function opengraph_attachment_url_to_id( $src ) {
    433431        $img_id = attachment_url_to_postid( $src );
    434 
    435         if ( 0 === $img_id ) {
     432        if ( $img_id ) {
     433                return $img_id;
     434        }
     435
     436        if ( str_contains( $src, '?' ) ) {
    436437                $src    = strtok( $src, '?' );
    437438                $img_id = attachment_url_to_postid( $src );
    438         }
    439 
    440         if ( 0 === $img_id ) {
    441                 $src = preg_replace( '/-(?:\d+x\d+)(\.[a-zA-Z]+)$/', '$1', $src, 1, $count );
    442                 if ( $count > 0 ) {
    443                         $img_id = attachment_url_to_postid( $src );
    444                 }
    445         }
    446 
    447         if ( 0 === $img_id ) {
    448                 $src    = preg_replace( '/(\.[a-zA-Z]+)$/', '-scaled$1', $src );
     439                if ( $img_id ) {
     440                        return $img_id;
     441                }
     442        }
     443
     444        $src = preg_replace( '/-(?:\d+x\d+)(\.[a-zA-Z]+)$/', '$1', $src, 1, $count );
     445        if ( $count > 0 ) {
    449446                $img_id = attachment_url_to_postid( $src );
    450         }
    451 
    452         return $img_id;
     447                if ( $img_id ) {
     448                        return $img_id;
     449                }
     450        }
     451
     452        return attachment_url_to_postid( preg_replace( '/(\.[a-zA-Z]+)$/', '-scaled$1', $src ) );
    453453}
    454454
    … …  
    472472                        'orderby'        => 'menu_order ID',
    473473                        'posts_per_page' => opengraph_max_images(),
     474                        'no_found_rows'  => true,
    474475                )
    475476        );
    … …  
    490491        }
    491492
    492         $max_images = opengraph_max_images();
    493 
    494493        // Try site icon.
    495         if ( has_site_icon() ) {
    496                 $image[] = get_site_icon_url( 512 );
     494        $site_icon = get_site_icon_url( 512 );
     495        if ( $site_icon ) {
     496                return array( $site_icon );
    497497        }
    498498
    499499        // Try custom logo second.
    500         if ( empty( $image ) ) {
    501                 $custom_logo = wp_get_attachment_image_url( get_theme_mod( 'custom_logo' ), 'large' );
    502                 if ( $custom_logo ) {
    503                         $image[] = $custom_logo;
    504                 }
     500        $custom_logo = wp_get_attachment_image_url( get_theme_mod( 'custom_logo' ), 'large' );
     501        if ( $custom_logo ) {
     502                return array( $custom_logo );
    505503        }
    506504
    507505        // Try header images.
    508         if ( empty( $image ) ) {
    509                 if ( is_random_header_image() ) {
    510                         foreach ( get_uploaded_header_images() as $header_image ) {
    511                                 $image[] = $header_image['url'];
    512                                 if ( count( $image ) >= $max_images ) {
    513                                         break;
    514                                 }
    515                         }
    516                 } elseif ( get_header_image() ) {
    517                         $image[] = get_header_image();
    518                 }
    519         }
    520 
    521         return array_unique( $image );
     506        if ( is_random_header_image() ) {
     507                return array_unique( array_column( get_uploaded_header_images(), 'url' ) );
     508        }
     509
     510        $header_image = get_header_image();
     511
     512        return $header_image ? array( $header_image ) : array();
    522513}
    523514
    … …  
    607598 * bloginfo description.
    608599 *
    609  * @param string $description The current description.
    610  * @param int    $length      The maximum length of the description.
     600 * @param string   $description The current description.
     601 * @param int|null $length      The maximum number of words. Defaults to the
     602 *                              `excerpt_length` filter.
    611603 *
    612604 * @return string The description.
    613605 */
    614 function opengraph_default_description( $description = '', $length = 55 ) {
     606function opengraph_default_description( $description = '', $length = null ) {
    615607        if ( $description ) {
    616608                return $description;
    … …  
    627619                }
    628620        } elseif ( is_author() ) {
    629                 $id          = get_queried_object_id();
    630                 $description = get_user_meta( $id, 'description', true );
     621                $description = get_user_meta( get_queried_object_id(), 'description', true );
    631622        } elseif ( ( is_category() || is_tag() ) && term_description() ) {
    632623                $description = term_description();
    … …  
    674665 */
    675666function opengraph_default_locale( $locale = '' ) {
    676         if ( empty( $locale ) ) {
    677                 $locale = get_locale();
    678         }
    679 
    680         return $locale;
     667        return $locale ? $locale : get_locale();
    681668}
    682669
    … …  
    688675 * whether a singular post has one: `summary_large_image` if it does,
    689676 * `summary` otherwise. Fallback images (site icon, logo, header) are not
    690  * the post's own images and look better in a small card.
     677 * the post's own images and look better in a small card, so the card is only
     678 * large if at least one image is not a fallback image.
    691679 *
    692680 * @param string $card     The current card type.
    … …  
    700688        }
    701689
    702         if ( ! is_singular() || empty( $metadata['og:image'] ) ) {
    703                 return 'summary';
    704         }
    705 
    706         if ( opengraph_fallback_image() === $metadata['og:image'] ) {
     690        if ( ! is_singular() || empty( $metadata['og:image'] ) || ! array_diff( (array) $metadata['og:image'], opengraph_fallback_image() ) ) {
    707691                return 'summary';
    708692        }
    … …  
    744728        $twitter = opengraph_queried_author_meta( 'twitter' );
    745729
    746         if ( ! $twitter ) {
    747                 return $creator;
    748         }
    749 
    750730        // Check if twitter-account matches "http://twitter.com/username".
    751731        if ( preg_match( '/^http:\/\/twitter\.com\/(#!\/)?(\w+)/i', $twitter, $matches ) ) {
    752732                $creator = '@' . $matches[2];
    753         } elseif ( preg_match( '/^@?(\w+)$/i', $twitter, $matches ) ) { // Check if twitter-account matches "(@)username".
     733        } elseif ( preg_match( '/^@?(\w+)$/', $twitter, $matches ) ) { // Check if twitter-account matches "(@)username".
    754734                $creator = '@' . $matches[1];
    755735        }
    … …  
    769749 */
    770750function fediverse_default_creator( $creator = '' ) {
     751        if ( $creator ) {
     752                return $creator;
     753        }
     754
    771755        $webfinger = opengraph_queried_author_meta( 'fediverse' );
    772756
    … …  
    813797
    814798/**
    815  * Include profile metadata for author pages.
     799 * Include profile metadata for author pages with the `profile` type.
    816800 *
    817801 * @link http://ogp.me/#type_profile
    … …  
    822806 */
    823807function opengraph_profile_metadata( $metadata ) {
    824         if ( is_author() ) {
     808        if ( is_author() && 'profile' === ( $metadata['og:type'] ?? '' ) ) {
    825809                $id = get_queried_object_id();
    826810
    … …  
    835819
    836820/**
    837  * Include article metadata for posts and pages.
     821 * Include article metadata for singular views with the `article` type.
    838822 *
    839823 * @link http://ogp.me/#type_article
    … …  
    844828 */
    845829function opengraph_article_metadata( $metadata ) {
    846         if ( ! is_singular() ) {
     830        if ( ! is_singular() || 'article' !== ( $metadata['og:type'] ?? '' ) ) {
    847831                return $metadata;
    848832        }
    … …  
    914898 * 'more' text as wp_trim_excerpt.
    915899 *
    916  * @param string $text The text to trim.
    917  * @param int    $length The maximum number of words to include.
     900 * @param string   $text   The text to trim.
     901 * @param int|null $length The maximum number of words to include. Defaults to
     902 *                         the `excerpt_length` filter, an explicit length is kept.
    918903 *
    919904 * @return string The trimmed text.
    920905 */
    921 function opengraph_trim_text( $text, $length = 55 ) {
    922         $excerpt_length = apply_filters( 'excerpt_length', $length );
    923         $excerpt_more   = apply_filters( 'excerpt_more', ' [...]' );
    924 
    925         return wp_trim_words( $text, $excerpt_length, $excerpt_more );
     906function opengraph_trim_text( $text, $length = null ) {
     907        if ( null === $length ) {
     908                $length = apply_filters( 'excerpt_length', 55 );
     909        }
     910
     911        $excerpt_more = apply_filters( 'excerpt_more', ' [...]' );
     912
     913        return wp_trim_words( $text, $length, $excerpt_more );
    926914}
    927915
  • opengraph/tags/3.1.0/readme.md

    r3712623 r3832003  
    44- Tags: open graph, opengraph, social, fediverse, bluesky
    55- Requires at least: 6.2
    6 - Tested up to: 7.1
    7 - Stable tag: 3.0.1
     6- Tested up to: 7.2
     7- Stable tag: 3.1.0
    88- Requires PHP: 7.4
    99- License: Apache License, Version 2.0
    … …  
    8484
    8585Project maintained on github at [pfefferle/wordpress-opengraph](https://github.com/pfefferle/wordpress-opengraph).
     86
     87### 3.1.0 (Nov 28, 2026)
     88
     89 - fixed a PHP warning on author archives combined with a category (#59)
     90 - keep the `fediverse:creator` of earlier filters (#64)
     91 - detect fallback images for the twitter card independent of their order (#64)
     92 - `article:*` and `profile:*` metadata follow `og:type`, so custom post types no longer get article tags (#64)
     93 - cap `og:image` after all filters (#64)
     94 - keep the title fallback of untitled posts at five words, independent of `excerpt_length` (#64)
    8695
    8796### 3.0.1 (Sep 25, 2026)
  • opengraph/trunk/opengraph.php

    r3712623 r3832003  
    66 * Author: Will Norris & Matthias Pfefferle
    77 * Author URI: https://github.com/pfefferle/wordpress-opengraph
    8  * Version: 3.0.1
     8 * Version: 3.1.0
    99 * License: Apache License, Version 2.0
    1010 * License URI: https://www.apache.org/licenses/LICENSE-2.0.html
    … …  
    4545                ' ',
    4646                array_map(
    47                         function ( $k, $v ) {
    48                                 return $k . ': ' . $v;
    49                         },
     47                        fn( $k, $v ) => $k . ': ' . $v,
    5048                        array_keys( $prefixes ),
    5149                        $prefixes
    … …  
    124122                        'fediverse',
    125123                        array(
    126                                 'creator' => array(),
     124                                'creator' => '',
    127125                        ),
    128126                ),
    129127        );
    130128
    131         foreach ( $namespaces as $namespace => list( $filter_prefix, $properties ) ) {
     129        foreach ( $namespaces as $namespace => [ $filter_prefix, $properties ] ) {
    132130                foreach ( $properties as $property => $default ) {
    133131                        /**
    … …  
    147145        }
    148146
     147        // Cap the images after all callbacks ran, so later ones can not exceed the maximum.
     148        $metadata['og:image'] = array_slice( array_unique( array_filter( (array) $metadata['og:image'] ) ), 0, opengraph_max_images() );
     149
    149150        /**
    150151         * Filter the Open Graph metadata.
    … …  
    217218                        $title = opengraph_default_description( null, 5 );
    218219                }
    219         } elseif ( is_author() ) {
    220                 $author = get_queried_object();
    221                 $title  = $author->display_name;
     220        } elseif ( is_author() && get_queried_object() instanceof WP_User ) {
     221                $title = get_queried_object()->display_name;
    222222        } elseif ( ( is_category() || is_tag() ) && single_term_title( '', false ) ) {
    223223                $title = single_term_title( '', false );
    … …  
    240240 */
    241241function opengraph_default_type( $type = '' ) {
    242         if ( empty( $type ) ) {
    243                 if ( is_singular( array( 'post', 'page' ) ) ) {
    244                         $type = 'article';
    245                 } elseif ( is_author() ) {
    246                         $type = 'profile';
    247                 } else {
    248                         $type = 'website';
    249                 }
    250         }
    251 
    252         return $type;
     242        if ( $type ) {
     243                return $type;
     244        }
     245
     246        if ( is_singular( array( 'post', 'page' ) ) ) {
     247                return 'article';
     248        }
     249
     250        if ( is_author() ) {
     251                return 'profile';
     252        }
     253
     254        return 'website';
    253255}
    254256
    … …  
    270272        }
    271273
    272         $max_images = opengraph_max_images();
    273         $limit      = $max_images - count( $image );
    274 
     274        $limit   = opengraph_max_images() - count( $image );
    275275        $post_id = get_queried_object_id();
    276276
    … …  
    281281        }
    282282
    283         $image = array_values( array_unique( array_filter( $image ) ) );
    284 
    285         return array_slice( $image, 0, $max_images );
     283        return array_values( array_unique( array_filter( $image ) ) );
    286284}
    287285
    … …  
    326324
    327325        foreach ( $sources as $source ) {
    328                 foreach ( call_user_func( $source, $post_id ) as $id ) {
     326                foreach ( $source( $post_id ) as $id ) {
    329327                        $id = (int) $id;
    330328
    … …  
    432430function opengraph_attachment_url_to_id( $src ) {
    433431        $img_id = attachment_url_to_postid( $src );
    434 
    435         if ( 0 === $img_id ) {
     432        if ( $img_id ) {
     433                return $img_id;
     434        }
     435
     436        if ( str_contains( $src, '?' ) ) {
    436437                $src    = strtok( $src, '?' );
    437438                $img_id = attachment_url_to_postid( $src );
    438         }
    439 
    440         if ( 0 === $img_id ) {
    441                 $src = preg_replace( '/-(?:\d+x\d+)(\.[a-zA-Z]+)$/', '$1', $src, 1, $count );
    442                 if ( $count > 0 ) {
    443                         $img_id = attachment_url_to_postid( $src );
    444                 }
    445         }
    446 
    447         if ( 0 === $img_id ) {
    448                 $src    = preg_replace( '/(\.[a-zA-Z]+)$/', '-scaled$1', $src );
     439                if ( $img_id ) {
     440                        return $img_id;
     441                }
     442        }
     443
     444        $src = preg_replace( '/-(?:\d+x\d+)(\.[a-zA-Z]+)$/', '$1', $src, 1, $count );
     445        if ( $count > 0 ) {
    449446                $img_id = attachment_url_to_postid( $src );
    450         }
    451 
    452         return $img_id;
     447                if ( $img_id ) {
     448                        return $img_id;
     449                }
     450        }
     451
     452        return attachment_url_to_postid( preg_replace( '/(\.[a-zA-Z]+)$/', '-scaled$1', $src ) );
    453453}
    454454
    … …  
    472472                        'orderby'        => 'menu_order ID',
    473473                        'posts_per_page' => opengraph_max_images(),
     474                        'no_found_rows'  => true,
    474475                )
    475476        );
    … …  
    490491        }
    491492
    492         $max_images = opengraph_max_images();
    493 
    494493        // Try site icon.
    495         if ( has_site_icon() ) {
    496                 $image[] = get_site_icon_url( 512 );
     494        $site_icon = get_site_icon_url( 512 );
     495        if ( $site_icon ) {
     496                return array( $site_icon );
    497497        }
    498498
    499499        // Try custom logo second.
    500         if ( empty( $image ) ) {
    501                 $custom_logo = wp_get_attachment_image_url( get_theme_mod( 'custom_logo' ), 'large' );
    502                 if ( $custom_logo ) {
    503                         $image[] = $custom_logo;
    504                 }
     500        $custom_logo = wp_get_attachment_image_url( get_theme_mod( 'custom_logo' ), 'large' );
     501        if ( $custom_logo ) {
     502                return array( $custom_logo );
    505503        }
    506504
    507505        // Try header images.
    508         if ( empty( $image ) ) {
    509                 if ( is_random_header_image() ) {
    510                         foreach ( get_uploaded_header_images() as $header_image ) {
    511                                 $image[] = $header_image['url'];
    512                                 if ( count( $image ) >= $max_images ) {
    513                                         break;
    514                                 }
    515                         }
    516                 } elseif ( get_header_image() ) {
    517                         $image[] = get_header_image();
    518                 }
    519         }
    520 
    521         return array_unique( $image );
     506        if ( is_random_header_image() ) {
     507                return array_unique( array_column( get_uploaded_header_images(), 'url' ) );
     508        }
     509
     510        $header_image = get_header_image();
     511
     512        return $header_image ? array( $header_image ) : array();
    522513}
    523514
    … …  
    607598 * bloginfo description.
    608599 *
    609  * @param string $description The current description.
    610  * @param int    $length      The maximum length of the description.
     600 * @param string   $description The current description.
     601 * @param int|null $length      The maximum number of words. Defaults to the
     602 *                              `excerpt_length` filter.
    611603 *
    612604 * @return string The description.
    613605 */
    614 function opengraph_default_description( $description = '', $length = 55 ) {
     606function opengraph_default_description( $description = '', $length = null ) {
    615607        if ( $description ) {
    616608                return $description;
    … …  
    627619                }
    628620        } elseif ( is_author() ) {
    629                 $id          = get_queried_object_id();
    630                 $description = get_user_meta( $id, 'description', true );
     621                $description = get_user_meta( get_queried_object_id(), 'description', true );
    631622        } elseif ( ( is_category() || is_tag() ) && term_description() ) {
    632623                $description = term_description();
    … …  
    674665 */
    675666function opengraph_default_locale( $locale = '' ) {
    676         if ( empty( $locale ) ) {
    677                 $locale = get_locale();
    678         }
    679 
    680         return $locale;
     667        return $locale ? $locale : get_locale();
    681668}
    682669
    … …  
    688675 * whether a singular post has one: `summary_large_image` if it does,
    689676 * `summary` otherwise. Fallback images (site icon, logo, header) are not
    690  * the post's own images and look better in a small card.
     677 * the post's own images and look better in a small card, so the card is only
     678 * large if at least one image is not a fallback image.
    691679 *
    692680 * @param string $card     The current card type.
    … …  
    700688        }
    701689
    702         if ( ! is_singular() || empty( $metadata['og:image'] ) ) {
    703                 return 'summary';
    704         }
    705 
    706         if ( opengraph_fallback_image() === $metadata['og:image'] ) {
     690        if ( ! is_singular() || empty( $metadata['og:image'] ) || ! array_diff( (array) $metadata['og:image'], opengraph_fallback_image() ) ) {
    707691                return 'summary';
    708692        }
    … …  
    744728        $twitter = opengraph_queried_author_meta( 'twitter' );
    745729
    746         if ( ! $twitter ) {
    747                 return $creator;
    748         }
    749 
    750730        // Check if twitter-account matches "http://twitter.com/username".
    751731        if ( preg_match( '/^http:\/\/twitter\.com\/(#!\/)?(\w+)/i', $twitter, $matches ) ) {
    752732                $creator = '@' . $matches[2];
    753         } elseif ( preg_match( '/^@?(\w+)$/i', $twitter, $matches ) ) { // Check if twitter-account matches "(@)username".
     733        } elseif ( preg_match( '/^@?(\w+)$/', $twitter, $matches ) ) { // Check if twitter-account matches "(@)username".
    754734                $creator = '@' . $matches[1];
    755735        }
    … …  
    769749 */
    770750function fediverse_default_creator( $creator = '' ) {
     751        if ( $creator ) {
     752                return $creator;
     753        }
     754
    771755        $webfinger = opengraph_queried_author_meta( 'fediverse' );
    772756
    … …  
    813797
    814798/**
    815  * Include profile metadata for author pages.
     799 * Include profile metadata for author pages with the `profile` type.
    816800 *
    817801 * @link http://ogp.me/#type_profile
    … …  
    822806 */
    823807function opengraph_profile_metadata( $metadata ) {
    824         if ( is_author() ) {
     808        if ( is_author() && 'profile' === ( $metadata['og:type'] ?? '' ) ) {
    825809                $id = get_queried_object_id();
    826810
    … …  
    835819
    836820/**
    837  * Include article metadata for posts and pages.
     821 * Include article metadata for singular views with the `article` type.
    838822 *
    839823 * @link http://ogp.me/#type_article
    … …  
    844828 */
    845829function opengraph_article_metadata( $metadata ) {
    846         if ( ! is_singular() ) {
     830        if ( ! is_singular() || 'article' !== ( $metadata['og:type'] ?? '' ) ) {
    847831                return $metadata;
    848832        }
    … …  
    914898 * 'more' text as wp_trim_excerpt.
    915899 *
    916  * @param string $text The text to trim.
    917  * @param int    $length The maximum number of words to include.
     900 * @param string   $text   The text to trim.
     901 * @param int|null $length The maximum number of words to include. Defaults to
     902 *                         the `excerpt_length` filter, an explicit length is kept.
    918903 *
    919904 * @return string The trimmed text.
    920905 */
    921 function opengraph_trim_text( $text, $length = 55 ) {
    922         $excerpt_length = apply_filters( 'excerpt_length', $length );
    923         $excerpt_more   = apply_filters( 'excerpt_more', ' [...]' );
    924 
    925         return wp_trim_words( $text, $excerpt_length, $excerpt_more );
     906function opengraph_trim_text( $text, $length = null ) {
     907        if ( null === $length ) {
     908                $length = apply_filters( 'excerpt_length', 55 );
     909        }
     910
     911        $excerpt_more = apply_filters( 'excerpt_more', ' [...]' );
     912
     913        return wp_trim_words( $text, $length, $excerpt_more );
    926914}
    927915
  • opengraph/trunk/readme.md

    r3712623 r3832003  
    44- Tags: open graph, opengraph, social, fediverse, bluesky
    55- Requires at least: 6.2
    6 - Tested up to: 7.1
    7 - Stable tag: 3.0.1
     6- Tested up to: 7.2
     7- Stable tag: 3.1.0
    88- Requires PHP: 7.4
    99- License: Apache License, Version 2.0
    … …  
    8484
    8585Project maintained on github at [pfefferle/wordpress-opengraph](https://github.com/pfefferle/wordpress-opengraph).
     86
     87### 3.1.0 (Nov 28, 2026)
     88
     89 - fixed a PHP warning on author archives combined with a category (#59)
     90 - keep the `fediverse:creator` of earlier filters (#64)
     91 - detect fallback images for the twitter card independent of their order (#64)
     92 - `article:*` and `profile:*` metadata follow `og:type`, so custom post types no longer get article tags (#64)
     93 - cap `og:image` after all filters (#64)
     94 - keep the title fallback of untitled posts at five words, independent of `excerpt_length` (#64)
    8695
    8796### 3.0.1 (Sep 25, 2026)
Note: See TracChangeset for help on using the changeset viewer.