I have some jquery javascript in the frontend that is helping me display a map. I want to query my custom post type "mountains" basis an "id" of, say, 106. I can do this ok with PHP as follows;
$osm_geometry = get_query_var('osm_geometry'); // get from url or just feed in manually.
$args = array(
'numberposts' => -1,
'post_type' => 'mountains',
'meta_key' => 'osm_geometry',
'meta_value' => $osm_geometry
);
$the_query = new WP_Query( $args );
Maybe the below is the same as above in acf javascriupt api?
// available args
var args = {
key: '', // The field key (field_123)
name: '', // The field name (my_field)
type: '', // The field type (image, text)
is: '', // jQuery selector (:visible)
parent: false, // jQuery element to search within
sibling: false, // jQuery element to search alongside
limit: false, // limit the number of jQuery elements returned
};
// example
var $fields = acf.findFields({
type: 'image'
});
I would like to use above on a non-acf form in the front end. I understand that acf is loaded automatically for acf forms etc but the custom.js I am using isn't acf. I would like to stick with ACF javascript api as I assume it has a lot of the database logic with POSTS already worked out.
How can I load acf's javascript api manually please?