Well, this happened on my local dev server, I’m developing theme from Underscore and using Options Framework plugin and few others. Pages are not in database, I deactivated all plugins, changed themes and still the same. Since this is in development, I re-installed WordPress and tried different combinations (deactivating plugins, change themes…) and for now is ok. What I asked earlier I want to display pages in default language in drop-down of options framework, also for categories, and I’m using two wpdb selects. I suppose with select queries it’s not possible to delete pages?! Or is it?
Here is a query for categories:
$options_categories = array();
$pll_hr = 'pll_hr';
$pll_hr_id = $wpdb->get_var($wpdb->prepare("SELECT t.term_id FROM $wpdb->terms AS t"
. " WHERE t.slug = %s", $pll_hr));
$mycats = $wpdb->get_results($wpdb->prepare("SELECT t.*, tt.* FROM $wpdb->terms AS t"
. " INNER JOIN $wpdb->term_taxonomy AS tt ON t.term_id = tt.term_id"
. " INNER JOIN $wpdb->term_relationships AS tr ON tr.object_id = t.term_id"
. " WHERE tt.taxonomy IN ('category')"
. " AND tr.term_taxonomy_id = $pll_hr_id"
. " AND tt.count > 0"
. "", $pll_hr_id));
foreach ($mycats as $cat) {
$options_categories[$cat->term_id] = $cat->name;
}
Here is a query for pages:
$options_pages = array();
//$options_pages_obj = get_pages('sort_column=post_parent,menu_order');
$options_pages[''] = 'Odaberite stranicu:';
$args = array(
'post_type' => 'page',
'orderby' => 'title',
'order' => 'ASC',
'lang' => 'hr'
);
$pages_query = new WP_Query($args);
while ($pages_query->have_posts()) : $pages_query->the_post();
$options_pages[$post->ID] = $post->post_title;
endwhile;
wp_reset_postdata();