true ), 'names' ); unset($post_types['attachment'], $post_types['adsforwp'], $post_types['adsforwp-groups']); return $post_types; } public function adsforwp_visitor_condition_type_values($data = '', $saved_data= '',$selected_val_key_4='',$selected_val_key_5='', $current_number = '', $current_group_number = '') { $adsforwp_settings = adsforwp_defaultSettings(); $response = $data; $is_ajax = false; if( $_SERVER['REQUEST_METHOD']=='POST'){ $is_ajax = true; if(wp_verify_nonce($_POST["adsforwp_visitor_condition_call_nonce"],'adsforwp_visitor_condition_action_nonce')){ if ( isset( $_POST["id"] ) ) { $response = sanitize_text_field(wp_unslash($_POST["id"])); } if ( isset( $_POST["number"] ) ) { $current_number = intval($_POST["number"]); } if ( isset( $_POST["group_number"] ) ) { $current_group_number = intval($_POST["group_number"]); } }else{ exit; } } // send the response back to the front end // vars $choices = array(); $options['param'] = $response; switch($options['param']) { case "device": $choices = array( 'desktop' => 'Desktop', 'mobile' => 'Mobile or Tablet', ); break; case "referrer_url": $choices = array( 'https://www.google.com/' => 'Google', 'https://www.bing.com/' => 'Bing', 'https://www.yahoo.com/' => 'Yahoo', 'url_custom' => 'Custom', ); break; case "geo_location": $choices = array( 'AFG' => 'Afghanistan', 'ALB' => 'Albania', 'DZA' => 'Algeria', 'ASM' => 'American Samoa', 'AND' => 'Andorra', 'AGO' => 'Angola', 'AIA' => 'Anguilla', 'ATA' => 'Antarctica', 'ATG' => 'Antigua and Barbuda', 'ARG' => 'Argentina', 'ARM' => 'Armenia', 'ABW' => 'Aruba', 'AUS' => 'Australia', 'AUT' => 'Austria', 'AZE' => 'Azerbaijan', 'BHS' => 'Bahamas', 'BHR' => 'Bahrain', 'BGD' => 'Bangladesh', 'BRB' => 'Barbados', 'BLR' => 'Belarus', 'BEL' => 'Belgium', 'BLZ' => 'Belize', 'BEN' => 'Benin', 'BMU' => 'Bermuda', 'BTN' => 'Bhutan', 'BOL' => 'Bolivia', 'BIH' => 'Bosnia and Herzegovina', 'BWA' => 'Botswana', 'BRA' => 'Brazil', 'IOT' => 'British Indian Ocean Territory', 'VGB' => 'British Virgin Islands', 'BRN' => 'Brunei', 'BGR' => 'Bulgaria', 'BFA' => 'Burkina Faso', 'BDI' => 'Burundi', 'KHM' => 'Cambodia', 'CMR' => 'Cameroon', 'CAN' => 'Canada', 'CPV' => 'Cape Verde', 'CYM' => 'Cayman Islands', 'CAF' => 'Central African Republic', 'TCD' => 'Chad', 'CHL' => 'Chile', 'CHN' => 'China', 'CXR' => 'Christmas Island', 'CCK' => 'Cocos Islands', 'COL' => 'Colombia', 'COM' => 'Comoros', 'COK' => 'Cook Islands', 'CRI' => 'Costa Rica', 'HRV' => 'Croatia', 'CUB' => 'Cuba', 'CUW' => 'Curacao', 'CYP' => 'Cyprus', 'CZE' => 'Czech Republic', 'COD' => 'Democratic Republic of the Congo', 'DNK' => 'Denmark', 'DJI' => 'Djibouti', 'DMA' => 'Dominica', 'DOM' => 'Dominican Republic', 'TLS' => 'East Timor', 'ECU' => 'Ecuador', 'EGY' => 'Egypt', 'SLV' => 'El Salvador', 'GNQ' => 'Equatorial Guinea', 'ERI' => 'Eritrea', 'EST' => 'Estonia', 'ETH' => 'Ethiopia', 'FLK' => 'Falkland Islands', 'FRO' => 'Faroe Islands', 'FJI' => 'Fiji', 'FIN' => 'Finland', 'FRA' => 'France', 'PYF' => 'French Polynesia', 'GAB' => 'Gabon', 'GMB' => 'Gambia', 'GEO' => 'Georgia', 'DEU' => 'Germany', 'GHA' => 'Ghana', 'GIB' => 'Gibraltar', 'GRC' => 'Greece', 'GRL' => 'Greenland', 'GRD' => 'Grenada', 'GUM' => 'Guam', 'GTM' => 'Guatemala', 'GGY' => 'Guernsey', 'GIN' => 'Guinea', 'GNB' => 'Guinea-Bissau', 'GUY' => 'Guyana', 'HTI' => 'Haiti', 'HND' => 'Honduras', 'HKG' => 'Hong Kong', 'HUN' => 'Hungary', 'ISL' => 'Iceland', 'IND' => 'India', 'IDN' => 'Indonesia', 'IRN' => 'Iran', 'IRQ' => 'Iraq', 'IRL' => 'Ireland', 'IMN' => 'Isle of Man', 'ISR' => 'Israel', 'ITA' => 'Italy', 'CIV' => 'Ivory Coast', 'JAM' => 'Jamaica', 'JPN' => 'Japan', 'JEY' => 'Jersey', 'JOR' => 'Jordan', 'KAZ' => 'Kazakhstan', 'KEN' => 'Kenya', 'KIR' => 'Kiribati', 'XKX' => 'Kosovo', 'KWT' => 'Kuwait', 'KGZ' => 'Kyrgyzstan', 'LAO' => 'Laos', 'LVA' => 'Latvia', 'LBN' => 'Lebanon', 'LSO' => 'Lesotho', 'LBR' => 'Liberia', 'LBY' => 'Libya', 'LIE' => 'Liechtenstein', 'LTU' => 'Lithuania', 'LUX' => 'Luxembourg', 'MAC' => 'Macau', 'MKD' => 'Macedonia', 'MDG' => 'Madagascar', 'MWI' => 'Malawi', 'MYS' => 'Malaysia', 'MDV' => 'Maldives', 'MLI' => 'Mali', 'MLT' => 'Malta', 'MHL' => 'Marshall Islands', 'MRT' => 'Mauritania', 'MUS' => 'Mauritius', 'MYT' => 'Mayotte', 'MEX' => 'Mexico', 'FSM' => 'Micronesia', 'MDA' => 'Moldova', 'MCO' => 'Monaco', 'MNG' => 'Mongolia', 'MNE' => 'Montenegro', 'MSR' => 'Montserrat', 'MAR' => 'Morocco', 'MOZ' => 'Mozambique', 'MMR' => 'Myanmar', 'NAM' => 'Namibia', 'NRU' => 'Nauru', 'NPL' => 'Nepal', 'NLD' => 'Netherlands', 'ANT' => 'Netherlands Antilles', 'NCL' => 'New Caledonia', 'NZL' => 'New Zealand', 'NIC' => 'Nicaragua', 'NER' => 'Niger', 'NGA' => 'Nigeria', 'NIU' => 'Niue', 'PRK' => 'North Korea', 'MNP' => 'Northern Mariana Islands', 'NOR' => 'Norway', 'OMN' => 'Oman', 'PAK' => 'Pakistan', 'PLW' => 'Palau', 'PSE' => 'Palestine', 'PAN' => 'Panama', 'PNG' => 'Papua New Guinea', 'PRY' => 'Paraguay', 'PER' => 'Peru', 'PHL' => 'Philippines', 'PCN' => 'Pitcairn', 'POL' => 'Poland', 'PRT' => 'Portugal', 'PRI' => 'Puerto Rico', 'QAT' => 'Qatar', 'COG' => 'Republic of the Congo', 'REU' => 'Reunion', 'ROU' => 'Romania', 'RUS' => 'Russia', 'RWA' => 'Rwanda', 'BLM' => 'Saint Barthelemy', 'SHN' => 'Saint Helena', 'KNA' => 'Saint Kitts and Nevis', 'LCA' => 'Saint Lucia', 'MAF' => 'Saint Martin', 'SPM' => 'Saint Pierre and Miquelon', 'VCT' => 'Saint Vincent and the Grenadines', 'WSM' => 'Samoa', 'SMR' => 'San Marino', 'STP' => 'Sao Tome and Principe', 'SAU' => 'Saudi Arabia', 'SEN' => 'Senegal', 'SRB' => 'Serbia', 'SYC' => 'Seychelles', 'SLE' => 'Sierra Leone', 'SGP' => 'Singapore', 'SXM' => 'Sint Maarten', 'SVK' => 'Slovakia', 'SVN' => 'Slovenia', 'SLB' => 'Solomon Islands', 'SOM' => 'Somalia', 'ZAF' => 'South Africa', 'KOR' => 'South Korea', 'SSD' => 'South Sudan', 'ESP' => 'Spain', 'LKA' => 'Sri Lanka', 'SDN' => 'Sudan', 'SUR' => 'Suriname', 'SJM' => 'Svalbard and Jan Mayen', 'SWZ' => 'Swaziland', 'SWE' => 'Sweden', 'CHE' => 'Switzerland', 'SYR' => 'Syria', 'TWN' => 'Taiwan', 'TJK' => 'Tajikistan', 'TZA' => 'Tanzania', 'THA' => 'Thailand', 'TGO' => 'Togo', 'TKL' => 'Tokelau', 'TON' => 'Tonga', 'TTO' => 'Trinidad and Tobago', 'TUN' => 'Tunisia', 'TUR' => 'Turkey', 'TKM' => 'Turkmenistan', 'TCA' => 'Turks and Caicos Islands', 'TUV' => 'Tuvalu', 'VIR' => 'U.S. Virgin Islands', 'UGA' => 'Uganda', 'UKR' => 'Ukraine', 'ARE' => 'United Arab Emirates', 'GBR' => 'United Kingdom', 'USA' => 'United States', 'URY' => 'Uruguay', 'UZB' => 'Uzbekistan', 'VUT' => 'Vanuatu', 'VAT' => 'Vatican', 'VEN' => 'Venezuela', 'VNM' => 'Vietnam', 'WLF' => 'Wallis and Futuna', 'ESH' => 'Western Sahara', 'YEM' => 'Yemen', 'ZMB' => 'Zambia', 'ZWE' => 'Zimbabwe', ); break; case "logged_in_visitor": $choices = array( 'true' => 'True', 'false' => 'False', ); break; case "user_agent": $choices = array( 'opera' => 'Opera', 'edge' => 'Edge', 'chrome' => 'Chrome', 'safari' => 'Safari', 'firefox' => 'Firefox', 'internet_explorer' => 'MSIE', 'android' => 'Android', 'iphone' => 'iPhone', 'ipad' => 'iPad', 'ipod' => 'iPod', 'user_agent_custom' => 'Custom', ); break; case "user_type" : global $wp_roles; $choices = $wp_roles->get_names(); if( is_multisite() ) { $choices['super_admin'] = esc_html__('Super Admin','ads-for-wp'); } break; case "browser_language" : $choices = array( 'af' => 'Afrikanns', 'sq' => 'Albanian', 'ar' => 'Arabic', 'hy' => 'Armenian', 'eu' => 'Basque', 'bn' => 'Bengali', 'bg' => 'Bulgarian', 'ca' => 'Catalan', 'km' => 'Cambodian', 'zh' => 'Chinese (Mandarin)', 'hr' => 'Croation', 'cs' => 'Czech', 'da' => 'Danish', 'nl' => 'Dutch', 'en' => 'English', 'et' => 'Estonian', 'fj' => 'Fiji', 'fi' => 'Finnish', 'fr' => 'French', 'ka' => 'Georgian', 'de' => 'German', 'el' => 'Greek', 'gu' => 'Gujarati', 'he' => 'Hebrew', 'hi' => 'Hindi', 'hu' => 'Hungarian', 'is' => 'Icelandic', 'id' => 'Indonesian', 'ga' => 'Irish', 'it' => 'Italian', 'ja' => 'Japanese', 'jw' => 'Javanese', 'ko' => 'Korean', 'la' => 'Latin', 'lv' => 'Latvian', 'lt' => 'Lithuanian', 'mk' => 'Macedonian', 'ms' => 'Malay', 'ml' => 'Malayalam', 'mt' => 'Maltese', 'mi' => 'Maori', 'mr' => 'Marathi', 'mn' => 'Mongolian', 'ne' => 'Nepali', 'no' => 'Norwegian', 'fa' => 'Persian', 'pl' => 'Polish', 'pt' => 'Portuguese', 'pa' => 'Punjabi', 'qu' => 'Quechua', 'ro' => 'Romanian', 'ru' => 'Russian', 'sm' => 'Samoan', 'sr' => 'Serbian', 'sk' => 'Slovak', 'sl' => 'Slovenian', 'es' => 'Spanish', 'sw' => 'Swahili', 'sv' => 'Swedish ', 'ta' => 'Tamil', 'tt' => 'Tatar', 'te' => 'Telugu', 'th' => 'Thai', 'bo' => 'Tibetan', 'to' => 'Tonga', 'tr' => 'Turkish', 'uk' => 'Ukranian', 'ur' => 'Urdu', 'uz' => 'Uzbek', 'vi' => 'Vietnamese', 'cy' => 'Welsh', 'xh' => 'Xhosa' ); break; } $choices = $choices; if($options['param'] == 'url_parameter' || $options['param'] == 'cookie') { if($options['param'] == 'url_parameter'){ $output = ''; } if($options['param'] == 'cookie'){ $output = '
'; } }else{ if ( empty( $choices)) { $choices = array('none' => esc_html__('No Items', 'ads-for-wp') ); } $output = ' '; if(adsforwp_rmv_warnings($adsforwp_settings, 'adsforwp_geolocation_api', 'adsforwp_string') =='' && $options['param'] == 'geo_location'){ $output .= '