Want to tag location to the questions

5.93K viewsUpdates
0

Im wondering how to tag location to the anspress questions. Ideally, I need a map on ASK page where users can select their location. This location tag will be later used as a filtering option.

 

Let me know hoe this can be achieved.

 

Ashvam

0

Try this:

add_action( 'ap_after_new_question', 'my_tag_location_on_new_question' );
function my_tag_location_on_new_question($question_id){
    // Replace YOUR LOCATION HERE with your actual location.
    add_post_meta($question_id, '__question_location', 'YOUR LOCATION HERE');
}
You are viewing 1 out of 2 answers, click here to view all answers.