ID ] = $page->post_title;
}
}
return $pages;
}
/**
* Insert required custom pages.
*
* @since 1.7.0
*/
function aec_insert_pages() {
global $wpdb;
$page_settings = get_option( 'aec_page_settings', array() );
$pages = array();
// Calendar Page
if( array_key_exists( 'calendar', $page_settings ) ) {
$pages['calendar'] = $page_settings['calendar'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_calendar]%' LIMIT 1" );
if( ! $post_id ) {
$pages['calendar'] = wp_insert_post( array(
'post_title' => __( 'Calendar Page', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-calendar',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_calendar]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Events Page
if( array_key_exists( 'events', $page_settings ) ) {
$pages['events'] = $page_settings['events'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_events]%' LIMIT 1" );
if( ! $post_id ) {
$pages['events'] = wp_insert_post( array(
'post_title' => __( 'Events Page', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-events',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_map]
[aec_events]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Categories Page
if( array_key_exists( 'categories', $page_settings ) ) {
$pages['categories'] = $page_settings['categories'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_categories]%' LIMIT 1" );
if( ! $post_id ) {
$pages['categories'] = wp_insert_post( array(
'post_title' => __( 'Categories Page', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-categories',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_categories]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Single Category Page
if( array_key_exists( 'category', $page_settings ) ) {
$pages['category'] = $page_settings['category'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_category]%' LIMIT 1" );
if( ! $post_id ) {
$pages['category'] = wp_insert_post( array(
'post_title' => __( 'Single Category Page', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-category',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_map]
[aec_category]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Single Tag Page
if( array_key_exists( 'tag', $page_settings ) ) {
$pages['tag'] = $page_settings['tag'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_tag]%' LIMIT 1" );
if( ! $post_id ) {
$pages['tag'] = wp_insert_post( array(
'post_title' => __( 'Single Tag Page', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-tag',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_map]
[aec_tag]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Single Venue Page
if( array_key_exists( 'venue', $page_settings ) ) {
$pages['venue'] = $page_settings['venue'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_venue]%' LIMIT 1" );
if( ! $post_id ) {
$pages['venue'] = wp_insert_post( array(
'post_title' => __( 'Single Venue Page', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-venue',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_venue]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Single Organizer Page
if( array_key_exists( 'organizer', $page_settings ) ) {
$pages['organizer'] = $page_settings['organizer'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_organizer]%' LIMIT 1" );
if( ! $post_id ) {
$pages['organizer'] = wp_insert_post( array(
'post_title' => __( 'Single Organizer Page', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-organizer',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_map]
[aec_organizer]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Search Results Page
if( array_key_exists( 'search', $page_settings ) ) {
$pages['search'] = $page_settings['search'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_search]%' LIMIT 1" );
if( ! $post_id ) {
$pages['search'] = wp_insert_post( array(
'post_title' => __( 'Search Results Page', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-search',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_search]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Event Submission Form
if( array_key_exists( 'event_form', $page_settings ) ) {
$pages['event_form'] = $page_settings['event_form'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_event_form]%' LIMIT 1" );
if( ! $post_id ) {
$pages['event_form'] = wp_insert_post( array(
'post_title' => __( 'Add New Event', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-event-form',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_event_form]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Manage Events Page
if( array_key_exists( 'manage_events', $page_settings ) ) {
$pages['manage_events'] = $page_settings['manage_events'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_manage_events]%' LIMIT 1" );
if( ! $post_id ) {
$pages['manage_events'] = wp_insert_post( array(
'post_title' => __( 'Manage Events', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-manage-events',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_manage_events]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Venue Form
if( array_key_exists( 'venue_form', $page_settings ) ) {
$pages['venue_form'] = $page_settings['venue_form'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_venue_form]%' LIMIT 1" );
if( ! $post_id ) {
$pages['venue_form'] = wp_insert_post( array(
'post_title' => __( 'Add New Venue', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-venue-form',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_venue_form]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Manage Events
if( array_key_exists( 'manage_venues', $page_settings ) ) {
$pages['manage_venues'] = $page_settings['manage_venues'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_manage_venues]%' LIMIT 1" );
if( ! $post_id ) {
$pages['manage_venues'] = wp_insert_post( array(
'post_title' => __( 'Manage Venues', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-manage-venues',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_manage_venues]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Organizer Form
if( array_key_exists( 'organizer_form', $page_settings ) ) {
$pages['organizer_form'] = $page_settings['organizer_form'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_organizer_form]%' LIMIT 1" );
if( ! $post_id ) {
$pages['organizer_form'] = wp_insert_post( array(
'post_title' => __( 'Add New Organizer', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-organizer-form',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_organizer_form]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
// Manage Organizers Page
if( array_key_exists( 'manage_organizers', $page_settings ) ) {
$pages['manage_organizers'] = $page_settings['manage_organizers'];
} else {
$post_id = $wpdb->get_results( "SELECT ID FROM $wpdb->posts WHERE post_type='page' AND post_content='%[aec_manage_organizers]%' LIMIT 1" );
if( ! $post_id ) {
$pages['manage_organizers'] = wp_insert_post( array(
'post_title' => __( 'Manage Organizers', 'another-events-calendar' ),
'post_type' => 'page',
'post_name' => 'aec-manage-organizers',
'comment_status' => 'closed',
'ping_status' => 'closed',
'post_content' => '[aec_manage_organizers]',
'post_status' => 'publish',
'post_author' => get_current_user_id()
));
}
}
return $pages;
}
/**
* Get current address bar URL.
*
* @since 1.0.0
*
* @return string Current Page URL.
*/
function aec_get_current_url() {
$current_url = ( isset( $_SERVER["HTTPS"] ) && $_SERVER["HTTPS"] == "on" ) ? "https://" : "http://";
$current_url .= $_SERVER["SERVER_NAME"];
if( $_SERVER["SERVER_PORT"] != "80" && $_SERVER["SERVER_PORT"] != "443" ) {
$current_url .= ":".$_SERVER["SERVER_PORT"];
}
$current_url .= $_SERVER["REQUEST_URI"];
return $current_url;
}
/*
* Provides a simple login form.
*
* @since 1.0.0
*
* @return string Login form.
*/
function aec_login_form() {
$form = wp_login_form();
$form .= sprintf( '
Powered by Yendif Technologies
'; } } /** * Display the socialshare buttons. * * @since 1.0.0 */ function the_aec_socialshare_buttons() { global $post; $page_settings = get_option( 'aec_page_settings' ); $socialshare_settings = get_option( 'aec_socialshare_settings' ); if( empty( $socialshare_settings['pages'] ) || empty( $socialshare_settings['services'] ) ) return; $content = ''; $page = ''; if( is_singular('aec_events') ) { $page = 'event_detail'; } else { if( $page_settings['categories'] == $post->ID ) { $page = 'categories'; } if( in_array( $post->ID, array( $page_settings['calendar'], $page_settings['events'], $page_settings['category'], $page_settings['tag'], $page_settings['venue'], $page_settings['organizer'], $page_settings['search'] ) ) ) { $page = 'event_archives'; } } if( isset( $socialshare_settings['pages'] ) && in_array( $page, $socialshare_settings['pages'] ) ) { // Vars $site_title = urlencode( get_bloginfo('name') ); $permalink = urlencode( aec_get_current_url() ); $title = urlencode( get_the_title() ); $post_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); // If current page = single category page if( $post->ID == $page_settings['category'] ) { if( $slug = get_query_var( 'aec_category' ) ) { $term = get_term_by( 'slug', $slug, 'aec_categories' ); $title = $term->name; } } // If current page = single tag page if( $post->ID == $page_settings['tag'] ) { if( $slug = get_query_var( 'aec_tag' ) ) { $term = get_term_by( 'slug', $slug, 'aec_tags' ); $title = $term->name; } } // If current page = single venue page if( $post->ID == $page_settings['venue'] ) { if( $slug = get_query_var( 'aec_venue' ) ) { $page = get_page_by_path( $slug, OBJECT, 'aec_venues' ); $title = $page->post_title; } } // If current page = single organizer page if( $post->ID == $page_settings['organizer'] ) { if( $slug = get_query_var( 'aec_organizer' ) ) { $page = get_page_by_path( $slug, OBJECT, 'aec_organizers' ); $title = $page->post_title; $post_thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $page->ID ), 'full' ); } } $thumbnail = ''; if( ! empty( $post_thumbnail ) ) { $thumbnail = urlencode( $post_thumbnail[0] ); } // Construct sharing URL without using any script $facebook_url = 'https://www.facebook.com/sharer/sharer.php?u='.$permalink; $twitter_url = 'https://twitter.com/intent/tweet?text='.$title.'&url='.$permalink.'&via='.$site_title; $google_url = 'https://plus.google.com/share?url='.$permalink; $linkedin_url = 'https:///www.linkedin.com/shareArticle?url='.$permalink.'&text='.$title; $pinterest_url = 'https://pinterest.com/pin/create/button/?url='.$permalink.'&media='.$thumbnail.'&description='.$title; // Add sharing button at the end of page/page content $meta = array(); if( in_array( 'facebook', $socialshare_settings['services'] ) ) { $meta[] = sprintf( '%s', $facebook_url, __( 'Facebook','another-events-calendar' ) ); } if( in_array( 'twitter', $socialshare_settings['services'] ) ) { $meta[] = sprintf( '%s', $twitter_url, __( 'Twitter','another-events-calendar' ) ); } if( in_array( 'gplus', $socialshare_settings['services'] ) ) { $meta[] = sprintf( '%s', $google_url, __( 'Google+','another-events-calendar' ) ); } if( in_array( 'linkedin', $socialshare_settings['services'] ) ) { $meta[] = sprintf( '%s', $linkedin_url, __( 'Linkedin','another-events-calendar' ) ); } if( in_array( 'pinterest', $socialshare_settings['services'] ) ) { $meta[] = sprintf( '%s', $pinterest_url, __( 'Pin It','another-events-calendar' ) ); } if( count( $meta ) ) { $content .= ''; } } echo $content; } /** * Get Event Date. * * @since 1.0.0 */ function aec_get_event_date( $post_id ) { $all_day_event = get_post_meta( $post_id, 'all_day_event', true ); $start_date_time = get_post_meta( $post_id, 'start_date_time', true ); $end_date_time = get_post_meta( $post_id, 'end_date_time', true ); // If All Day Event if( $all_day_event ) { $formatted_date = '' . date_i18n( get_option( 'date_format' ), strtotime( $start_date_time ) ) . ''; // If there is end date if( '0000-00-00 00:00:00' != $end_date_time ) { // Find the time difference between start date and end date $datetime1 = new DateTime( $start_date_time ); $datetime2 = new DateTime( $end_date_time ); $interval = $datetime1->diff( $datetime2 ); $day_diff = $interval->format('%a'); // If there is day difference if( $day_diff > 0 ) { $formatted_date .= '-'; $formatted_date .= '' . date_i18n( get_option( 'date_format' ), strtotime( $end_date_time ) ) . ''; } } } else { $start_date = '' . date_i18n( get_option( 'date_format' ), strtotime( $start_date_time ) ) . ''; $start_time = '' . date_i18n( get_option( 'time_format' ), strtotime( $start_date_time ) ) . ''; $formatted_date = $start_date . ' ' . $start_time; // If there is end date if( '0000-00-00 00:00:00' != $end_date_time ) { // Find the time difference between start date and end date $datetime1 = new DateTime( $start_date_time ); $datetime2 = new DateTime( $end_date_time ); $interval = $datetime1->diff( $datetime2 ); $day_diff = $interval->format('%a'); // If day difference less than 1 day if( $day_diff < 1 ) { $formatted_date .= '-'; $formatted_date .= '' . date_i18n( get_option( 'time_format' ), strtotime( $end_date_time ) ) . ''; } // Else else { $formatted_date .= '-'; $end_date = '' . date_i18n( get_option( 'date_format' ) , strtotime( $end_date_time ) ) . ''; $end_time = '' . date_i18n( get_option( 'time_format' ), strtotime( $end_date_time ) ) . ''; $formatted_date .= $end_date . ' ' . $end_time; } } } return $formatted_date; } /** * Get Recurring Event Date. * * @since 1.0.0 * * @param string $start_date Date from which the new date must be calculated. * @param string $interval Interval Format. * @param string $format Date Format. * @return string New Date. */ function aec_add_date( $start_date, $interval, $format = 'Y-m-d H:i:s' ) { $start_date = new DateTime( $start_date ); if( strpos( $interval, '-P' ) !== false ) { $interval = str_replace( '-P', 'P', $interval ); $di = new DateInterval( $interval ); $di->invert = 1; } else { $di = new DateInterval( $interval ); } $end_date = $start_date->add( $di ); return $end_date->format( $format ); } /** * Get Countries. * * @since 1.0.0 * * @return array Countries List. */ function aec_get_countries() { $countries = array( "AF" => "Afghanistan", "AL" => "Albania", "DZ" => "Algeria", "AS" => "American Samoa", "AD" => "Andorra", "AO" => "Angola", "AI" => "Anguilla", "AQ" => "Antarctica", "AG" => "Antigua and Barbuda", "AR" => "Argentina", "AM" => "Armenia", "AW" => "Aruba", "AU" => "Australia", "AT" => "Austria", "AZ" => "Azerbaijan", "BS" => "Bahamas", "BH" => "Bahrain", "BD" => "Bangladesh", "BB" => "Barbados", "BY" => "Belarus", "BE" => "Belgium", "BZ" => "Belize", "BJ" => "Benin", "BM" => "Bermuda", "BT" => "Bhutan", "BO" => "Bolivia", "BA" => "Bosnia and Herzegovina", "BW" => "Botswana", "BV" => "Bouvet Island", "BR" => "Brazil", "BQ" => "British Antarctic Territory", "IO" => "British Indian Ocean Territory", "VG" => "British Virgin Islands", "BN" => "Brunei", "BG" => "Bulgaria", "BF" => "Burkina Faso", "BI" => "Burundi", "KH" => "Cambodia", "CM" => "Cameroon", "CA" => "Canada", "CT" => "Canton and Enderbury Islands", "CV" => "Cape Verde", "KY" => "Cayman Islands", "CF" => "Central African Republic", "TD" => "Chad", "CL" => "Chile", "CN" => "China", "CX" => "Christmas Island", "CC" => "Cocos [Keeling] Islands", "CO" => "Colombia", "KM" => "Comoros", "CG" => "Congo - Brazzaville", "CD" => "Congo - Kinshasa", "CK" => "Cook Islands", "CR" => "Costa Rica", "HR" => "Croatia", "CU" => "Cuba", "CY" => "Cyprus", "CZ" => "Czech Republic", "CI" => "Côte d’Ivoire", "DK" => "Denmark", "DJ" => "Djibouti", "DM" => "Dominica", "DO" => "Dominican Republic", "NQ" => "Dronning Maud Land", "DD" => "East Germany", "EC" => "Ecuador", "EG" => "Egypt", "SV" => "El Salvador", "GQ" => "Equatorial Guinea", "ER" => "Eritrea", "EE" => "Estonia", "ET" => "Ethiopia", "FK" => "Falkland Islands", "FO" => "Faroe Islands", "FJ" => "Fiji", "FI" => "Finland", "FR" => "France", "GF" => "French Guiana", "PF" => "French Polynesia", "TF" => "French Southern Territories", "FQ" => "French Southern and Antarctic Territories", "GA" => "Gabon", "GM" => "Gambia", "GE" => "Georgia", "DE" => "Germany", "GH" => "Ghana", "GI" => "Gibraltar", "GR" => "Greece", "GL" => "Greenland", "GD" => "Grenada", "GP" => "Guadeloupe", "GU" => "Guam", "GT" => "Guatemala", "GG" => "Guernsey", "GN" => "Guinea", "GW" => "Guinea-Bissau", "GY" => "Guyana", "HT" => "Haiti", "HM" => "Heard Island and McDonald Islands", "HN" => "Honduras", "HK" => "Hong Kong SAR China", "HU" => "Hungary", "IS" => "Iceland", "IN" => "India", "ID" => "Indonesia", "IR" => "Iran", "IQ" => "Iraq", "IE" => "Ireland", "IM" => "Isle of Man", "IL" => "Israel", "IT" => "Italy", "JM" => "Jamaica", "JP" => "Japan", "JE" => "Jersey", "JT" => "Johnston Island", "JO" => "Jordan", "KZ" => "Kazakhstan", "KE" => "Kenya", "KI" => "Kiribati", "KW" => "Kuwait", "KG" => "Kyrgyzstan", "LA" => "Laos", "LV" => "Latvia", "LB" => "Lebanon", "LS" => "Lesotho", "LR" => "Liberia", "LY" => "Libya", "LI" => "Liechtenstein", "LT" => "Lithuania", "LU" => "Luxembourg", "MO" => "Macau SAR China", "MK" => "Macedonia", "MG" => "Madagascar", "MW" => "Malawi", "MY" => "Malaysia", "MV" => "Maldives", "ML" => "Mali", "MT" => "Malta", "MH" => "Marshall Islands", "MQ" => "Martinique", "MR" => "Mauritania", "MU" => "Mauritius", "YT" => "Mayotte", "FX" => "Metropolitan France", "MX" => "Mexico", "FM" => "Micronesia", "MI" => "Midway Islands", "MD" => "Moldova", "MC" => "Monaco", "MN" => "Mongolia", "ME" => "Montenegro", "MS" => "Montserrat", "MA" => "Morocco", "MZ" => "Mozambique", "MM" => "Myanmar [Burma]", "NA" => "Namibia", "NR" => "Nauru", "NP" => "Nepal", "NL" => "Netherlands", "AN" => "Netherlands Antilles", "NT" => "Neutral Zone", "NC" => "New Caledonia", "NZ" => "New Zealand", "NI" => "Nicaragua", "NE" => "Niger", "NG" => "Nigeria", "NU" => "Niue", "NF" => "Norfolk Island", "KP" => "North Korea", "VD" => "North Vietnam", "MP" => "Northern Mariana Islands", "NO" => "Norway", "OM" => "Oman", "PC" => "Pacific Islands Trust Territory", "PK" => "Pakistan", "PW" => "Palau", "PS" => "Palestinian Territories", "PA" => "Panama", "PZ" => "Panama Canal Zone", "PG" => "Papua New Guinea", "PY" => "Paraguay", "YD" => "People's Democratic Republic of Yemen", "PE" => "Peru", "PH" => "Philippines", "PN" => "Pitcairn Islands", "PL" => "Poland", "PT" => "Portugal", "PR" => "Puerto Rico", "QA" => "Qatar", "RO" => "Romania", "RU" => "Russia", "RW" => "Rwanda", "RE" => "Réunion", "BL" => "Saint Barthélemy", "SH" => "Saint Helena", "KN" => "Saint Kitts and Nevis", "LC" => "Saint Lucia", "MF" => "Saint Martin", "PM" => "Saint Pierre and Miquelon", "VC" => "Saint Vincent and the Grenadines", "WS" => "Samoa", "SM" => "San Marino", "SA" => "Saudi Arabia", "SN" => "Senegal", "RS" => "Serbia", "CS" => "Serbia and Montenegro", "SC" => "Seychelles", "SL" => "Sierra Leone", "SG" => "Singapore", "SK" => "Slovakia", "SI" => "Slovenia", "SB" => "Solomon Islands", "SO" => "Somalia", "ZA" => "South Africa", "GS" => "South Georgia and the South Sandwich Islands", "KR" => "South Korea", "ES" => "Spain", "LK" => "Sri Lanka", "SD" => "Sudan", "SR" => "Suriname", "SJ" => "Svalbard and Jan Mayen", "SZ" => "Swaziland", "SE" => "Sweden", "CH" => "Switzerland", "SY" => "Syria", "ST" => "São Tomé and Príncipe", "TW" => "Taiwan", "TJ" => "Tajikistan", "TZ" => "Tanzania", "TH" => "Thailand", "TL" => "Timor-Leste", "TG" => "Togo", "TK" => "Tokelau", "TO" => "Tonga", "TT" => "Trinidad and Tobago", "TN" => "Tunisia", "TR" => "Turkey", "TM" => "Turkmenistan", "TC" => "Turks and Caicos Islands", "TV" => "Tuvalu", "UM" => "U.S. Minor Outlying Islands", "PU" => "U.S. Miscellaneous Pacific Islands", "VI" => "U.S. Virgin Islands", "UG" => "Uganda", "UA" => "Ukraine", "SU" => "Union of Soviet Socialist Republics", "AE" => "United Arab Emirates", "GB" => "United Kingdom", "US" => "United States", "ZZ" => "Unknown or Invalid Region", "UY" => "Uruguay", "UZ" => "Uzbekistan", "VU" => "Vanuatu", "VA" => "Vatican City", "VE" => "Venezuela", "VN" => "Vietnam", "WK" => "Wake Island", "WF" => "Wallis and Futuna", "EH" => "Western Sahara", "YE" => "Yemen", "ZM" => "Zambia", "ZW" => "Zimbabwe", "AX" => "Åland Islands", ); return apply_filters( 'aec_countries', $countries ); } /** * Get Country Name. * * @since 1.0.0 * * @param string $key AEC Country Key. * @return string Country Name. */ function aec_country_name( $key ) { $countries = aec_get_countries(); return $countries[ $key ]; }