How to use key method of Anything class

Best AspectMock code snippet using Anything.key

class-locate-anything-admin.php

Source:class-locate-anything-admin.php Github

copy

Full Screen

...36 * @var string $version The current version of this plugin.37 */38 private $version;39 /**40 * The Gmaps key for this app, used for geocoding in the admin41 *42 * @since 1.0.143 * @access private44 * @var string $app_Gmaps_key45 The GoogleMaps key.46 */47 static $Gmaps_API_key = 'AIzaSyC0lZ7MbGfowxNTZva7fAyeTJ18dAWMUp0';48 /**49 * Initialize the class and set its properties.50 *51 * @since 1.0.052 * @param string $plugin_name53 * The name of this plugin.54 * @param string $version55 * The version of this plugin.56 */57 public function __construct($plugin_name, $version) {58 $this->plugin_name = $plugin_name;59 $this->version = $version; 60 }61 /**62 * Register new mime types63 * 64 *65 * @since 1.1.466 * @access private67 */68 public function add_mime_types($mime_types){69 $mime_types['kml'] = 'application/vnd.google-earth.kml+xml'; //Adding kml extension 70 return $mime_types;71 }72 /**73 * serves the Gmaps Key74 *75 * @since 1.0.076 */77 public static function getGmapsAPIKey() {78 $key = get_option("locate-anything-option-googlemaps-key");79 if($key===false || empty($key)) $key = Locate_Anything_Admin::$Gmaps_API_key; 80 return $key;81 }82 /**83 * Register the JavaScript for the dashboard.84 *85 * @since 1.0.086 */87 public function enqueue_scripts() {88 wp_enqueue_media();89 wp_enqueue_script($this->plugin_name . "-adminjs", plugin_dir_url(__FILE__) . 'js/locate-anything-admin.js');90 // leaflet JS91 wp_enqueue_script($this->plugin_name . "-leaflet", 'http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js', array(92 'jquery'93 ) , $this->version, false);94 // leaflet-filters JS95 wp_enqueue_script($this->plugin_name . "-leaflet-filters", plugin_dir_url(__FILE__) . '../public/js/leaflet-filters/leaflet-filters.js', array(96 $this->plugin_name . "-leaflet"97 ) , $this->version, false);98 wp_enqueue_script($this->plugin_name . "-googleAPI", "https://maps.googleapis.com/maps/api/js?key=".$this->getGmapsAPIKey()."&v=3.exp&libraries=places&language=en" . unserialize(get_option("locate-anything-option-map-language")) , array(99 $this->plugin_name . "-leaflet-filters"100 ) , $this->version, false);101 wp_enqueue_script($this->plugin_name . "-select2", '//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.min.js');102 // Awesome markers103 wp_enqueue_script($this->plugin_name . "-awesomemarkers", plugin_dir_url(__FILE__) . '../public/js/leaflet.awesome-markers-2.0/leaflet.awesome-markers.js', array(104 $this->plugin_name . "-leaflet"105 ) , $this->version, false);106 // annotation plugin107 wp_enqueue_script($this->plugin_name . "-anno", plugin_dir_url(__FILE__) . 'js/anno/anno.js', array(108 'jquery'109 ) , $this->version, false);110 wp_enqueue_script($this->plugin_name . "-anno-dependency", plugin_dir_url(__FILE__) . 'js/anno/scrollintoview/jquery.scrollintoview.min.js', array() , $this->version, false);111 // Google Tiles112 wp_enqueue_script($this->plugin_name . "-googleTiles", plugin_dir_url(__FILE__) . '../public/js/leaflet-plugins-master/layer/tile/Google.js', array(113 $this->plugin_name . "-leaflet"114 ) , $this->version, false);115 // leaflet markerCluster JS116 wp_enqueue_script($this->plugin_name . "-leaflet-marker-cluster", plugin_dir_url(__FILE__) . '../public/js/leaflet.markercluster/leaflet.markercluster.js', array(117 'jquery'118 ) , $this->version, false);119 // google autocomplete120 wp_enqueue_script($this->plugin_name . "-googleautojs", plugin_dir_url(__FILE__) . '../public/js/leaflet-google-autocomplete/js/leaflet-google-autocomplete.js', array(121 $this->plugin_name . "-googleAPI") , $this->version, false);122 }123 /**124 * Register the stylesheets for the admin area.125 *126 * @since 1.0.0127 */128 public function enqueue_styles() {129 wp_enqueue_style($this->plugin_name . "-admincss", plugin_dir_url(__FILE__) . 'css/locate-anything-admin.css', array() , $this->version, 'all');130 wp_enqueue_style($this->plugin_name . "-annocss", plugin_dir_url(__FILE__) . 'js/anno/anno.css', array() , $this->version, 'all');131 132 wp_enqueue_style($this->plugin_name . "-select2css", "//cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.min.css", array() , $this->version, 'all');133 // Ionicons134 wp_enqueue_style($this->plugin_name . "-ioniconscss", 'http://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css', array() , $this->version, 'all');135 // Awesome markers136 wp_enqueue_style($this->plugin_name . "-awesomemarkerscss", plugin_dir_url(__FILE__) . '../public/js/leaflet.awesome-markers-2.0/leaflet.awesome-markers.css', array() , $this->version, 'all');137 // leaflet css138 wp_enqueue_style($this->plugin_name . "-leaflet", plugin_dir_url(__FILE__) . '../public/js/leaflet-0.7.3/leaflet.css', array() , $this->version, 'all');139 // leaflet-filters css140 wp_enqueue_style($this->plugin_name . "-leaflet-filters", plugin_dir_url(__FILE__) . '../public/js/leaflet-filters/leaflet-filters.css', array() , $this->version, 'all');141 // leaflet markerCluster css142 wp_enqueue_style($this->plugin_name . "-leaflet-marker-cluster-default", plugin_dir_url(__FILE__) . '../public/js/leaflet.markercluster/MarkerCluster.Default.css', array() , $this->version, 'all');143 wp_enqueue_style($this->plugin_name . "-leaflet-marker-cluster", plugin_dir_url(__FILE__) . '../public/js/leaflet.markercluster/MarkerCluster.css', array() , $this->version, 'all');144 // leaflet Google automplete CSS145 wp_enqueue_style($this->plugin_name . "-googleauto", plugin_dir_url(__FILE__) . '../public/js/leaflet-google-autocomplete/css/leaflet-google-autocomplete.css', array() , $this->version, 'all');146 }147 /**148 * Adds metaboxes to the post types selected in the options page149 */150 public function add_post_meta_boxes() {151 // fetch the post types where LocateAnything will be active152 $selected_post_types = unserialize(get_option('locate-anything-option-sources'));153 // add the LocateAnything Metabox for each of them154 if (is_array($selected_post_types)) $selected_post_types[] = "locateanythingmarker";155 else $selected_post_types = array(156 "locateanythingmarker"157 );158 159 foreach ($selected_post_types as $type) {160 add_meta_box('locate-anything-class', // Unique ID161 esc_html__('LocateAnything', 'locate-anything') , // Title162 'Locate_Anything_Admin::post_class_meta_box', // Callback function163 $type, // Admin page (or post type)164 'normal', // Context165 'high'); // Priority166 167 }168 }169 /**170 * Loads the preview pane171 */172 public function load_preview() { 173 if(isset($_GET["locateAnything_preview"])){ 174 include(plugin_dir_path(dirname(__FILE__)).'/admin/partials/locate-anything-preview.php'); 175 die();176 } 177 }178 /**179 * Adds metaboxes to the post types selected in the options page180 */181 public function add_admin_meta_boxes() {182 add_meta_box('locate-anything-class', // Unique ID183 esc_html__('LocateAnything - Wordpress Geo Plugin', 'locate-anything') , // Title184 'Locate_Anything_Admin::admin_class_meta_box', // Callback function185 'locateanythingmap', // Admin page (or post type)186 'normal', // Context187 'high'); // Priority188 189 }190 191 /**192 * Checks cache permissions, called on action admin_notices193 *194 */195 public static function check_cache_permissions() {196 $path=plugin_dir_path(dirname(__FILE__)) ."cache";197 if(!is_writable($path)){if(!@chmod($path, 0777)) {198 echo '<div class="update-nag"><p>'.__("<b>Error<b> : Please add write permissions on the follwing directory : $path","locate-anything").'</p></div>';199 }200 }201 }202 /**203 * Displays the settings page204 *205 */206 public static function admin_settings_page() { 207 include (plugin_dir_path(__FILE__) . 'partials/locate-anything-settings-admin.php');208 }209 /**210 * Display the admin meta box.211 *212 */213 public static function admin_class_meta_box($object, $box) {214 include (plugin_dir_path(__FILE__) . 'partials/locate-anything-metabox-admin.php');215 }216 /**217 * Display the post meta box.218 *219 */220 public static function post_class_meta_box($object) {221 include (plugin_dir_path(__FILE__) . 'partials/locate-anything-metabox-post.php');222 }223 /**224 * Display the user meta box.225 *226 */227 public static function user_class_meta_box($object) {228 $post_type = "user";229 include (plugin_dir_path(__FILE__) . 'partials/locate-anything-metabox-post.php');230 }231 /**232 * saves metabox fields233 * @param int $post_id [description]234 * @param WP Post Object $post235 * @return int post_id236 */237 public function save_metabox_data($post_id, $post) {238 /* Verify the nonce before proceeding. */239 if (!isset($_POST['locate_anything_class_nonce']) || !wp_verify_nonce($_POST['locate_anything_class_nonce'], "I961JpJQTj0crLKH0mGB")) return $post_id;240 /* Get the post type object. */241 $post_type = get_post_type_object($post->post_type);242 /* Check if the current user has permission to edit the post. */243 if (!current_user_can($post_type->cap->edit_post, $post_id)) return $post_id;244 foreach ($_POST as $meta_key => $new_meta_value) {245 if (strpos($meta_key, "locate-anything") !== false) Locate_Anything_Admin::add_update_metas($post_id, $meta_key, $new_meta_value);246 }247 return $post_id;248 }249 /**250 * Save the settings set in Option page251 */252 public static function save_options() {253 foreach ($_POST as $k => $v) {254 if (strpos($k, "locate-anything-option-") !== false) {255 update_option($k, serialize($v) , '', 'yes');256 }257 }258 }259 /**260 * Utilitary function to add, delete, update metas261 */262 public function add_update_metas($post_id, $meta_key, $new_meta_value) {263 /* Get the meta value of the custom field key. */264 $meta_value = get_post_meta($post_id, $meta_key, true);265 /* If a new meta value was added and there was no previous value, add it. */266 if ($new_meta_value !== false && '' == $meta_value) {267 add_post_meta($post_id, $meta_key, $new_meta_value, true);268 update_post_meta($post_id, $meta_key, $new_meta_value);269 }270 /* If the new meta value does not match the old value, update it. */271 elseif ($new_meta_value !== false && $new_meta_value != $meta_value) update_post_meta($post_id, $meta_key, $new_meta_value);272 /* If there is no new meta value but an old value exists, delete it. */273 elseif ('' == $new_meta_value && $meta_value) delete_post_meta($post_id, $meta_key, $meta_value);274 }275 /**276 * creates Admin Page in WP admin menu277 */278 public function setup_admin_menu() {279 add_submenu_page("edit.php?post_type=locateanythingmap", "Options", "Options", "edit_posts", "locate-anything-settings", "Locate_Anything_Admin::admin_settings_page");280 }281 /**282 * defines a custom types for the maps283 */284 public function createCustomType() {285 $labels = array(286 'name' => __('LocateAnything Maps', 'locate-anything') ,287 'singular_name' => __('Map', 'locate-anything') ,288 'add_new' => __('Add New', 'locate-anything') ,289 'add_new_item' => __('Add New Map', 'locate-anything') ,290 'edit_item' => __('Edit Map', 'locate-anything') ,291 'new_item' => __('New Map', 'locate-anything') ,292 'all_items' => __('All Map', 'locate-anything') ,293 'view_item' => __('View Map', 'locate-anything') ,294 'search_items' => __('Search Maps', 'locate-anything') ,295 'not_found' => __('No map found', 'locate-anything') ,296 'not_found_in_trash' => __('No map found in Trash', 'locate-anything') ,297 'menu_name' => __('LocateAnything Maps', 'locate-anything')298 );299 $supports = array(300 'title'301 );302 $slug = "locateanythingMap";303 $args = array(304 'labels' => $labels,305 'public' => false,306 'publicly_queryable' => true,307 'show_ui' => true,308 'show_in_menu' => true,309 'menu_icon' => 'dashicons-admin-site',310 'query_var' => true,311 'rewrite' => array(312 'slug' => $slug313 ) ,314 'capability_type' => 'post',315 'has_archive' => true,316 'hierarchical' => false,317 'menu_position' => null,318 'supports' => $supports319 );320 register_post_type('locateanythingMap', $args);321 /* marker custom post type*/322 323 $labels = array(324 'name' => __('Marker Categories', "locate-anything") ,325 'singular_name' => __('Marker Category', "locate-anything") ,326 'search_items' => __('Search Categories', "locate-anything") ,327 'all_items' => __('All Categories', "locate-anything") ,328 'parent_item' => __('Parent Category', "locate-anything") ,329 'parent_item_colon' => __('Parent Category:', "locate-anything") ,330 'edit_item' => __('Edit Category', "locate-anything") ,331 'update_item' => __('Update Category', "locate-anything") ,332 'add_new_item' => __('Add New Category', "locate-anything") ,333 'new_item_name' => __('New Category Name', "locate-anything") ,334 'menu_name' => __('Categories', "locate-anything") ,335 );336 337 $args = array(338 'hierarchical' => true,339 'labels' => $labels,340 'show_ui' => true,341 'show_admin_column' => true,342 'query_var' => true,343 'rewrite' => array(344 'slug' => 'locateanythingmarkercategory'345 ) ,346 );347 register_taxonomy('locateanythingmarkercategory', 'locateanythingMarker', $args);348 $labels = array(349 'name' => __('Marker Tags', "locate-anything") ,350 'singular_name' => __('Marker Tag', "locate-anything") ,351 'search_items' => __('Search Tags', "locate-anything") ,352 'all_items' => __('All Tags', "locate-anything") ,353 'parent_item' => __('Parent Tag', "locate-anything") ,354 'parent_item_colon' => __('Parent Tag:', "locate-anything") ,355 'edit_item' => __('Edit Tag', "locate-anything") ,356 'update_item' => __('Update Tag', "locate-anything") ,357 'add_new_item' => __('Add New Tag', "locate-anything") ,358 'new_item_name' => __('New Tag Name', "locate-anything") ,359 'menu_name' => __('Tags', "locate-anything") ,360 );361 362 $args = array(363 'hierarchical' => false,364 'labels' => $labels,365 'show_ui' => true,366 'show_admin_column' => true,367 'query_var' => true,368 'rewrite' => array(369 'slug' => 'locateanythingmarkertag'370 ) ,371 );372 register_taxonomy('locateanythingmarkertag', 'locateanythingMarker', $args);373 $labels = array(374 'name' => __('LocateAnything Markers', 'locate-anything') ,375 'singular_name' => __('Marker', 'locate-anything') ,376 'add_new' => __('Add New', 'locate-anything') ,377 'add_new_item' => __('Add New Marker', 'locate-anything') ,378 'edit_item' => __('Edit Marker', 'locate-anything') ,379 'new_item' => __('New Marker', 'locate-anything') ,380 'all_items' => __('All Marker', 'locate-anything') ,381 'view_item' => __('View Marker', 'locate-anything') ,382 'search_items' => __('Search Markers', 'locate-anything') ,383 'not_found' => __('No Marker found', 'locate-anything') ,384 'not_found_in_trash' => __('No Marker found in Trash', 'locate-anything') ,385 'menu_name' => __('LocateAnything Markers', 'locate-anything')386 );387 $supports = array(388 'title',389 'editor',390 'excerpt','thumbnail'391 );392 $slug = "locateanythingMarker";393 $args = array(394 'labels' => $labels,395 'public' => false,396 'publicly_queryable' => true,397 'show_ui' => true,398 'show_in_menu' => true,399 'query_var' => true,400 'rewrite' => array(401 'slug' => $slug402 ) ,403 'capability_type' => 'post',404 'has_archive' => true,405 'hierarchical' => false,406 'menu_position' => null,407 'supports' => $supports,408 'taxonomies' => array(409 'locateanythingmarkercategory','locateanythingmarkertag' 410 )411 );412 register_post_type('locateanythingMarker', $args);413 }414 /**415 * Returns the additional field list stored in options416 * @param boolean $post_type [description]417 * @return [type] [description]418 */419 public static function getAdditional_field_list($post_type = false) {420 $additional_field_list_json = stripslashes(unserialize(get_option('locate-anything-option-additional-field-list', '')));421 if ($additional_field_list_json) $additional_field_list = json_decode($additional_field_list_json, true);422 if (!is_array($additional_field_list)) $additional_field_list = array();423 424 if ($post_type !== false) {425 foreach ($additional_field_list as $key => $field) {426 if ($field["post_type"] !== $post_type) unset($additional_field_list[$key]);427 }428 }429 return $additional_field_list;430 }431 432 /**433 * displays additional fields and their tags434 *435 */436 public static function displayAdditionalFieldNotice($post_type) {437 $additional_field_list_json = stripslashes(unserialize(get_option('locate-anything-option-additional-field-list', '')));438 if ($additional_field_list_json) $additional_field_list = json_decode($additional_field_list_json, true); ?>439 <div id="basic_fields_notice"> 440 <?php 441 $post_types = array("basic"=>"basic");442 $post_types += unserialize (get_option ( 'locate-anything-option-sources' ));443 $post_types = apply_filters("locate_anything_add_sources",$post_types); 444 $already_displayed_tags =array();445 446 foreach ( $post_types as $posttype =>$postTypeName ) {447 if($posttype=="Users") $posttype = 'user'; 448 $markups = Locate_Anything_Public::getBasicMarkupList($posttype);449 foreach ($markups as $tag => $nothing) { 450 if(in_array($tag,$already_displayed_tags)) continue;451 array_push($already_displayed_tags,$tag);452 ?>453 <div class='basic-markup basic-markup-<?php echo $posttype?>'><b><?php echo ucfirst(str_replace(array("|","_") , array(""," ") , $tag)) ?></b> : <?php echo $tag ?></div>454 <?php }455 } ?>456 457 </div>458 <div id="additional_fields_notice"> 459 <table id="additional_fields_notice"> 460 <?php461 if (is_array($additional_field_list)) foreach ($additional_field_list as $field) {462 if (is_null(@$field["field_description"]) || is_null(@$field["field_name"]) || @$field['post_type']!==$post_type) continue;463?>464 <tr class='basic-markup basic-markup-<?php465 echo $field['post_type']?>'><td><b><?php466 echo $field["field_description"] . "(" . $field['post_type'] . ")" ?></b></td><td>|<?php467 echo $field['post_type'] . "::" . sanitize_key(remove_accents($field["field_description"])) ?>|</td></tr>468 <?php469 } ?>470 471 <tfoot id="filter_fields_notice"></tfoot>472 </table>473 </div>474 <?php475 }476 /** 477 * Display additional fields form478 *479 */480 public static function displayAdditionalFields($post) {481 if (get_post_type($post) == false) return;482?>483 <ul id="additional_fields">484 <?php485 $additional_field_list_json = stripslashes(unserialize(get_option('locate-anything-option-additional-field-list', '')));486 if ($additional_field_list_json) $additional_field_list = json_decode($additional_field_list_json, true);487 if ($additional_field_list) {488 if (is_array($additional_field_list) && $post !== "user") foreach ($additional_field_list as $field) {489 if ($field["post_type"] == get_post_type($post)) { ?>490 <li><b><?php491 echo $field["field_description"] ?></b><br/> <textarea name="<?php492 echo $field["field_name"] ?>"><?php493 echo get_post_meta($post->ID, $field["field_name"], true); ?></textarea></li>494 <?php495 }496 }497 }498?></ul><?php499 }500 /** 501 * returns default templates for new map502 *503 */504 public static function getDefaultTemplates() {505 return array(506 "tooltip" => "|small_thumbnail|507<p>|content_stripped|</p>",508 "navlist" => "<b>|title|</b>509<span> |city|, |country|</span>510<div>|content_stripped|</div>511|small_thumbnail|"512 );513 }514 /**515 * Returns all the metas for this post516 * @param [int] $id [post ID]517 * @return [array] array [metaname]=metavalue518 */519 public static function getPostMetas($id) {520 $t = array();521 foreach (get_post_meta($id) as $k => $v) {522 $t[$k] = current($v);523 }524 return $t;525 }526 /**527 * Returns all the metas for this user528 * @param [int] $id [post ID]529 * @return [array] array [metaname]=metavalue530 */531 public static function getUserMetas($id) {532 $t = array();533 foreach (get_user_meta($id) as $k => $v) {534 $t[$k] = current($v);535 }536 return $t;537 }538 /**539 * Returns select licences seed540 * @param [int] $id [licence id]541 * @return [string] seed542 */543 public static function getLicence($id) {544 $licences = array('label'=>"-license-lvl1");545 $licences = apply_filters("add_seed_licence",$licences); 546 $license_key =unserialize(get_option("locate-anything-option-".$licences[$id]."-license"));547 return array('seed'=>$licences[$id],'key'=>$license_key);548 }549 /**550 * Geocodes address,551 * @param [string] $address552 * @return [false | array] returns false if unable to geocode address553 */554 public static function geocode($address) {555 // url encode the address556 $address = urlencode($address);557 // google map geocode api url558 $url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address={$address}";559 // get the json response560 $resp_json = file_get_contents($url);561 // decode the json...

Full Screen

Full Screen

popupaoc-post-sett-metabox.php

Source:popupaoc-post-sett-metabox.php Github

copy

Full Screen

...60 <td class="row-meta">61 <select name="<?php echo $prefix;?>popup_type" class="popupaoc-select-box popup-btn-type" id="popup-btn-type">62 <?php63 if( !empty($popup_type_list) ) {64 foreach ($popup_type_list as $key => $value) {65 echo '<option value="'.$key.'" '.selected($popup_type,$key).'>'.$value.'</option>';66 }67 }68 ?>69 </select>70 <br/>71 <span class="description"><?php _e('Select on click type ie where user going to click.', 'popup-anything-on-click'); ?></span>72 </td>73 </tr>74 <!-- Simple button settings -->75 <tr valign="top">76 <td colspan="2" class="popupaoc-no-padding">77 <table class="form-table popupaoc-simple-link" <?php echo $popup_simple_style;?>>78 <tr>79 <th><label for="popupaoc-simple-btn-name"><?php echo __('Link Text','popup-anything-on-click');?></label></th>80 <td class="row-meta">81 <input type="text" name="<?php echo $prefix;?>popup_link_txt" value="<?php echo $popup_link_txt; ?>" class="large-text" placeholder="<?php _e('Link Text', 'popup-anything-on-click'); ?>" /><br/>82 <span class="description"><?php _e('Enter text.', 'popup-anything-on-click'); ?></span>83 </td>84 </tr>85 </table>86 <table class="form-table popupaoc-simple-button" <?php echo $popup_img_btn;?>>87 <tr>88 <th>89 <?php _e('Button Text','popup-anything-on-click');?>90 </th>91 <td class="row-meta">92 <input type="text" name="<?php echo $prefix;?>popup_button_txt" value="<?php echo $popup_button_txt; ?>" class="large-text" placeholder="<?php _e('Button Text', 'popup-anything-on-click'); ?>" /><br/>93 <span class="description"><?php _e('Enter Popup button text.', 'popup-anything-on-click'); ?></span>94 </td>95 </tr>96 <tr class="popupaoc-pro-feature">97 <th>98 <?php _e('Button Custom Class','popup-anything-on-click');?> <span class="popupaoc-pro-tag"><?php _e('PRO','popup-anything-on-click');?></span>99 </th>100 <td class="row-meta">101 <input type="text" name="" value="" class="regular-text" disabled /><br/>102 <span class="description"><?php _e('Enter Popup button custom class if you want to apply your own custom styling.', 'popup-anything-on-click'); ?></span>103 <?php echo sprintf( __( 'Upgrade to <a href="%s" target="_blank">Premium Version</a> to get this option.', 'popup-anything-on-click'), POPUPAOC_PLUGIN_LINK); ?>104 </td>105 </tr>106 107 </table><!-- end .popupaoc-group-button-sett -->108 <table class="form-table popupaoc-simple-image" <?php echo $popup_img_style;?>>109 <tr>110 <th>111 <?php _e('Popup Image','popup-anything-on-click');?>112 </th>113 <td>114 <input type="text" name="<?php echo $prefix.'popup_image_url';?>" value="<?php echo $popup_image_url;?>" id="popup-anything-default-img" class="regular-text popup-antything-default-img popup-antything-img-upload-input" />115 <input type="button" name="popup_default_img" class="button-secondary popup-anything-img-uploader" value="<?php _e( 'Upload Image', 'popup-anything-on-click'); ?>" />116 <input type="button" name="popu_default_img_clear" id="popup-anything-default-img-clear" class="button button-secondary popup-anything-image-clear" value="<?php _e( 'Clear', 'popup-anything-on-click'); ?>" /> <br />117 <span class="description"><?php _e( 'Upload popup button image.','popup-anything-on-click' ); ?></span>118 <?php119 $default_img = '';120 if( !empty($popup_image_url)) { 121 $default_img = '<img src="'.esc_url($popup_image_url).'" alt="" />';122 }123 ?>124 <div class="popup-anything-imgs-preview"><?php echo $default_img; ?></div>125 <input type="hidden" name="<?php echo $prefix.'popup_image_id';?>" value="<?php echo $popup_image_id; ?>" class="popup-image-id" />126 </td>127 </tr>128 <tr>129 <th scope="row"><label for="paoc-image-title"><?php esc_html_e('Image Title', 'popup-anything-on-click'); ?></label></th>130 <td>131 <select name="<?php echo $prefix;?>image_title" class="popupaoc-select-box paoc-image-title" id="paoc-image-title">132 <option value="false" <?php selected( $image_title, 'false' ); ?>><?php esc_html_e('False', 'popup-anything-on-click'); ?></option>133 <option value="true" <?php selected( $image_title, 'true' ); ?>><?php esc_html_e('True', 'popup-anything-on-click'); ?></option>134 </select><br/>135 <span class="description"><?php esc_html_e('Enable Image Title.', 'popup-anything-on-click'); ?></span>136 </td>137 </tr>138 <tr>139 <th scope="row"><label for="paoc-image-caption"><?php esc_html_e('Image Caption', 'popup-anything-on-click'); ?></label></th>140 <td>141 <select name="<?php echo $prefix;?>image_caption" class="popupaoc-select-box paoc-image-caption" id="paoc-image-caption">142 <option value="false" <?php selected( $image_caption, 'false' ); ?>><?php esc_html_e('False', 'popup-anything-on-click'); ?></option>143 <option value="true" <?php selected( $image_caption, 'true' ); ?>><?php esc_html_e('True', 'popup-anything-on-click'); ?></option>144 </select><br/>145 <span class="description"><?php esc_html_e('Enable Image Caption.', 'popup-anything-on-click'); ?></span>146 </td>147 </tr>148 </table><!-- end .popupaoc-group-button-sett -->149 </td>150 </tr>151 <tr>152 <th scope="row" colspan="2"><div class="popupaoc-sub-sett-title"> <?php _e('Popup Screen and Effects', 'popup-anything-on-click'); ?></div></th>153 </tr>154 <!-- popup screen -->155 <tr valign="top">156 <th scope="row">157 <label for="popupaoc-btn-style-type"><?php _e('Full Screen', 'popup-anything-on-click'); ?></label>158 </th>159 <td class="row-meta">160 <select name="<?php echo $prefix;?>full_screen" class="popupaoc-select-box popupaoc-btn-clr-class" id="popupaoc-btn-clr-class">161 <?php162 if( !empty($popup_fullscreen_list) ) {163 foreach ($popup_fullscreen_list as $key => $value) {164 echo '<option value="'.$key.'" '.selected($full_screen,$key).'>'.$value.'</option>';165 }166 }167 ?>168 </select><br/>169 <span class="description"><?php _e('Enable popup full screen. NOTE: If you are using Full Screen: True then Popup Width value added by you will not work.', 'popup-anything-on-click'); ?></span>170 </td>171 </tr>172 <!-- popup width -->173 174 <tr valign="top">175 <th scope="row">176 <label for="popupaoc-btn-clr-class"><?php _e('Popup Width', 'popup-anything-on-click'); ?></label>177 </th>178 <td class="row-meta">179 <input type="text" name="<?php echo $prefix;?>popupwidth" value="<?php echo $popupwidth; ?>" class="regular-text" placeholder="<?php _e('300px', 'popup-anything-on-click'); ?>" /><br/>180 <span class="description"><?php _e('Set popup width. e.g 80% OR 800px. Leave empty for default width.', 'popup-anything-on-click'); ?></span>181 </td>182 </tr>183 <!-- popup effect -->184 <tr valign="top">185 <th scope="row">186 <label for="popupaoc-btn-clr-class"><?php _e('Effect', 'popup-anything-on-click'); ?></label>187 </th>188 <td class="row-meta">189 <select name="<?php echo $prefix;?>popup_effect" class="popupaoc-select-box popupaoc-btn-clr-class" id="popupaoc-btn-clr-class">190 <?php191 if( !empty($popup_effect_list) ) {192 foreach ($popup_effect_list as $key => $value) {193 echo '<option value="'.$key.'" '.selected($popup_effect,$key).'>'.$value.'</option>';194 }195 }196 ?>197 </select><br/>198 <span class="description"><?php _e('Select effect.', 'popup-anything-on-click'); ?></span>199 </td>200 </tr>201 <!-- popup speedin -->202 <tr valign="top">203 <th scope="row">204 <label for="popupaoc-btn-clr-class"><?php _e('SpeedIn', 'popup-anything-on-click'); ?></label>205 </th>206 <td class="row-meta">207 <input type="number" name="<?php echo $prefix;?>speedin" value="<?php echo $speedin; ?>" class="small-text" placeholder="<?php _e('300', 'popup-anything-on-click'); ?>" /><br/>208 <span class="description"><?php _e('Enter the speed start of the animation in milliseconds.', 'popup-anything-on-click'); ?></span>209 </td>210 </tr>211 <!-- popup speedout -->212 <tr valign="top">213 <th scope="row">214 <label for="popupaoc-btn-clr-class"><?php _e('SpeedOut', 'popup-anything-on-click'); ?></label>215 </th>216 <td class="row-meta">217 <input type="number" name="<?php echo $prefix;?>speedout" value="<?php echo $speedout; ?>" class="small-text" placeholder="<?php _e('300', 'popup-anything-on-click'); ?>" /><br/>218 <span class="description"><?php _e('Enter the speed end of the animation in milliseconds.', 'popup-anything-on-click'); ?></span>219 </td>220 </tr>221 <!-- popup delay -->222 <tr valign="top">223 <th scope="row">224 <label for="popupaoc-btn-clr-class"><?php _e('Delay', 'popup-anything-on-click'); ?></label>225 </th>226 <td class="row-meta">227 <input type="number" name="<?php echo $prefix;?>delay" value="<?php echo $delay; ?>" class="small-text" placeholder="<?php _e('150', 'popup-anything-on-click'); ?>" /><br/>228 <span class="description"><?php _e('Enter the wait before the transition effect start.', 'popup-anything-on-click'); ?></span>229 </td>230 </tr>231 <tr>232 <th scope="row" colspan="2"><div class="popupaoc-sub-sett-title"> <?php _e('Popup Position', 'popup-anything-on-click'); ?></div></th>233 </tr>234 <!-- popup positionx -->235 <tr valign="top">236 <th scope="row">237 <label for="popupaoc-btn-clr-class"><?php _e('PositionX', 'popup-anything-on-click'); ?></label>238 </th>239 <td class="row-meta">240 <select name="<?php echo $prefix;?>popup_positionx" class="popupaoc-select-box popupaoc-btn-clr-class" id="popupaoc-btn-clr-class">241 <?php242 if( !empty($popup_positionx_list) ) {243 foreach ($popup_positionx_list as $key => $value) {244 echo '<option value="'.$key.'" '.selected($popup_positionx,$key).'>'.$value.'</option>';245 }246 }247 ?>248 </select><br/>249 <span class="description"><?php _e('Select positionx.', 'popup-anything-on-click'); ?></span>250 </td>251 </tr>252 <!-- popup positiony -->253 <tr valign="top">254 <th scope="row">255 <label for="popupaoc-btn-clr-class"><?php _e('PositionY', 'popup-anything-on-click'); ?></label>256 </th>257 <td class="row-meta">258 <select name="<?php echo $prefix;?>popup_positiony" class="popupaoc-select-box popupaoc-btn-clr-class" id="popupaoc-btn-clr-class">259 <?php260 if( !empty($popup_positiony_list) ) {261 foreach ($popup_positiony_list as $key => $value) {262 echo '<option value="'.$key.'" '.selected($popup_positiony,$key).'>'.$value.'</option>';263 }264 }265 ?>266 </select><br/>267 <span class="description"><?php _e('Select positiony.', 'popup-anything-on-click'); ?></span>268 </td>269 </tr>270 <tr>271 <th scope="row" colspan="2"><div class="popupaoc-sub-sett-title"> <?php _e('Popup Overlay Setting', 'popup-anything-on-click'); ?></div></th>272 </tr>273 <!-- popup overlay -->274 <tr valign="top">275 <th scope="row">276 <label for="popupaoc-btn-style-type"><?php _e('Enable Overlay', 'popup-anything-on-click'); ?></label>277 </th>278 <td class="row-meta">279 <select name="<?php echo $prefix;?>enable_ovelay" class="popupaoc-select-box popupaoc-btn-clr-class" id="popupaoc-btn-clr-class">280 <?php281 if( !empty($popup_overlay_list) ) {282 foreach ($popup_overlay_list as $key => $value) {283 echo '<option value="'.$key.'" '.selected($enable_ovelay,$key).'>'.$value.'</option>';284 }285 }286 ?>287 </select><br/>288 <span class="description"><?php _e('Enable Overlay', 'popup-anything-on-click'); ?></span>289 </td>290 </tr>291 <!-- popup Overlay Color -->292 <tr class="popupaoc-pro-feature">293 <th>294 <?php _e('Popup Overlay Color','popup-anything-on-click');?> <span class="popupaoc-pro-tag"><?php _e('PRO','popup-anything-on-click');?></span>295 </th>296 <td class="row-meta">297 <input type="text" name="" value="" class="regular-text" disabled /><br/>298 <span class="description"><?php _e('Select popup overlay background color.', 'popup-anything-on-click'); ?></span>299 <?php echo sprintf( __( 'Upgrade to <a href="%s" target="_blank">Premium Version</a> to get this option.', 'popup-anything-on-click'), POPUPAOC_PLUGIN_LINK); ?> 300 </td>301 </tr>302 <!-- popup Popup Overlay Opacity -->303 <tr class="popupaoc-pro-feature">304 <th>305 <?php _e('Popup Overlay Opacity','popup-anything-on-click');?> <span class="popupaoc-pro-tag"><?php _e('PRO','popup-anything-on-click');?></span>306 </th>307 <td class="row-meta">308 <input type="number" name="" value="" class="small-text" disabled /><br/>309 <span class="description"><?php _e('Set the popup overlay opacity. Value must be from 0 to 1.', 'popup-anything-on-click'); ?></span>310 <?php echo sprintf( __( 'Upgrade to <a href="%s" target="_blank">Premium Version</a> to get this option.', 'popup-anything-on-click'), POPUPAOC_PLUGIN_LINK); ?> 311 </td>312 </tr>313 <!-- Close Popup On Overlay -->314 <tr class="popupaoc-pro-feature">315 <th>316 <?php _e('Close Popup On Overlay','popup-anything-on-click');?> <span class="popupaoc-pro-tag"><?php _e('PRO','popup-anything-on-click');?></span>317 </th>318 <td class="row-meta">319 <input type="text" name="" value="" class="regular-text" disabled /><br/>320 <span class="description"><?php _e('Allow users to close the popup by clicking the overlay or outside the popup.', 'popup-anything-on-click'); ?></span>321 <?php echo sprintf( __( 'Upgrade to <a href="%s" target="_blank">Premium Version</a> to get this option.', 'popup-anything-on-click'), POPUPAOC_PLUGIN_LINK); ?> 322 </td>323 </tr>324 <tr>325 <th scope="row" colspan="2"><div class="popupaoc-sub-sett-title"> <?php _e('Popup Loader Setting', 'popup-anything-on-click'); ?></div></th>326 </tr>327 <!-- popup loader -->328 <tr valign="top">329 <th scope="row">330 <label for="popupaoc-btn-style-type"><?php _e('Enable Loader', 'popup-anything-on-click'); ?></label>331 </th>332 <td class="row-meta">333 <select name="<?php echo $prefix;?>enable_loader" class="popupaoc-select-box popupaoc-btn-clr-class" id="popupaoc-btn-clr-class">334 <?php335 if( !empty($popup_lodaer_list) ) {336 foreach ($popup_lodaer_list as $key => $value) {337 echo '<option value="'.$key.'" '.selected($enable_loader,$key).'>'.$value.'</option>';338 }339 }340 ?>341 </select><br/>342 <span class="description"><?php _e('Enable loader.', 'popup-anything-on-click'); ?></span>343 </td>344 </tr>345 <!-- popup Loader Color -->346 <tr class="popupaoc-pro-feature">347 <th>348 <?php _e('Popup Loader Color','popup-anything-on-click');?> <span class="popupaoc-pro-tag"><?php _e('PRO','popup-anything-on-click');?></span> 349 </th>350 <td class="row-meta">351 <input type="text" name="" value="" class="regular-text" disabled /><br/>...

Full Screen

Full Screen

popupaoc-functions.php

Source:popupaoc-functions.php Github

copy

Full Screen

...166 * 167 * @package Popup Anything On Click168 * @since 1.6.1169 */170function popupaoc_get_option( $key = '', $default = false ) {171 global $popupaoc_options;172 173 $value = ! empty( $popupaoc_options[ $key ] ) ? $popupaoc_options[ $key ] : $default;174 $value = apply_filters( 'popupaoc_get_option', $value, $key, $default );175 return apply_filters( 'popupaoc_get_option_' . $key, $value, $key, $default );176}177/**178 * Escape Tags & Slashes179 *180 * Handles escapping the slashes and tags181 *182 * @package Popup Anything On Click183 * @since 1.0.0184 */185function popupaoc_esc_attr($data) {186 return esc_attr( stripslashes($data) );187}188/**189 * Strip Slashes From Array190 *191 * @package Popup Anything On Click192 * @since 1.0.0193 */194function popupaoc_slashes_deep($data = array(), $flag = false) {195 196 if($flag != true) {197 $data = popupaoc_nohtml_kses($data);198 }199 $data = stripslashes_deep($data);200 return $data;201}202/**203 * Clean variables using sanitize_text_field. Arrays are cleaned recursively.204 * Non-scalar values are ignored.205 * 206 * @package Popup Anything On Click207 * @since 1.0208 */209function popupaoc_clean( $var ) {210 if ( is_array( $var ) ) {211 return array_map( 'popupaoc_clean', $var );212 } else {213 $data = is_scalar( $var ) ? sanitize_text_field( $var ) : $var;214 return wp_unslash($data);215 }216}217/**218 * Sanitize numeric value and return fallback value if it is blank219 * 220 * @package Popup Anything On Click221 * @since 1.0222 */223function popupaoc_clean_numeric( $var, $fallback = null ) {224 $data = abs($var);225 return ( empty($data) && $fallback ) ? $fallback : $data;226}227/**228 * Sanitize URL229 * 230 * @package Popup Anything On Click231 * @since 1.0232 */233function popupaoc_clean_url( $url ) {234 return esc_url_raw( trim($url) );235}236/**237 * Strip Html Tags 238 * 239 * It will sanitize text input (strip html tags, and escape characters)240 * 241 * @package Popup Anything On Click242 * @since 1.0.0243 */244function popupaoc_nohtml_kses($data = array()) {245 246 if ( is_array($data) ) {247 248 $data = array_map('popupaoc_nohtml_kses', $data);249 250 } elseif ( is_string( $data ) ) {251 $data = trim( $data );252 $data = wp_filter_nohtml_kses($data);253 }254 255 return $data;256}257/**258 * Function to add array after specific key259 * 260 * @package Popup Anything On Click261 * @since 1.0.0262 */263function popupaoc_add_array(&$array, $value, $index, $from_last = false) {264 if( is_array($array) && is_array($value) ) {265 if( $from_last ) {266 $total_count = count($array);267 $index = (!empty($total_count) && ($total_count > $index)) ? ($total_count-$index): $index;268 }269 270 $split_arr = array_splice($array, max(0, $index));271 $array = array_merge( $array, $value, $split_arr);272 }...

Full Screen

Full Screen

key

Using AI Code Generation

copy

Full Screen

1$anything = new Anything;2$anything->key($key);3echo $anything->key;4$anything = new Anything;5$anything->key($key);6echo $anything->key;7$anything = new Anything;8$anything->key($key);9echo $anything->key;10$anything = new Anything;11$anything->key($key);12echo $anything->key;13$anything = new Anything;14$anything->key($key);15echo $anything->key;16$anything = new Anything;17$anything->key($key);18echo $anything->key;19$anything = new Anything;20$anything->key($key);21echo $anything->key;22$anything = new Anything;23$anything->key($key);24echo $anything->key;25$anything = new Anything;26$anything->key($key);27echo $anything->key;28$anything = new Anything;29$anything->key($key);30echo $anything->key;31$anything = new Anything;32$anything->key($key);33echo $anything->key;34$anything = new Anything;35$anything->key($key);36echo $anything->key;37$anything = new Anything;38$anything->key($key);39echo $anything->key;40$anything = new Anything;41$anything->key($key);42echo $anything->key;

Full Screen

Full Screen

key

Using AI Code Generation

copy

Full Screen

1$anything = new Anything;2echo $anything->key;3echo $anything->key(1);4echo $anything->key(2);5echo $anything->key(3);6echo $anything->key(4);7echo $anything->key(5);8echo $anything->key(6);9echo $anything->key(7);10echo $anything->key(8);11echo $anything->key(9);12echo $anything->key(10);13echo $anything->key(11);14echo $anything->key(12);15echo $anything->key(13);16echo $anything->key(14);17echo $anything->key(15);18echo $anything->key(16);19echo $anything->key(17);20echo $anything->key(18);21echo $anything->key(19);22echo $anything->key(20);23echo $anything->key(21);24echo $anything->key(22);25echo $anything->key(23);26echo $anything->key(24);27echo $anything->key(25);28echo $anything->key(26);29echo $anything->key(27);30echo $anything->key(28);31echo $anything->key(29);32echo $anything->key(30);33echo $anything->key(31);34echo $anything->key(32);35echo $anything->key(33);36echo $anything->key(34);37echo $anything->key(35);38echo $anything->key(36);39echo $anything->key(37);40echo $anything->key(38);41echo $anything->key(39);42echo $anything->key(40);43echo $anything->key(41);44echo $anything->key(42);45echo $anything->key(43);46echo $anything->key(44);47echo $anything->key(45);48echo $anything->key(46);49echo $anything->key(47);50echo $anything->key(48);51echo $anything->key(49);52echo $anything->key(50);53echo $anything->key(51);54echo $anything->key(52);55echo $anything->key(53);56echo $anything->key(54);57echo $anything->key(55);58echo $anything->key(56);59echo $anything->key(57);60echo $anything->key(58);61echo $anything->key(59);62echo $anything->key(60);63echo $anything->key(

Full Screen

Full Screen

key

Using AI Code Generation

copy

Full Screen

1include("anything.php");2$anything = new Anything();3$anything->key();4include("anything.php");5$anything = new Anything();6$anything->value();7include("anything.php");8$anything = new Anything();9$anything->keyValue();10include("anything.php");11$anything = new Anything();12$anything->keyValues();13include("anything.php");14$anything = new Anything();15$anything->keyValues();16include("anything.php");17$anything = new Anything();18$anything->keyValues();19include("anything.php");20$anything = new Anything();21$anything->keyValues();22include("anything.php");23$anything = new Anything();24$anything->keyValues();25include("anything.php");26$anything = new Anything();27$anything->keyValues();28include("anything.php");29$anything = new Anything();30$anything->keyValues();31include("anything.php");32$anything = new Anything();33$anything->keyValues();34include("anything.php");35$anything = new Anything();36$anything->keyValues();

Full Screen

Full Screen

key

Using AI Code Generation

copy

Full Screen

1$anything = new Anything();2echo $anything->key();3I want to write a code in 1.php to call 2.php and get the output of key() method. I tried this code:4$anything = new Anything();5echo $anything->key();6> Fatal error: Call to undefined method Anything::key()7require_once '2.php';8$anything = new Anything();9echo $anything->key();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run AspectMock automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Trigger key code on LambdaTest Cloud Grid

Execute automation tests with key on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful