if( !in_array($EM_Location->location_id, $locations_exported) ){ $location_export_item = $locations_export_default; $location_export_item['item_id'] = 'event-post-'.$EM_Location->post_id; $location_export_item['data'][] = array('name' => __('Name','events-manager'), 'value' => $EM_Location->location_name ); $location_export_item['data'][] = array('name' => sprintf(__('%s Status','events-manager'), __('Location','events-manager')), 'value' => $EM_Location->post_status ); if( $EM_Location->post_status == 'publish' ){ $location_export_item['data'][] = array('name' => sprintf(__('%s URL','events-manager'), __('Location','events-manager')), 'value' => $EM_Location->get_permalink() ); } $location_export_item['data'][] = array('name' => __('Address','events-manager'), 'value' => $EM_Location->get_full_address() .', '. $EM_Location->location_country ); $location_export_item['data'][] = array('name' => __('Coordinates','events-manager'), 'value' => $EM_Location->location_latitude .', '. $EM_Location->location_longitude ); foreach( $EM_Location->location_attributes as $k => $v ){ $location_export_item['data'][] = array('name' => $k, 'value' => $v); } $location_export_item = apply_filters('em_data_privacy_export_locations_item', $location_export_item, $EM_Location); $export_items[] = $location_export_item; $export_items = apply_filters('em_data_privacy_export_locations_items_after_item', $export_items, $location_export_item, $EM_Location); //could be used for cross-referencing and add-ing other groups e.g. Multiple Bookings in Pro $locations_exported[] = $EM_Location->location_id; $items_count++; if( $items_count == $limit ) break; } } update_post_meta( $_REQUEST['id'], '_em_locations_exported', $locations_exported); $done = $items_count < $limit; //if we didn't reach limit of bookings then we must be done return array( 'data' => $export_items, 'done' => $done, ); } public static function get_cpts($email_address, $page, $post_type ){ global $wpdb; $page = (int) $page; $limit = apply_filters('em_data_privacy_export_limit', 100); $offset = ($page -1) * $limit; $user = get_user_by('email', $email_address); //is user or no-user? $anon_email_key = $post_type == EM_POST_TYPE_LOCATION ? '_owner_email':'_event_owner_email'; //get event IDs submitted by user or "anonymously" by email $events = array(); if( $user !== false ){ $sql = $wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE post_author = %d AND post_type = %s LIMIT %d OFFSET %d", $user->ID, $post_type, $limit, $offset); $events = $wpdb->get_col($sql); } //if user ever submitted anonymous events with same email, we also process these $sql = $wpdb->prepare("SELECT ID FROM {$wpdb->posts} WHERE ID IN (SELECT post_id FROM {$wpdb->postmeta} WHERE meta_key=%s AND meta_value=%s) AND post_type = %s LIMIT %d OFFSET %d", $anon_email_key, $email_address, $post_type, $limit, $offset); $events = array_merge($events, $wpdb->get_col($sql)); return $events; } public static function get_bookings( $email_address, $page ){ global $wpdb; $page = (int) $page; $limit = apply_filters('em_data_privacy_export_limit', 100); $offset = ($page -1) * $limit; $user = get_user_by('email', $email_address); //is user or no-user? $conditions = array(); if( $user !== false ){ $conditions[] = $wpdb->prepare('person_id = %d', $user->ID); } $conditions[] = $wpdb->prepare('person_id=0 AND booking_meta LIKE %s', "%\"user_email\";s:".strlen($email_address).":\"$email_address\"%"); //find any booking that may have their email, anonymous or previous email address. $bookings = $wpdb->get_col('SELECT booking_id FROM '.EM_BOOKINGS_TABLE.' WHERE '. implode(' OR ', $conditions) .' LIMIT '.$limit . ' OFFSET '.$offset); return $bookings; } } EM_Data_Privacy::init(); /* add_action('admin_init', function(){ $data = EM_Data_Privacy::exporter('subscriber@netweblogic.com'); echo ""; foreach( $data['data'] as $items ){ foreach($items['data'] as $item) echo ""; } echo "
{$item['name']}{$item['value']}
"; die(); }); //*/ WordPress » Erreur

The site is experiencing technical difficulties. Please check your site admin email inbox for instructions.