Copy EM_Location object fields to custom fields?
-
Hi,
I tried to create a filter using the code below
function custom_filter() { update_post_meta($this->post_id, 'cf_location_address', $this->location_address); update_post_meta($this->post_id, 'cf_location_town', $this->location_town); update_post_meta($this->post_id, 'cf_location_state', $this->location_state); update_post_meta($this->post_id, 'cf_location_postcode', $this->location_postcode); // print_r($this); } add_filter('em_location_save','custom_filter' );
It’s not correct, that I know but I thought it would execute my code? If I place the update_post_meta functions in to
em-location.php
the code work. But I need to write this as a filter.In my functions.php within my custom function how can I get the
$this
variable to print which is in theem-location.php
file? I suppose from there I can write the rest of the function.Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Copy EM_Location object fields to custom fields?’ is closed to new replies.