Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- add_action( 'propertyhive_property_imported_blm', 'amend_property_slug', 10, 2);
- function amend_property_slug( $post_id, $property )
- {
- $slug = 'property-details-' . $property['AGENT_REF'];
- $my_post = array(
- 'ID' => $post_id,
- 'post_name' => sanitize_title($slug),
- );
- // Update the post into the database
- wp_update_post( $my_post );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement