helper = new Amazing_Linker_Helper(); require_once AMAZING_LINKER_PLUGIN_DIR . 'includes/class-amazing-linker-database-query.php'; $this->database_query = new Amazing_Linker_Database_Query(); $this->settings = (array)get_option('amazing_linker_settings_tab_option'); if( $this->settings != false ) { if(array_key_exists('new_tab_open', $this->settings)) { $this->settings['new_tab_open'] ? $this->new_tab = '_blank' : $this->new_tab = ''; } if(array_key_exists('nofollow_attribute', $this->settings)) { $this->settings['nofollow_attribute'] ? $this->no_follow = 'nofollow' : $this->no_follow = ''; } if(array_key_exists('update_info', $this->settings)) { $this->settings['update_info'] ? $this->update_info = true : $this->update_info = false; } if(array_key_exists('show_review', $this->settings)) { $this->settings['show_review'] ? $this->show_review = true : $this->show_review = false; } if(array_key_exists('show_rating', $this->settings)) { $this->settings['show_rating'] ? $this->show_rating = true : $this->show_rating = false; } $this->button_text = "SEE DETAILS"; if(array_key_exists('button_text', $this->settings)) { $this->button_text = sanitize_text_field($this->settings['button_text']); } $this->large_button_text = "See Details At Amazon"; if(array_key_exists('large_button_text', $this->settings)) { $this->large_button_text = sanitize_text_field($this->settings['large_button_text']); } $this->button_color = "#222f3d"; if(array_key_exists('button_color', $this->settings)) { $this->button_color = sanitize_text_field($this->settings['button_color']); } $this->button_text_color = "#ffffff"; if(array_key_exists('button_text_color', $this->settings)) { $this->button_text_color = sanitize_text_field($this->settings['button_text_color']); } } } public function amazing_linker_shortcode_hr_list($items) { $updated_at = []; $list = ''; $list .= '
'; foreach($items as $item) { $list_item = $this->database_query->single_item_query($item); if(count($list_item) == 0) { return; } else { $images = unserialize($list_item[0]['images']); $image_set = unserialize($list_item[0]['image_set']); $image_url = $this->helper->image_grabber($images,$image_set); $updated_at[] = (int)$list_item[0]['updated_at']; $list .= '
'; if(!is_null($list_item[0]['sale_lebel'])) { $list .= '

Sale

'; } $list .= '
'.sanitize_text_field($list_item[0]['title']).'
'; $list .=''; $list .= '
'; $list .=''; $list .= ''; $list .= '
'; } } $list .= '
'; if($this->update_info) { $list .= $this->helper->amazon_price_notice($updated_at); } $list .= '
'; return $list; } public function amazing_linker_shortcode_link_button($item) { $single_item = $this->database_query->single_item_query($item); if(count($single_item) == 0) { return; } else { $link_button = ''; $link_button .= ''; return $link_button; } } public function amazing_linker_shortcode_link_image($item,$width) { $single_item = $this->database_query->single_item_query($item); $width = sanitize_text_field($width); if(count($single_item) == 0) { return; } else { $images = unserialize($single_item[0]['images']); $image_set = unserialize($single_item[0]['image_set']); $image_url = $this->helper->image_grabber($images,$image_set); $link_image = ''; $link_image .= ''; return $link_image; } } public function amazing_linker_shortcode_link_text($item) { $single_item = $this->database_query->single_item_query($item); if(count($single_item) == 0) { return; } else { $images = unserialize($single_item[0]['images']); $image_set = unserialize($single_item[0]['image_set']); $image_url = $this->helper->image_grabber($images,$image_set); $link_text = ''; $link_text .= ''.sanitize_text_field($single_item[0]['title']).''; return $link_text; } } } }