$wpdb->prepare returns empty array
Try with: function getComponents($page_id, $currentLanguage) { global $wpdb; $result = $wpdb->get_results($wpdb->prepare( ” SELECT id, post_content, post_title, post_excerpt, post_name, m1.meta_value AS ‘template’, m2.meta_value AS ‘home_description’ FROM {$wpdb->posts} p JOIN wp_term_relationships r ON p.ID = r.object_id JOIN wp_terms t ON r.term_taxonomy_id = t.term_id WHERE t.slug=%s AND post_parent = %d AND post_type=”page” AND post_status=”publish” ORDER BY menu_order ASC … Read more