I am Working on WordPress project , which required me to manipulate the existing plugin's WP_Query
On the front-end side , I have 3 Dropdown , in which 2 of them I have customizes with tax_query and using plugin's filter , I don't know how to customize with meta_query ( check screenshot )
<?php
add_filter( 'learndash_ld_course_list_query_args', 'filter__learndash_ld_course_list_query_args', 10, 2 );
function filter__learndash_ld_course_list_query_args( $filter, $atts ) {
if ( ! isset( $filter['tax_query'] ) ) {
$filter['tax_query'] = array();
}
if ( ! isset( $filter['meta_query'] ) ) {
$filter['meta_query'] = array();
}
if ( isset( $_GET['catid'] ) && ! empty( $_GET['catid'] ) ) {
$filter['tax_query'][] = array(
'taxonomy' => 'ld_course_category',
'field' => 'term_id',
'terms' => intval( $_GET['catid'] ),
);
}
if ( isset( $_GET['taxid'] ) && ! empty( $_GET['taxid'] ) ) {
$filter['tax_query'][] = array(
'taxonomy' => $atts['course_taxonomy'],
'field' => 'term_id',
'terms' => intval( $_GET['taxid'] ),
);
}
if ( isset( $_GET['priceid'] ) && ! empty( $_GET['priceid'] ) ) {
$filter['meta_query'][] = array(
'key' => '_sfwd-courses',
'value' => '',
'compare' => 'LIKE',
);
}
if ( count( $filter['tax_query'] ) > 1 ) {
$filter['tax_query']['relation'] = 'AND';
}
//echo "<pre>"; print_r($filter);
return $filter;
}
But I am stuck in meta_query , because it stores data in serialize array ( Check screenshots )
What should I write here to compare 'value' => '',
??