Guest User

Untitled

a guest
Jan 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. add_action( 'propertyhive_property_imported_agency_pilot_api', 'use_brochure_header', 10, 2 );
  2. function use_brochure_header($post_id, $property)
  3. {
  4. $brochure_header = ( ( isset($property['Additional']['BrochureHeader']) ) ? $property['Additional']['BrochureHeader'] : '' );
  5. if ( $brochure_header != '' )
  6. {
  7. $my_post = array(
  8. 'ID' => $post_id,
  9. 'post_title' => wp_strip_all_tags( $brochure_header ),
  10. 'post_excerpt' => $property['Description'],
  11. 'post_content' => '',
  12. 'post_status' => 'publish',
  13. );
  14.  
  15. // Update the post into the database
  16. $post_id = wp_update_post( $my_post );
  17. }
  18. }
Add Comment
Please, Sign In to add comment