public function search( WP_REST_Request $request ) { $term = sanitize_text_field( $request->get_param('search') ); if ( empty( $term ) ) { return [ 'ok' => false, 'message' => 'Kein Suchbegriff' ]; } error_log( '!!! SEARCH: ' . $term ); $results = []; $found_ids = []; /* |-------------------------------------------------------------------------- | SONDERFALL 1: Chipnummer (15-stellige Zahl) |-------------------------------------------------------------------------- */ if ( preg_match('/^\d{15}$/', $term) ) { global $wpdb; $id = $wpdb->get_var( $wpdb->prepare( " SELECT ID FROM {$wpdb->posts} WHERE post_type = 'product' AND post_status = 'publish' AND ( post_content LIKE %s OR post_excerpt LIKE %s ) LIMIT 1 ", '%Chip:%' . $wpdb->esc_like($term) . '%', '%Chip:%' . $wpdb->esc_like($term) . '%' ) ); if ( $id ) { $post = get_post($id); $results[] = $this->format_result( $post ); } return [ 'ok' => true, 'search_term' => $term, 'count' => count($results), 'results' => $results ]; } /* |-------------------------------------------------------------------------- | SONDERFALL 2: Ear / OM Nummer (reine Zahlen) |-------------------------------------------------------------------------- */ if ( preg_match('/^\d+$/', $term) ) { global $wpdb; $id = $wpdb->get_var( $wpdb->prepare( " SELECT ID FROM {$wpdb->posts} WHERE post_type = 'product' AND post_status = 'publish' AND ( post_content LIKE %s OR post_excerpt LIKE %s ) LIMIT 1 ", '%OM:%' . $wpdb->esc_like($term) . '%', '%OM:%' . $wpdb->esc_like($term) . '%' ) ); if ( $id ) { $post = get_post($id); $results[] = $this->format_result( $post ); } return [ 'ok' => true, 'search_term' => $term, 'count' => count($results), 'results' => $results ]; } /* |-------------------------------------------------------------------------- | SONDERFALL 3: Kennel Attribut |-------------------------------------------------------------------------- */ if ( strlen($term) >= 3 ) { $kennel_query = new WP_Query([ 'post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => 8, 'tax_query' => [ [ 'taxonomy' => 'pa_kennel', 'field' => 'slug', 'terms' => sanitize_title($term), ] ] ]); foreach ($kennel_query->posts as $post) { $results[] = $this->format_result( $post ); } if ( ! empty($results) ) { return [ 'ok' => true, 'search_term' => $term, 'count' => count($results), 'results' => $results ]; } } EM-Tore für unsere Hunde in Rumänien | ProDog Romania e.V.

Bitte schenkt uns ganz viele EM-Tore für die deutsche und die rumänische Nationalmannschaft!!
Jedes Tor soll uns pro Teilnehmer 1 Euro einbringen!
____________________________________

In den spendenarmen Sommermonaten wird es wieder extrem schwer für Futter, Kastrationen, Impfungen und tierärztliche Behandlungen für 2000 Hunde aufzukommen!

Abhilfe sollen die deutsche und die rumänische Nationalmannschaft schaffen – und IHR 🙂 !!

Wir suchen ganz viele hilfsbereite Leute,
• die nach Ende der EM
• 1 Euro
• pro Tor, das die deutsche und die rumänische
Mannschaft geschossen haben
• auf unser Konto einzahlen.
________________________________

Einzahlung bitte auf unser Spendenkonto:
ProDogRomania e. V.
IBAN: DE28460500010049006810
BIC: WELADED1SIE

oder online/PAYPAL:
https://bis2024.prodogromania.de/allgemeine-spende

Wir wünschen Allen spannende und erfolgreiche EM-Tage für unsere rumänischen Hunde.
Euer Team ProDogRomania

13423704_1127515380653985_4241082111328970078_n

Auswahl einschränken

[woof sid="prodogfilter" autohide=0 ]