/* 
Theme Name: Hello Elementor Child
Theme URI: https://github.com/elementor/hello-theme-child/
Description: Hello Elementor Child is a child theme of Hello Elementor, created by Elementor team
Author: Elementor Team
Author URI: https://elementor.com/
Template: hello-elementor
Version: 2.0.0add_filter('ajax_query_attachments_args', 'custom_search_media_by_alt_text', 10, 1);
function custom_search_media_by_alt_text($query) {
    if (!empty($query['s'])) {
        global $wpdb;
        $search = $query['s'];

        // חיפוש לפי כותרת, תיאור, caption רגיל
        $args = get_posts([
            'post_type'   => 'attachment',
            'post_status' => 'inherit',
            'numberposts' => -1,
            's'           => $search,
            'fields'      => 'ids',
        ]);

        // חיפוש לפי alt
        $alt_ids = $wpdb->get_col($wpdb->prepare("
            SELECT post_id FROM $wpdb->postmeta
            WHERE meta_key = '_wp_attachment_image_alt'
            AND meta_value LIKE %s
        ", '%' . $wpdb->esc_like($search) . '%'));

        // מיזוג תוצאות
        $query['post__in'] = array_unique(array_merge($args, $alt_ids));
    }

    return $query;
}

Text Domain: hello-elementor-child
License: GNU General Public License v3 or later.
License URI: https://www.gnu.org/licenses/gpl-3.0.html
Tags: flexible-header, custom-colors, custom-menu, custom-logo, editor-style, featured-images, rtl-language-support, threaded-comments, translation-ready
*/

/* Add your custom styles here */