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.
Related Posts:
- Find only those galleries with images
- Is it possible to query all posts that don’t have an attachment?
- How to paginate wordpress [gallery] shortcode?
- How to get Page/Post Gallery attachment images in order they are set in backend using WP_Query()?
- Count the number of images uploded on the website
- How to paginate attachments in a secondary query as gallery?
- How do I exclude all images from a wp_query?
- Get attachment by slug
- get images attached to post
- How to display images in related posts?
- post thumb nail
- query attachments of parent page if attachments of current page are smaller than …
- wp_query for displaying attachments with a tag
- WP Query search for attachments and their exact title
- Gallery shortcode numerical sorting
- Better wordpress attachment query than this
- How to add WordPress featured image via SQL
- Display all attached image of every post of custom post type and link to original post
- Insert images into wordpress post with a query
- WP_Query: attachment image in “full” size?
- Change database image location for transportability
- WP query retrieve the src of attached image
- Trying to use “Medium” featured image for custom post type on home page
- wp_get_attachment_image not to get the post_thumbnaill
- How To Query All Attachment Images Found In Post Galleries
- Some images not being returned with wp_get_attachment_image
- Pull Instagram images into an existing loop?
- Using a custom WP_Query with get_template_part loop
- How to make WP_Query ‘post__in’ accept an array?
- WP_QUERY Get posts by category and similar name (Like)
- Is it possible to orderby multiple meta_keys when using meta_value_num?
- Cropped featured image replaces original image in gallery
- Is it possible to wrap Geo Location search around WP_Query?
- Merging multiple wp_query objects
- Query causing load because of SQL_CALC_FOUND_ROWS post counting?
- Using custom meta_query with relation not working as expected
- Only show first post to match certain criteria within WP_Query
- What is an efficient way to query based on post_meta?
- How to remove title attribute from gallery links and images
- Pagination wont work with search results template [duplicate]
- Pagination Not working on Home Page with 2 Query
- Sort by meta key on archive page
- What are the differences between “Latest Posts” and “Static Page”?
- Retrieve or Query Pages by ID
- WordPress Query is taking more then 20 second and stuck on creating index
- Modifying raw $_POST data early in the lifecycle
- Searching through different categories on different pages code is not working
- Difficulty with rewrite rules
- Show selected images on top in Media Manager
- Most Flexible Photo Gallery Plugin? [closed]
- How to make this WP_Query run faster on a WordPress website?
- Complex date range with WP_Query and BETWEEN
- Attachment changing page’s permalink – $post not resetting?
- showing all search result in one template
- List custom taxonomy terms sharing posts with a term from a second custom taxonomy
- Make (post) query a clickable link
- How can I filter by slug depending on language selection
- Ajax WP_Query reutrns no results on author.php
- Large AND OR query timing out
- WP_query wp_posts_counts returns only count of admin and not users
- Categorising search results based on Custom Fields
- Custom taxonomy.php not working
- “tax_query” parameter is ignored when “p” parameter is set in WP_Query
- Conditional sorting with variable using WP Query
- How can i share WP_Query between multiple functions?
- Advanced WP_Query with meta_query, orderby?
- Autosort uploads in galleries by filename
- How to display original unmodified thumbnail
- One picture belonging different galleries?
- I need help using pre_get_comments to limit comments in the comments admin screen
- WP_query only displays one of my custom post type entries
- How to search for meta_query LIKE or tax_query LIKE and grab these posts on search results?
- How to create dynamic value in WP_Query meta_query
- WP_Query with multiple orderby NOT working with ASC and DESC, what’s wrong?
- How to access $wp_query object from array of posts given by get_posts?
- Links in the_content not linked
- how do I write this wp_query select statement?
- Post incorrectly excluded when using “category__in”?
- How to search by slug and old slug in single API
- Categories In English version showing not canonical URL, instead shows query search result
- Multiple meta_query not returning rows
- Displaying all the images from all of my articles
- What code to use in an array to call the current sub-category?
- Query against multiple locations within single custom post type post
- Order by meta date with a thousanth of a second defaults to post order
- How to debug none working search query?
- Order by Date Custom Field
- How to make a search query if not found in post table then search in postmeta table?
- In which file to use $wpdb and its functions for database operations and queries in wordpress?
- Show All with Isotope
- active link for most recent post on vertical tabs
- How to list posts of a given format
- option select form always deleting the sql query
- WP_Query to show post from a category OR custom field – Not 100% answered
- How do I display posts with specific value in a custom field into my loop?
- Orderby Meta Value and Query from Meta Query
- WP Query to order posts by multiple meta fields
- Order by multiple meta keys on wordpress
- Sort posts in dashboard using custom field; also include posts where field isn’t set
- Adding different classes to different images depending on size for fine control of image layout in posts