I am working on an additional filter to hide sold items. I have been working through the documentation, but I have gotten a little lost.
I am trying to filter on the “is_sold” meta field, but I’m not sure if I’m doing this correctly. The snippet is active, but it seems to not be working when I load the [adverts_list] page.
add_filter( "adverts_form_load", "hide_sold_items_form_load" );
function hide_sold_items_form_load( $form ) {
if( $form["name"] != "advert" ) {
return $form;
}
$form["field"][] = array(
"name" => "hide_sold_items_radio",
"type" => "adverts_field_radio",
"order" => 25,
"label" => "Hide Sold Items Radio",
"is_required" => false,
"validator" => array( ),
"max_choices" => 2,
"options" => array( ),
"meta" => array (
"is_sold" => "false"
)
);
return $form;
}
-
This reply was modified 6 years, 2 months ago by
beedaan.