Plugin Directory

Changeset 3647705


Ignore:
Timestamp:
08/14/2026 04:20:46 PM (2 months ago)
Author:
austyfrosty
Message:

Updating readme/assets from GitHub

File:
1 edited

Legend:

Unmodified
Added
Removed
  • featured-image-column/trunk/readme.txt

    r3621807 r3647705  
    11=== Featured Image Column ===
    2 Contributors: austyfrosty, DH-Shredder, MartyThornley, chrisjean,
     2Contributors: austyfrosty, dh-shredder, martythornley, chrisjean,
    33Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=XQRHECLPQ46TE
    44Tags: featured image, admin, column
    … …  
    77Stable tag: trunk
    88Requires PHP: 8.0
     9License: GPLv2 or later
     10License URI: https://www.gnu.org/licenses/gpl-2.0.html
    911
    1012Adds a column to any post type edit screen with the featured image if it exists.
    … …  
    2022= Example actions/filters =
    2123
     24**Change thumbnail size**
     25`
     26function my_custom_featured_image_size(mixed $size, int $post_id): mixed {
     27        if (in_array($post_id, [1, 5, 23], true)) {
     28                return [65. 65];
     29        }
     30
     31        return $size;
     32}
     33add_filter('featured_image_post_thumbnail_size', 'my_custom_featured_image_size', 10, 2);
     34`
     35
    2236**Add support for a custom default image**
    2337`
    24 function my_custom_featured_image_column_image( $image ) {
    25         if ( !has_post_thumbnail() ) {
     38function my_custom_featured_image_column_image(string $image, int $post_id): string {
     39        if (in_array($post_id, [1, 5, 23], true)) {
    2640                return trailingslashit( get_stylesheet_directory_uri() ) . 'images/featured-image.png';
    2741        }
    … …  
    2943        return $image;
    3044}
    31 add_filter( 'featured_image_column_default_image', 'my_custom_featured_image_column_image' );
     45add_filter('featured_image_column_default_image', 'my_custom_featured_image_column_image', 10, 2);
    3246`
    3347
    … …  
    3549`
    3650function frosty_featured_image_column_init_func() {
    37         add_filter( 'featured_image_column_post_types', 'frosty_featured_image_column_remove_post_types', 11 ); // Remove
     51        add_filter('featured_image_column_post_types', 'frosty_featured_image_column_remove_post_types', 11); // Remove
    3852}
    39 add_action( 'featured_image_column_init', 'frosty_featured_image_column_init_func' );
     53add_action('featured_image_column_init', 'frosty_featured_image_column_init_func');
    4054
    41 function frosty_featured_image_column_remove_post_types( $post_types ) {
    42         foreach( $post_types as $key => $post_type ) {
    43                 if ( 'post-type' === $post_type ) // Post type you'd like removed. Ex: 'post' or 'page'
    44                         unset( $post_types[$key] );
     55function frosty_featured_image_column_remove_post_types($post_types) {
     56        foreach($post_types as $key => $post_type) {
     57                if ($post_type === 'post-type') // Post type you'd like removed. Ex: 'post' or 'page'
     58                        unset($post_types[$key]);
    4559        }
    4660        return $post_types;
    … …  
    6276
    6377== Changelog ==
     78
     79= Version 1.3.0 (2026/08/14) =
     80
     81* New compressed default image: (before) 4.2 K → (after) 235 B
     82* Add: filter to allow modification of post_thumbnail size `featured_image_post_thumbnail_size` (defaults to [50,50]).
     83* Add: pass (int) post_id to default image filter as second param.
     84* Qualifier(s) can be replaced with an import.
     85* Fix: The (readme) Contributors field should only contain WordPress.org usernames.
     86* Fix: The (readme) License field is missing. A GPLv2 or later compatible license should be specified.
    6487
    6588= Version 1.2.0 (2026/07/24) =
Note: See TracChangeset for help on using the changeset viewer.