add check to update transient for default icons check (#149)

This commit is contained in:
Andy Fragen 2025-07-05 16:52:57 -07:00 committed by GitHub
parent 6fcfc7f62b
commit e677821d76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -24,6 +24,10 @@ function bootstrap() {
* @return stdClass * @return stdClass
*/ */
function set_default_icon( $transient ) { function set_default_icon( $transient ) {
if ( ! property_exists( $transient, 'response' ) ) {
return $transient;
}
foreach ( $transient->response as $updates ) { foreach ( $transient->response as $updates ) {
$url = plugin_dir_url( PLUGIN_FILE ) . 'inc/icons/svg.php'; $url = plugin_dir_url( PLUGIN_FILE ) . 'inc/icons/svg.php';
$url = add_query_arg( 'color', set_random_color(), $url ); $url = add_query_arg( 'color', set_random_color(), $url );