예제 #1
0
 /**
  * Send request
  * 
  * @param string $request
  * 
  * @return stdClass|WP_Error
  * 
  * @access protected
  */
 protected static function send($request)
 {
     $response = AAM_Core_API::cURL($request, false);
     if (!is_wp_error($response)) {
         $response = json_decode($response['body']);
     }
     return $response;
 }
예제 #2
0
 /**
  *
  * @global type $wp_post_types
  * @return type
  */
 public function refreshList()
 {
     global $wp_post_types;
     AAM_Core_API::deleteOption('aam_metabox_cache');
     $type_list = array_keys($wp_post_types);
     //used to retrieve the list of all wigets on the frontend
     array_unshift($type_list, 'widgets');
     foreach ($type_list as $type) {
         if ($type == 'widgets') {
             $url = add_query_arg('init', 'metabox', admin_url('index.php'));
         } else {
             $url = add_query_arg('init', 'metabox', admin_url('post-new.php?post_type=' . $type));
         }
         //grab metaboxes
         AAM_Core_API::cURL($url);
     }
     return json_encode(array('status' => 'success'));
 }