Support » Fixing WordPress » The search engine in the media files

  • svit7lana


    The search engine in the admin panel does not see the alt text of media files. How can this be fixed? = Пошукова система в панелі адміністратора не бачить альтернативний текст медіа-файлів. Як це можна виправити? = Поисковая система в панели администратора не видит альтернативный текст медиа-файлов. Как это можно исправить?

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Moderator bcworkz


    The solution requires custom code. I cannot provide that for you, but I can supply pertinent details: Hook the ‘ajax_query_attachments_args’ filter and modify the WP_Query args to also require that the search term be found as a meta value keyed by “_wp_attachment_image_alt”. This will apply AND logic to other criteria. If you wish OR logic, the eventual SQL query can be altered through the ‘posts_request’ filter.

    This latter filter is applied to all requests. To limit its application, add the callback from the ‘ajax_query_attachments_args’ callback. Have the ‘posts_request’ filter callback remove itself once it has been called to prevent unwanted interference with other requests.

Viewing 1 replies (of 1 total)
  • The topic ‘The search engine in the media files’ is closed to new replies.