Hi Shane,
I tried the 'posts_per_page' => 10 and it's working fine.
On the other hand, I'm stuck on the sorting. Only the sorting defined in the Views is working. The function does not change anything !
Here's what I'm getting in the Toolset debug :
Filter arguments before the query using wpv_filter_query
wpv_filter_query
Array
(
[post_type] => product
[meta_query] => Array
(
[relation] => AND
[jour_clause] => Array
(
[key] => wpcf-jour-cours
[compare] => EXISTS
)
[heure_clause] => Array
(
[key] => wpcf-heure-debut-cours
[compare] => EXISTS
)
[minute_clause] => Array
(
[key] => wpcf-minute-debut-cours
[compare] => EXISTS
)
)
[0] => Array
(
[key] => wpcf-type-de-produit
[value] => Cours
[compare] => LIKE
)
[orderby] => meta_value
[meta_key] => wpcf-jour-cours => Sorting defined in the Views
[order] => ASC
)
Filter the returned query using wpv_filter_query_post_process
wpv_filter_query_post_process
WP_Query Object
(
[query] => Array
(
[post_type] => product
[meta_query] => Array
(
[relation] => AND
[jour_clause] => Array
(
[key] => wpcf-jour-cours
[compare] => EXISTS
)
[heure_clause] => Array
(
[key] => wpcf-heure-debut-cours
[compare] => EXISTS
)
[minute_clause] => Array
(
[key] => wpcf-minute-debut-cours
[compare] => EXISTS
)
)
[0] => Array
(
[key] => wpcf-type-de-produit
[value] => Cours
[compare] => LIKE
)
[orderby] => meta_value
[meta_key] => wpcf-jour-cours
[order] => ASC
)
[query_vars] => Array
(
[post_type] => product
[meta_query] => Array
(
[relation] => AND
[jour_clause] => Array
(
[key] => wpcf-jour-cours
[compare] => EXISTS
)
[heure_clause] => Array
(
[key] => wpcf-heure-debut-cours
[compare] => EXISTS
)
[minute_clause] => Array
(
[key] => wpcf-minute-debut-cours
[compare] => EXISTS
)
)
[0] => Array
(
[key] => wpcf-type-de-produit
[value] => Cours
[compare] => LIKE
)
[orderby] => meta_value
[meta_key] => wpcf-jour-cours
[order] => ASC
[error] =>
[m] =>
[p] => 0
[post_parent] =>
[subpost] =>
[subpost_id] =>
[attachment] =>
[attachment_id] => 0
[name] =>
[static] =>
[pagename] =>
[page_id] => 0
[second] =>
[minute] =>
[hour] =>
[day] => 0
[monthnum] => 0
[year] => 0
[w] => 0
[category_name] =>
[tag] =>
[cat] =>
[tag_id] =>
[author] =>
[author_name] =>
[feed] =>
[tb] =>
[paged] => 0
[meta_value] =>
[preview] =>
[s] =>
[sentence] =>
[title] =>
[fields] =>
[menu_order] =>
[embed] =>
[category__in] => Array
(
)
[category__not_in] => Array
(
)
[category__and] => Array
(
)
[post__in] => Array
(
)
[post__not_in] => Array
(
)
[post_name__in] => Array
(
)
[tag__in] => Array
(
)
[tag__not_in] => Array
(
)
[tag__and] => Array
(
)
[tag_slug__in] => Array
(
)
[tag_slug__and] => Array
(
)
[post_parent__in] => Array
(
)
[post_parent__not_in] => Array
(
)
[author__in] => Array
(
)
[author__not_in] => Array
(
)
[ignore_sticky_posts] =>
[suppress_filters] =>
[cache_results] => 1
[update_post_term_cache] => 1
[lazy_load_term_meta] => 1
[update_post_meta_cache] => 1
[posts_per_page] => 10
[nopaging] =>
[comments_per_page] => 50
[no_found_rows] =>
)
[tax_query] => WP_Tax_Query Object
(
[queries] => Array
(
)
[relation] => AND
[table_aliases:protected] => Array
(
)
[queried_terms] => Array
(
)
[primary_table] => wp_posts
[primary_id_column] => ID
)
[meta_query] => WP_Meta_Query Object
(
[queries] => Array
(
[0] => Array
(
[key] => wpcf-jour-cours
)
[1] => Array
(
[jour_clause] => Array
(
[key] => wpcf-jour-cours
[compare] => EXISTS
)
[heure_clause] => Array
(
[key] => wpcf-heure-debut-cours
[compare] => EXISTS
)
[minute_clause] => Array
(
[key] => wpcf-minute-debut-cours
[compare] => EXISTS
)
[relation] => AND
)
[relation] => AND
)
[relation] => AND
[meta_table] => wp_postmeta
[meta_id_column] => post_id
[primary_table] => wp_posts
[primary_id_column] => ID
[table_aliases:protected] => Array
(
[0] => wp_postmeta
[1] => mt1
[2] => mt2
[3] => mt3
)
[clauses:protected] => Array
(
[wp_postmeta] => Array
(
[key] => wpcf-jour-cours
[compare] => =
[alias] => wp_postmeta
[cast] => CHAR
)
[jour_clause] => Array
(
[key] => wpcf-jour-cours
[compare] => EXISTS
[alias] => mt1
[cast] => CHAR
)
[heure_clause] => Array
(
[key] => wpcf-heure-debut-cours
[compare] => EXISTS
[alias] => mt2
[cast] => CHAR
)
[minute_clause] => Array
(
[key] => wpcf-minute-debut-cours
[compare] => EXISTS
[alias] => mt3
[cast] => CHAR
)
)
[has_or_relation:protected] =>
)
[date_query] =>
[request] => SELECT SQL_CALC_FOUND_ROWS wp_posts.ID FROM wp_posts INNER JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id ) INNER JOIN wp_postmeta AS mt1 ON ( wp_posts.ID = mt1.post_id ) INNER JOIN wp_postmeta AS mt2 ON ( wp_posts.ID = mt2.post_id ) INNER JOIN wp_postmeta AS mt3 ON ( wp_posts.ID = mt3.post_id ) WHERE 1=1 AND (
wp_postmeta.meta_key = 'wpcf-jour-cours'
AND
(
mt1.meta_key = 'wpcf-jour-cours'
AND
mt2.meta_key = 'wpcf-heure-debut-cours'
AND
mt3.meta_key = 'wpcf-minute-debut-cours'
)
) AND wp_posts.post_type = 'product' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'wc-pending' OR wp_posts.post_status = 'wc-processing' OR wp_posts.post_status = 'wc-on-hold' OR wp_posts.post_status = 'wc-completed' OR wp_posts.post_status = 'wc-cancelled' OR wp_posts.post_status = 'wc-refunded' OR wp_posts.post_status = 'wc-failed' OR wp_posts.post_status = 'private') GROUP BY wp_posts.ID ORDER BY wp_postmeta.meta_value ASC LIMIT 0, 10
Let me know
Regards
Pat