Function Reference: create_list_jsondata

Summary

Create listing json for map script.

Global Values

$wpdb
(object) (required) WordPress Database object.

Default: None
$list_map_json
(array) (required) Listing map data in json format.

Default: None
$add_post_in_marker_array
(bool) (required) Displays posts in marker array when the value is true.

Default: None

Change Log

Since: 1.0.0

Filters

‘geodir_create_list_jsondata’ [Line: 48]

Source File

create_list_jsondata() is located in geodirectory-widgets/listing_map_widget.php [Line: 36]

Source Code

function create_list_jsondata($post)
{
    global $wpdb, $list_map_json, $add_post_in_marker_array;

    if ((is_main_query() || $add_post_in_marker_array) && isset($post->marker_json) && $post->marker_json != '') {
        /**
         * Filter the json data for search listing map.
         *
         * @since 1.5.7
         * @param string $post->marker_json JSON representation of the post marker info.
         * @param object $post The post object.
         */
        $list_map_json[] = apply_filters('geodir_create_list_jsondata',$post->marker_json,$post);
    }

}