Ejemplo n.º 1
0
 public function wp_query()
 {
     $sapi = new sapi();
     if (empty($_GET)) {
         $sapi->que_error("See more details on the 'wp_query' function at https://codex.wordpress.org/Class_Reference/WP_Query");
         $sapi->error("Please input query variables");
     }
     $results = new WP_Query($_GET);
     return array("query" => $_GET, "posts" => $results->posts);
 }
Ejemplo n.º 2
0
function simple_api_base()
{
    require_once SAPI_PATH . "/api/api.class.php";
    global $sapi;
    $sapi = new sapi();
    if ($sapi->api_called()) {
        $sapi->setup_conn();
        // checks class and method
        if (!$sapi->class_exists() || !$sapi->method_exists()) {
            $sapi->error(array("Class Given" => $sapi->class, "Method Given" => $sapi->method, "Valid Options" => $sapi->get_index()));
        }
        $content = $sapi->execute($sapi->class_name, $sapi->method);
        $sapi->return_content($content);
        die;
    }
}