admin管理员组

文章数量:1024680

I'm trying to replace some icons for files in the media library based on the file-name / file-path. I want to give each file that contains the filename "example-name" a different icon in the media library.

I have no idea where to start, if someone can help me on track I'll happilly post the finished solution here, cause on the whole internet I couldn't find any.

pseudo-code

<?php foreach ($mediaFiles as $mediaFile) {
    if (strstr($mediaFile['path'], 'example-name')) $mediaFile['icon'] = 'custom-icon.jpg';
} ?>

I'm trying to replace some icons for files in the media library based on the file-name / file-path. I want to give each file that contains the filename "example-name" a different icon in the media library.

I have no idea where to start, if someone can help me on track I'll happilly post the finished solution here, cause on the whole internet I couldn't find any.

pseudo-code

<?php foreach ($mediaFiles as $mediaFile) {
    if (strstr($mediaFile['path'], 'example-name')) $mediaFile['icon'] = 'custom-icon.jpg';
} ?>

本文标签: galleryCustom icons in media library