Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- function bp_add_custom_city_list() {
- if ( !xprofile_get_field_id_from_name('City') && 'bp-profile-setup' == $_GET['page'] ) {
- $city_list_args = array(
- 'field_group_id' => 1,
- 'name' => 'City',
- 'description' => 'Please select your city',
- 'can_delete' => true,
- 'field_order' => 1,
- 'is_required' => true,
- 'type' => 'selectbox',
- 'order_by' => 'default'
- );
- $city_list_id = xprofile_insert_field( $city_list_args );
- if ( $city_list_id ) {
- $cities = array(
- "Abilene",
- "Akron / canton",
- "Albany",
- "Albuquerque",
- "Altoona-johnstown",
- "Amarillo",
- "Ames",
- "Anchorage / mat-su",
- "Ann arbor",
- "Annapolis",
- "Appleton-oshkosh-FDL",
- "Asheville",
- "Ashtabula",
- "Athens",
- "Athens",
- "Atlanta",
- "Auburn",
- "Augusta",
- "Austin",
- "Baie-Comeau",
- "Bakersfield",
- "Baltimore",
- "Baton rouge",
- "Battle creek",
- "Beaumont / port arthur",
- "Bellingham",
- "Bemidji",
- "Bend",
- "Billings",
- "Binghamton",
- "Birmingham",
- "Bismarck",
- "Bloomington",
- "Bloomington-normal",
- "Boise",
- "Boone",
- "Boston",
- "Boulder",
- "Bowling Green",
- "Bozeman",
- "Brainerd",
- "Brownsville",
- "Brunswick",
- "Buffalo",
- "Butte",
- "Catskills",
- "Cedar Rapids",
- "Central Louisiana",
- "Central Michigan",
- "Central NJ",
- "Centre-du-Québec",
- "Champaign urbana",
- "Charleston",
- "Charleston",
- "Charlotte",
- "Charlottesville",
- "Charlottetown",
- "Chattanooga",
- "Chautauqua",
- "Chicago",
- "Chico",
- "Chillicothe",
- "Cincinnati",
- "Clarksville",
- "Cleveland",
- "Clovis / Portales",
- "College Station",
- "Colorado Springs",
- "Columbia",
- "Columbus",
- "Comox Valley Area",
- "Cookeville",
- "Corpus christi",
- "Corvallis/Albany",
- "Cowichan Valley / Duncan",
- "Cranbrook",
- "Cumberland Valley",
- "Dallas / Fort worth",
- "Danville",
- "Dayton",
- "Daytona Beach",
- "Decatur",
- "Deep East Texas",
- "Del rio / Eagle pass",
- "Delaware",
- "Denver",
- "Des Moines",
- "Detroit Metro",
- "Dothan",
- "Dubuque",
- "Duluth",
- "East Idaho",
- "East Oregon",
- "Eastern CO",
- "Eastern CT",
- "Eastern Kentucky",
- "Eastern Montana",
- "Eastern NC",
- "Eastern Panhandle",
- "Eastern Shore",
- "Eau Claire",
- "El Paso",
- "Elko",
- "Elmira-corning",
- "Erie",
- "Eugene",
- "Evansville",
- "Fairbanks",
- "Fargo / Moorhead",
- "Farmington",
- "Fayetteville",
- "Finger Lakes",
- "Flagstaff / Sedona",
- "Flint",
- "Florence",
- "Florida keys",
- "Fort collins / North CO",
- "Fort Dodge",
- "Fort Lauderdale",
- "Fort Smith",
- "Fort Wayne",
- "Frederick",
- "Fredericksburg",
- "Fresno / Madera",
- "Ft myers / SW florida",
- "Gadsden-anniston",
- "Gainesville",
- "Galveston",
- "Glens Falls",
- "Gold Country",
- "Grand Forks",
- "Grand Island",
- "Grand Rapids",
- "Great Falls",
- "Green Bay",
- "Greensboro",
- "Greenville / Upstate",
- "Gulfport / Biloxi",
- "Hampton Roads",
- "Hanford-corcoran",
- "Harrisburg",
- "Harrisonburg",
- "Hartford",
- "Hattiesburg",
- "Hawaii",
- "Heartland Florida",
- "Helena",
- "Hickory / Lenoir",
- "High Rockies",
- "Hilton Head",
- "Holland",
- "Houma",
- "Houston",
- "Hudson Valley",
- "Humboldt County",
- "Huntington-ashland",
- "Huntsville / Decatur",
- "Imperial County",
- "Indianapolis",
- "Inland Empire",
- "Iowa City",
- "Ithaca",
- "Jackson",
- "Jacksonville",
- "Janesville",
- "Jersey Shore",
- "Jonesboro",
- "Joplin",
- "Kalamazoo",
- "Kalispell",
- "Kansas City",
- "Kenai Peninsula",
- "Kennewick-pasco-richland",
- "Kenosha-racine",
- "Killeen / Temple / Ft hood",
- "Kirksville",
- "Klamath Falls",
- "Knoxville",
- "Kokomo",
- "La Crosse",
- "La Ronge",
- "La Salle Co",
- "Lafayette",
- "Lake Charles",
- "Lake of the Ozarks",
- "Lakeland",
- "Lancaster",
- "Lansing",
- "Laredo",
- "Las Cruces",
- "Las Vegas",
- "Lawrence",
- "Lawton",
- "Lehigh Valley",
- "Lewiston / Clarkston",
- "Lexington",
- "Lima / Findlay",
- "Lincoln",
- "Little Rock",
- "Logan",
- "Long Island",
- "Los Angeles",
- "Louisville",
- "Lubbock",
- "Lynchburg",
- "Macon / Warner robins",
- "Madison",
- "Maine",
- "Manhattan",
- "Mankato",
- "Mansfield",
- "Mason city",
- "Mattoon-charleston",
- "Mcallen / Edinburg",
- "Meadow Lake",
- "Meadville",
- "Medford-ashland",
- "Memphis",
- "Mendocino County",
- "Merced",
- "Meridian",
- "Milwaukee",
- "Minneapolis / St paul",
- "Missoula",
- "Mobile",
- "Modesto",
- "Mohave County",
- "Monroe",
- "Monterey Bay",
- "Montgomery",
- "Morgantown",
- "Moses lake",
- "Muncie / Anderson",
- "Muskegon",
- "Muscle Shoals",
- "Myrtle Beach",
- "Nashville",
- "New Hampshire",
- "New Haven",
- "New Orleans",
- "New River valley",
- "New York city",
- "Nipawin",
- "North Central FL",
- "North Dakota",
- "North Jersey",
- "North Mississippi",
- "North Platte",
- "Northeast SD",
- "Northern Michigan",
- "Northern Panhandle",
- "Northern WI",
- "Northwest CT",
- "Northwest GA",
- "Northwest KS",
- "Northwest OK",
- "Ocala",
- "Odessa / Midland",
- "Ogden-clearfield",
- "Okaloosa / Walton",
- "Oklahoma City",
- "Olympic Peninsula",
- "Omaha / Council bluffs",
- "Oneonta",
- "Orange County",
- "Oregon Coast",
- "Orlando",
- "Outer Banks",
- "Owensboro",
- "Palm Springs",
- "Panama City",
- "Parkersburg-marietta",
- "Pensacola",
- "Peoria",
- "Philadelphia",
- "Phoenix",
- "Pierre / Central SD",
- "Pittsburgh",
- "Plattsburgh-adirondacks",
- "Poconos",
- "Port Huron",
- "Portland",
- "Potsdam-canton-massena",
- "Prescott",
- "Prince Albert",
- "Provo / Orem",
- "Pueblo",
- "Pullman / Moscow",
- "Quad Cities",
- "Raleigh / Durham / CH",
- "Rapid city / West SD",
- "Reading",
- "Redding",
- "Regina Area",
- "Reno / Tahoe",
- "Rhode Island",
- "Richmond",
- "Roanoke",
- "Rochester",
- "Rockford",
- "Roseburg",
- "Roswell / Carlsbad",
- "Sacramento",
- "Saginaw-midland-baycity",
- "Salem",
- "Salina",
- "Salt Lake City",
- "San Angelo",
- "San Antonio",
- "San Diego",
- "San Francisco bay area",
- "San Luis obispo",
- "San Marcos",
- "Sandusky",
- "Santa Barbara",
- "Santa Fe / Taos",
- "Santa Maria",
- "Sarasota-bradenton",
- "Savannah / Hinesville",
- "Scottsbluff / Panhandle",
- "Scranton / Wilkes-barre",
- "Seattle-tacoma",
- "Sheboygan",
- "Show Low",
- "Shreveport",
- "Sierra Vista",
- "Sioux City",
- "Sioux Falls / SE SD",
- "Siskiyou County",
- "Skagit / Island / SJI",
- "South bend / Michiana",
- "South Coast",
- "South Dakota",
- "South Florida",
- "South Jersey",
- "Southeast Alaska",
- "Southeast IA",
- "Southeast KS",
- "Southeast Missouri",
- "Southern Illinois",
- "Southern Maryland",
- "Southern WV",
- "Southwest KS",
- "Southwest Michigan",
- "Southwest MN",
- "Southwest MS",
- "Southwest TX",
- "Southwest VA",
- "Space Coast",
- "Spokane / Coeur d'alene",
- "Springfield",
- "St Augustine",
- "St Cloud",
- "St George",
- "St Joseph",
- "St Louis",
- "State College",
- "Statesboro",
- "Stillwater",
- "Stockton",
- "Sudbury",
- "Summerside",
- "Sunshine Coast",
- "Susanville",
- "Swift Current",
- "Syracuse",
- "Tallahassee",
- "Tampa Bay area",
- "Terre Haute",
- "Texarkana",
- "Texoma",
- "The Thumb",
- "Toledo",
- "Topeka",
- "Treasure Coast",
- "Tri-cities",
- "Tucson",
- "Tulsa",
- "Tuscaloosa",
- "Tuscarawas co",
- "Twin Falls",
- "Twin Tiers NY/PA",
- "Tyler / East TX",
- "Upper peninsula",
- "Utica-rome-oneida",
- "Valdosta",
- "Ventura County",
- "Vermont",
- "Victoria",
- "Visalia-tulare",
- "Waco",
- "Washington",
- "Waterloo / Cedar falls",
- "Watertown",
- "Wausau",
- "Wenatchee",
- "West Palm beach",
- "West Virginia (old)",
- "Western IL",
- "Western KY",
- "Western Maryland",
- "Western Massachusetts",
- "Western Slope",
- "Wichita",
- "Wichita falls",
- "Williamsport",
- "Wilmington",
- "Winchester",
- "Winston-salem",
- "Woodstock",
- "Worcester / Central MA",
- "Wyoming",
- "Yakima",
- "York",
- "Youngstown",
- "Yuba-sutter",
- "Yukon",
- "Yuma",
- "Zanesville / Cambridge",
- "-------",
- "Abitibi-Témiscamingue",
- "Annapolis Valley",
- "Baie-Comeau",
- "Banff / Canmore",
- "Barrie",
- "Bathurst",
- "Belleville Area",
- "Brandon Area",
- "Brantford",
- "Bridgewater",
- "Brockville",
- "Calgary",
- "Cape Breton",
- "Cariboo Area",
- "Centre-du-Québec",
- "Chatham-Kent",
- "Chaudière-Appalaches",
- "Chibougamau / Northern Québec",
- "Charlottetown",
- "Comox Valley Area",
- "Corner Brook",
- "Cornwall",
- "Cowichan Valley / Duncan",
- "Cranbrook",
- "Edmonton Area",
- "Edmundston",
- "Flin Flon",
- "Fort McMurray",
- "Fraser Valley",
- "Fredericton",
- "Gander",
- "Gaspé",
- "Granby",
- "Grande Prairie",
- "Greater Montréal",
- "Greater Vancouver Area",
- "Guelph",
- "Halifax",
- "Hamilton",
- "Iqaluit",
- "Kamloops",
- "Kapuskasing",
- "Kelowna",
- "Kenora",
- "Kingston Area",
- "Kitchener Area",
- "Labrador",
- "Lanaudière",
- "Laurentides",
- "Leamington",
- "Lethbridge",
- "Lloydminster",
- "London",
- "Mauricie",
- "Medicine Hat",
- "Miramichi",
- "Moncton",
- "Montreal",
- "Muskoka",
- "Nanaimo",
- "Nelson",
- "New Glasgow",
- "Norfolk County",
- "North Bay",
- "Ottawa / Gatineau Area",
- "Owen Sound",
- "Peace River Area",
- "Peterborough Area",
- "Port Alberni / Oceanside",
- "Port Hardy / Port McNeill",
- "Powell River District",
- "Prince Edward Island",
- "Prince George",
- "Québec City",
- "Red Deer",
- "Renfrew County Area",
- "Regina Area",
- "Revelstoke",
- "Rimouski / Bas-St-Laurent",
- "Saguenay-Lac-Saint-Jean",
- "Saint John",
- "Saint-Hyacinthe",
- "Saint-Jean-sur-Richelieu",
- "Sarnia Area",
- "Saskatoon",
- "Sault Ste. Marie",
- "Sept-Îles",
- "Sherbrooke",
- "Skeena-Bulkley Area",
- "St. Catharines",
- "St. John's",
- "Sudbury",
- "Sunshine Coast",
- "Thompson",
- "Thunder Bay",
- "Timmins",
- "Toronto (GTA)",
- "Truro",
- "Vancouver",
- "Vernon",
- "Victoria",
- "Whistler",
- "Whitehorse",
- "Windsor Region",
- "Winnipeg",
- "Woodstock",
- "Yarmouth",
- "Yellowknife"
- );
- foreach ( $cities as $i => $city ) {
- xprofile_insert_field( array(
- 'field_group_id' => 1,
- 'parent_id' => $city_list_id,
- 'type' => 'selectbox',
- 'name' => $city,
- 'option_order' => $i+1
- ));
- }
- }
- }
- }
- add_action('bp_init', 'bp_add_custom_city_list');
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement