/** * Generates Global Property ID if it does not exist * * @param bool $property_id * * @return string | Returns GPID * @since 1.6 */ public static function maybe_set_gpid($property_id = false) { if (!$property_id) { return false; } $exists = get_post_meta($property_id, 'wpp_gpid', true); if ($exists) { return $exists; } $gpid = WPP_F::get_gpid($property_id, true); update_post_meta($property_id, 'wpp_gpid', $gpid); return $gpid; }