plugin_name = $plugin_name; $this->version = $version; require_once AMAZING_SEARCH_PLUGIN_DIR . 'includes/class-amazing-search-helper.php'; $this->helper = new Amazing_Search_Helper(); require_once AMAZING_SEARCH_PLUGIN_DIR . 'admin/includes/class-amazing-search-api.php'; $this->api = new Amazing_Search_Api(); $this->api->set_credentials(); $this->settings = (array)get_option('amazing_search_settings_tab_option'); $this->associate = (array)get_option('amazing_search_associate_tab_option'); $this->credential = (array)get_option('amazing_search_credential_tab_option'); $this->button_text = "SEE DETAILS"; $this->button_color = "#222f3d"; $this->button_text_color = "#ffffff"; $this->no_key = false; $this->show_categories = false; $this->show_page = false; $this->show_condition = false; $this->show_maximum_price = false; $this->show_minimum_price = false; $this->show_sort = false; 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('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; } if(array_key_exists('show_sale_label', $this->settings)) { $this->settings['show_sale_label'] ? $this->show_sale_label = true : $this->show_sale_label = false; } if(array_key_exists('button_text', $this->settings)) { $this->button_text = sanitize_text_field($this->settings['button_text']); } if(array_key_exists('button_color', $this->settings)) { $this->button_color = sanitize_text_field($this->settings['button_color']); } if(array_key_exists('button_text_color', $this->settings)) { $this->button_text_color = sanitize_text_field($this->settings['button_text_color']); } } } /** * Register the stylesheets for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_styles() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Amazing_Search_Loader as all of the hooks are defined * in that particular class. * * The Amazing_Search_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/amazing-search-public.css', array(), $this->version, 'all' ); } /** * Register the JavaScript for the public-facing side of the site. * * @since 1.0.0 */ public function enqueue_scripts() { /** * This function is provided for demonstration purposes only. * * An instance of this class should be passed to the run() function * defined in Amazing_Search_Loader as all of the hooks are defined * in that particular class. * * The Amazing_Search_Loader will then create the relationship * between the defined hooks and the functions defined in this * class. */ wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/amazing-search-public.js', array( 'jquery' ), $this->version, true ); $amazing_search_nonce = wp_create_nonce('amazing_search_nonce'); wp_localize_script($this->plugin_name, 'amazing_search_ajax_obj', array( 'amazing_search_ajax_url' => admin_url('admin-ajax.php'), 'nonce' => $amazing_search_nonce, )); wp_enqueue_script($this->plugin_name); } public function amazing_search_register_shortcodes() { add_shortcode( 'amazing_search', array( $this, 'amazing_search_shortcode_display') ); } public function amazing_search_shortcode_display($atts) { if(array_key_exists('associate_country', $this->associate)) { $country = $this->associate['associate_country']; } else { $country = 'com'; } $default = array( "width" => null ); $shortcode_data = shortcode_atts($default, $atts); $content_search = '
Sale
'; } } $list .= '
';
}
$list .='