There’s an infinite number of approaches to this. Here’s a couple that come to mind:
1) You could easily use something like strpos()
or a regular expression to see if $image[0]
contains a keyword. This approach would be a little less than ideal in my opinion.
2) Add a checkbox or ‘tag’ field to the media manager using attachment_fields_to_save
and attachment_fields_to_edit
filters. Then reference that field when querying the images.
3) Create a new section within WP Admin using add_menu_page
and add_submenu_page
functions. Select, organize, etc.. from there. This route allows for the most customization and keeps management in a single place. In fact this paired with the second option would be the way to go in my opinion. If you’re looking to learn how to create a plugin and use several hooks, functions and filters this would probably be an excellent project.