コード例 #1
0
 public static function display_settings_section()
 {
     $items = easyazon_api_search('Kindle');
     do_action('easyazon_settings_section_before_' . EASYAZON_SETTINGS_SECTION_CREDENTIALS);
     include 'views/section.php';
     do_action('easyazon_settings_section_after_' . EASYAZON_SETTINGS_SECTION_CREDENTIALS);
 }
コード例 #2
0
 public static function easyazon_query_products()
 {
     $data = stripslashes_deep($_POST);
     $args = apply_filters('easyazon_query_products_args', array(), $data);
     $keywords = isset($data['keywords']) ? $data['keywords'] : '';
     $locale = isset($data['locale']) ? $data['locale'] : 'US';
     $page = isset($data['page']) ? $data['page'] : 1;
     $response = easyazon_api_search($keywords, $page, $locale, null, $args);
     if (is_wp_error($response)) {
         $response = array('error' => true, 'message' => __('There was an issue with your search and no items were found.'), 'items' => array(), 'locale' => $locale, 'page' => 1, 'pages' => 1);
     } else {
         $response = array_merge(array('error' => false, 'messages' => false), $response);
     }
     $response = apply_filters('easyazon_query_products_response', $response, $data);
     wp_send_json($response);
 }