Make WordPress Core

Changeset 57845

Timestamp:
03/15/2024 04:35:18 PM (5 months ago)
Author:
joedolson
Message:

Media: Fall back to available icons if SVG media icons not found.

Follow up to [57687]. If no icons of the preferred type are available, then the icon array should return the collection of valid icons found, rather than an empty array.

Props sabernhardt, swissspidy, sabernhardt, antpb, joedolson.
Fixes #60740.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r57701 r57845  
    68696869            $dirs       = apply_filters( 'icon_dirs', array( $icon_dir => $icon_dir_uri ) );
    68706870            $icon_files = array();
     6871
    68716872            while ( $dirs ) {
    68726873                $keys = array_keys( $dirs );
     
    68886889                            continue;
    68896890                        }
     6891
    68906892                        if ( $ext === $preferred_ext ) {
    68916893                            $icon_files[ "$dir/$file" ] = "$uri/$file";
     
    68946896                    closedir( $dh );
    68956897                }
     6898
     6899
     6900
     6901
    68966902            }
    68976903            wp_cache_add( 'icon_files', $icon_files, 'default', 600 );
Note: See TracChangeset for help on using the changeset viewer.