/** * Get all bubble, rework the array bubble for check if the bubble is dismiss, in this page and respects the conditions (url and database) * and display it. */ public function custom_admin_pointers_footer() { $this->array_bubble = get_posts(array("post_type" => $this->post_type, "posts_per_page" => -1, "order" => "ASC")); $dismiss_pointer = explode(',', get_user_meta(get_current_user_id(), 'dismissed_wp_pointers', true)); foreach ($this->array_bubble as $key => $bubble) { $meta = get_post_meta($bubble->ID, $this->post_metakey, true); $this->array_bubble[$key]->post_meta = $meta; /** On vérifie si la bubble à déjà était fermer ou pas */ $slug = "wpeo_bubble_" . $bubble->post_name; if (in_array($slug, $dismiss_pointer)) { unset($this->array_bubble[$key]); } /** On vérifie si on est sur la bonne page de la bubble */ if (!$this->check_page_bubble(!empty($meta) && !empty($meta['position']) ? $meta['position'] : array())) { unset($this->array_bubble[$key]); } /** On vérifie si y'a pas des conditions */ if (!$this->check_condition_bubble(!empty($meta) && !empty($meta['conditions']) ? $meta['conditions'] : array())) { unset($this->array_bubble[$key]); } /** On vérifie les $_GET */ if (!$this->check_url_bubble(!empty($meta) && !empty($meta['urls']) ? $meta['urls'] : array())) { unset($this->array_bubble[$key]); } } sort($this->array_bubble); require_once wpsBubbleTemplate_ctr::get_template_part(WPS_GUIDED_DIR, WPS_GUIDED_TEMPLATES_MAIN_DIR, 'backend', 'pointer'); }
?> " /> <ul class="wpeo-bubble-urls"> <?php if (!empty($meta['urls'])) { ?> <?php foreach ($meta['urls'] as $key => $url) { ?> <?php require wpsBubbleTemplate_ctr::get_template_part(WPS_GUIDED_DIR, WPS_GUIDED_TEMPLATES_MAIN_DIR, 'backend', 'metabox-url', 'input'); ?> <?php } ?> <?php } else { ?> <?php $key = 0; $url = array('paramater' => '', 'value' => ''); ?> <?php require wpsBubbleTemplate_ctr::get_template_part(WPS_GUIDED_DIR, WPS_GUIDED_TEMPLATES_MAIN_DIR, 'backend', 'metabox-url', 'input'); ?> <?php } ?> </ul> <span class="dashicons dashicons-plus-alt wpeo-bubble-add-url"></span>