Make WordPress Core

Changeset 43805


Ignore:
Timestamp:
10/23/2018 07:03:47 AM (5 years ago)
Author:
pento
Message:

REST API: Add endpoints for blocks.

WP_REST_Block_Renderer_Controller allows rendering of server-side rendered blocks, whilst WP_REST_Blocks_Controller allows retrieving of reusable blocks.

Props desrosj, danielbachhuber, pento.
See #45065.

Location:
branches/5.0
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/5.0/src/wp-includes/post.php

    r43804 r43805  
    239239            'show_in_menu'          => false,
    240240            'rewrite'               => false,
     241            'show_in_rest'          => true,
     242            'rest_base'             => 'blocks',
     243            'rest_controller_class' => 'WP_REST_Blocks_Controller',
    241244            'capability_type'       => 'block',
    242245            'capabilities' => array(
  • branches/5.0/src/wp-includes/rest-api.php

    r43768 r43805  
    251251    $controller->register_routes();
    252252
     253    // Block Renderer.
     254    $controller = new WP_REST_Block_Renderer_Controller;
     255    $controller->register_routes();
     256
    253257    // Settings.
    254258    $controller = new WP_REST_Settings_Controller;
     
    258262    $controller = new WP_REST_Themes_Controller;
    259263    $controller->register_routes();
     264
    260265}
    261266
  • branches/5.0/src/wp-settings.php

    r43768 r43805  
    236236require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-comments-controller.php' );
    237237require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-search-controller.php' );
     238require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-blocks-controller.php' );
     239require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-block-renderer-controller.php' );
    238240require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-settings-controller.php' );
    239241require( ABSPATH . WPINC . '/rest-api/endpoints/class-wp-rest-themes-controller.php' );
  • branches/5.0/tests/phpunit/tests/rest-api/rest-schema-setup.php

    r43768 r43805  
    100100            '/wp/v2/media',
    101101            '/wp/v2/media/(?P<id>[\\d]+)',
     102            '/wp/v2/blocks',
     103            '/wp/v2/blocks/(?P<id>[\d]+)',
     104            '/wp/v2/blocks/(?P<parent>[\d]+)/autosaves',
     105            '/wp/v2/blocks/(?P<parent>[\d]+)/autosaves/(?P<id>[\d]+)',
    102106            '/wp/v2/types',
    103107            '/wp/v2/types/(?P<type>[\\w-]+)',
     
    116120            '/wp/v2/comments/(?P<id>[\\d]+)',
    117121            '/wp/v2/search',
     122            '/wp/v2/block-renderer/(?P<name>core/block)',
     123            '/wp/v2/block-renderer/(?P<name>core/latest-comments)',
     124            '/wp/v2/block-renderer/(?P<name>core/archives)',
     125            '/wp/v2/block-renderer/(?P<name>core/categories)',
     126            '/wp/v2/block-renderer/(?P<name>core/latest-posts)',
     127            '/wp/v2/block-renderer/(?P<name>core/shortcode)',
    118128            '/wp/v2/settings',
    119129            '/wp/v2/themes',
  • branches/5.0/tests/qunit/fixtures/wp-api-generated.js

    r43770 r43805  
    22722272            ]
    22732273        },
     2274        "/wp/v2/blocks": {
     2275            "namespace": "wp/v2",
     2276            "methods": [
     2277                "GET",
     2278                "POST"
     2279            ],
     2280            "endpoints": [
     2281                {
     2282                    "methods": [
     2283                        "GET"
     2284                    ],
     2285                    "args": {
     2286                        "context": {
     2287                            "required": false,
     2288                            "default": "view",
     2289                            "enum": [
     2290                                "view",
     2291                                "embed",
     2292                                "edit"
     2293                            ],
     2294                            "description": "Scope under which the request is made; determines fields present in response.",
     2295                            "type": "string"
     2296                        },
     2297                        "page": {
     2298                            "required": false,
     2299                            "default": 1,
     2300                            "description": "Current page of the collection.",
     2301                            "type": "integer"
     2302                        },
     2303                        "per_page": {
     2304                            "required": false,
     2305                            "default": 10,
     2306                            "description": "Maximum number of items to be returned in result set.",
     2307                            "type": "integer"
     2308                        },
     2309                        "search": {
     2310                            "required": false,
     2311                            "description": "Limit results to those matching a string.",
     2312                            "type": "string"
     2313                        },
     2314                        "after": {
     2315                            "required": false,
     2316                            "description": "Limit response to posts published after a given ISO8601 compliant date.",
     2317                            "type": "string"
     2318                        },
     2319                        "before": {
     2320                            "required": false,
     2321                            "description": "Limit response to posts published before a given ISO8601 compliant date.",
     2322                            "type": "string"
     2323                        },
     2324                        "exclude": {
     2325                            "required": false,
     2326                            "default": [],
     2327                            "description": "Ensure result set excludes specific IDs.",
     2328                            "type": "array",
     2329                            "items": {
     2330                                "type": "integer"
     2331                            }
     2332                        },
     2333                        "include": {
     2334                            "required": false,
     2335                            "default": [],
     2336                            "description": "Limit result set to specific IDs.",
     2337                            "type": "array",
     2338                            "items": {
     2339                                "type": "integer"
     2340                            }
     2341                        },
     2342                        "offset": {
     2343                            "required": false,
     2344                            "description": "Offset the result set by a specific number of items.",
     2345                            "type": "integer"
     2346                        },
     2347                        "order": {
     2348                            "required": false,
     2349                            "default": "desc",
     2350                            "enum": [
     2351                                "asc",
     2352                                "desc"
     2353                            ],
     2354                            "description": "Order sort attribute ascending or descending.",
     2355                            "type": "string"
     2356                        },
     2357                        "orderby": {
     2358                            "required": false,
     2359                            "default": "date",
     2360                            "enum": [
     2361                                "author",
     2362                                "date",
     2363                                "id",
     2364                                "include",
     2365                                "modified",
     2366                                "parent",
     2367                                "relevance",
     2368                                "slug",
     2369                                "include_slugs",
     2370                                "title"
     2371                            ],
     2372                            "description": "Sort collection by object attribute.",
     2373                            "type": "string"
     2374                        },
     2375                        "slug": {
     2376                            "required": false,
     2377                            "description": "Limit result set to posts with one or more specific slugs.",
     2378                            "type": "array",
     2379                            "items": {
     2380                                "type": "string"
     2381                            }
     2382                        },
     2383                        "status": {
     2384                            "required": false,
     2385                            "default": "publish",
     2386                            "description": "Limit result set to posts assigned one or more statuses.",
     2387                            "type": "array",
     2388                            "items": {
     2389                                "enum": [
     2390                                    "publish",
     2391                                    "future",
     2392                                    "draft",
     2393                                    "pending",
     2394                                    "private",
     2395                                    "trash",
     2396                                    "auto-draft",
     2397                                    "inherit",
     2398                                    "request-pending",
     2399                                    "request-confirmed",
     2400                                    "request-failed",
     2401                                    "request-completed",
     2402                                    "any"
     2403                                ],
     2404                                "type": "string"
     2405                            }
     2406                        }
     2407                    }
     2408                },
     2409                {
     2410                    "methods": [
     2411                        "POST"
     2412                    ],
     2413                    "args": {
     2414                        "date": {
     2415                            "required": false,
     2416                            "description": "The date the object was published, in the site's timezone.",
     2417                            "type": "string"
     2418                        },
     2419                        "date_gmt": {
     2420                            "required": false,
     2421                            "description": "The date the object was published, as GMT.",
     2422                            "type": "string"
     2423                        },
     2424                        "slug": {
     2425                            "required": false,
     2426                            "description": "An alphanumeric identifier for the object unique to its type.",
     2427                            "type": "string"
     2428                        },
     2429                        "status": {
     2430                            "required": false,
     2431                            "enum": [
     2432                                "publish",
     2433                                "future",
     2434                                "draft",
     2435                                "pending",
     2436                                "private"
     2437                            ],
     2438                            "description": "A named status for the object.",
     2439                            "type": "string"
     2440                        },
     2441                        "password": {
     2442                            "required": false,
     2443                            "description": "A password to protect access to the content and excerpt.",
     2444                            "type": "string"
     2445                        },
     2446                        "title": {
     2447                            "required": false,
     2448                            "description": "The title for the object.",
     2449                            "type": "object"
     2450                        },
     2451                        "content": {
     2452                            "required": false,
     2453                            "description": "The content for the object.",
     2454                            "type": "object"
     2455                        },
     2456                        "template": {
     2457                            "required": false,
     2458                            "description": "The theme file to use to display the object.",
     2459                            "type": "string"
     2460                        }
     2461                    }
     2462                }
     2463            ],
     2464            "_links": {
     2465                "self": "http://example.org/index.php?rest_route=/wp/v2/blocks"
     2466            }
     2467        },
     2468        "/wp/v2/blocks/(?P<id>[\\d]+)": {
     2469            "namespace": "wp/v2",
     2470            "methods": [
     2471                "GET",
     2472                "POST",
     2473                "PUT",
     2474                "PATCH",
     2475                "DELETE"
     2476            ],
     2477            "endpoints": [
     2478                {
     2479                    "methods": [
     2480                        "GET"
     2481                    ],
     2482                    "args": {
     2483                        "id": {
     2484                            "required": false,
     2485                            "description": "Unique identifier for the object.",
     2486                            "type": "integer"
     2487                        },
     2488                        "context": {
     2489                            "required": false,
     2490                            "default": "view",
     2491                            "enum": [
     2492                                "view",
     2493                                "embed",
     2494                                "edit"
     2495                            ],
     2496                            "description": "Scope under which the request is made; determines fields present in response.",
     2497                            "type": "string"
     2498                        },
     2499                        "password": {
     2500                            "required": false,
     2501                            "description": "The password for the post if it is password protected.",
     2502                            "type": "string"
     2503                        }
     2504                    }
     2505                },
     2506                {
     2507                    "methods": [
     2508                        "POST",
     2509                        "PUT",
     2510                        "PATCH"
     2511                    ],
     2512                    "args": {
     2513                        "id": {
     2514                            "required": false,
     2515                            "description": "Unique identifier for the object.",
     2516                            "type": "integer"
     2517                        },
     2518                        "date": {
     2519                            "required": false,
     2520                            "description": "The date the object was published, in the site's timezone.",
     2521                            "type": "string"
     2522                        },
     2523                        "date_gmt": {
     2524                            "required": false,
     2525                            "description": "The date the object was published, as GMT.",
     2526                            "type": "string"
     2527                        },
     2528                        "slug": {
     2529                            "required": false,
     2530                            "description": "An alphanumeric identifier for the object unique to its type.",
     2531                            "type": "string"
     2532                        },
     2533                        "status": {
     2534                            "required": false,
     2535                            "enum": [
     2536                                "publish",
     2537                                "future",
     2538                                "draft",
     2539                                "pending",
     2540                                "private"
     2541                            ],
     2542                            "description": "A named status for the object.",
     2543                            "type": "string"
     2544                        },
     2545                        "password": {
     2546                            "required": false,
     2547                            "description": "A password to protect access to the content and excerpt.",
     2548                            "type": "string"
     2549                        },
     2550                        "title": {
     2551                            "required": false,
     2552                            "description": "The title for the object.",
     2553                            "type": "object"
     2554                        },
     2555                        "content": {
     2556                            "required": false,
     2557                            "description": "The content for the object.",
     2558                            "type": "object"
     2559                        },
     2560                        "template": {
     2561                            "required": false,
     2562                            "description": "The theme file to use to display the object.",
     2563                            "type": "string"
     2564                        }
     2565                    }
     2566                },
     2567                {
     2568                    "methods": [
     2569                        "DELETE"
     2570                    ],
     2571                    "args": {
     2572                        "id": {
     2573                            "required": false,
     2574                            "description": "Unique identifier for the object.",
     2575                            "type": "integer"
     2576                        },
     2577                        "force": {
     2578                            "required": false,
     2579                            "default": false,
     2580                            "description": "Whether to bypass trash and force deletion.",
     2581                            "type": "boolean"
     2582                        }
     2583                    }
     2584                }
     2585            ]
     2586        },
     2587        "/wp/v2/blocks/(?P<parent>[\\d]+)/autosaves": {
     2588            "namespace": "wp/v2",
     2589            "methods": [
     2590                "GET",
     2591                "POST"
     2592            ],
     2593            "endpoints": [
     2594                {
     2595                    "methods": [
     2596                        "GET"
     2597                    ],
     2598                    "args": {
     2599                        "parent": {
     2600                            "required": false,
     2601                            "description": "The ID for the parent of the object.",
     2602                            "type": "integer"
     2603                        },
     2604                        "context": {
     2605                            "required": false,
     2606                            "default": "view",
     2607                            "enum": [
     2608                                "view",
     2609                                "embed",
     2610                                "edit"
     2611                            ],
     2612                            "description": "Scope under which the request is made; determines fields present in response.",
     2613                            "type": "string"
     2614                        },
     2615                        "page": {
     2616                            "required": false,
     2617                            "default": 1,
     2618                            "description": "Current page of the collection.",
     2619                            "type": "integer"
     2620                        },
     2621                        "per_page": {
     2622                            "required": false,
     2623                            "description": "Maximum number of items to be returned in result set.",
     2624                            "type": "integer"
     2625                        },
     2626                        "search": {
     2627                            "required": false,
     2628                            "description": "Limit results to those matching a string.",
     2629                            "type": "string"
     2630                        },
     2631                        "exclude": {
     2632                            "required": false,
     2633                            "default": [],
     2634                            "description": "Ensure result set excludes specific IDs.",
     2635                            "type": "array",
     2636                            "items": {
     2637                                "type": "integer"
     2638                            }
     2639                        },
     2640                        "include": {
     2641                            "required": false,
     2642                            "default": [],
     2643                            "description": "Limit result set to specific IDs.",
     2644                            "type": "array",
     2645                            "items": {
     2646                                "type": "integer"
     2647                            }
     2648                        },
     2649                        "offset": {
     2650                            "required": false,
     2651                            "description": "Offset the result set by a specific number of items.",
     2652                            "type": "integer"
     2653                        },
     2654                        "order": {
     2655                            "required": false,
     2656                            "default": "desc",
     2657                            "enum": [
     2658                                "asc",
     2659                                "desc"
     2660                            ],
     2661                            "description": "Order sort attribute ascending or descending.",
     2662                            "type": "string"
     2663                        },
     2664                        "orderby": {
     2665                            "required": false,
     2666                            "default": "date",
     2667                            "enum": [
     2668                                "date",
     2669                                "id",
     2670                                "include",
     2671                                "relevance",
     2672                                "slug",
     2673                                "include_slugs",
     2674                                "title"
     2675                            ],
     2676                            "description": "Sort collection by object attribute.",
     2677                            "type": "string"
     2678                        }
     2679                    }
     2680                },
     2681                {
     2682                    "methods": [
     2683                        "POST"
     2684                    ],
     2685                    "args": {
     2686                        "parent": {
     2687                            "required": false,
     2688                            "description": "The ID for the parent of the object.",
     2689                            "type": "integer"
     2690                        },
     2691                        "author": {
     2692                            "required": false,
     2693                            "description": "The ID for the author of the object.",
     2694                            "type": "integer"
     2695                        },
     2696                        "date": {
     2697                            "required": false,
     2698                            "description": "The date the object was published, in the site's timezone.",
     2699                            "type": "string"
     2700                        },
     2701                        "date_gmt": {
     2702                            "required": false,
     2703                            "description": "The date the object was published, as GMT.",
     2704                            "type": "string"
     2705                        },
     2706                        "id": {
     2707                            "required": false,
     2708                            "description": "Unique identifier for the object.",
     2709                            "type": "integer"
     2710                        },
     2711                        "modified": {
     2712                            "required": false,
     2713                            "description": "The date the object was last modified, in the site's timezone.",
     2714                            "type": "string"
     2715                        },
     2716                        "modified_gmt": {
     2717                            "required": false,
     2718                            "description": "The date the object was last modified, as GMT.",
     2719                            "type": "string"
     2720                        },
     2721                        "slug": {
     2722                            "required": false,
     2723                            "description": "An alphanumeric identifier for the object unique to its type.",
     2724                            "type": "string"
     2725                        },
     2726                        "title": {
     2727                            "required": false,
     2728                            "description": "The title for the object.",
     2729                            "type": "object"
     2730                        },
     2731                        "content": {
     2732                            "required": false,
     2733                            "description": "The content for the object.",
     2734                            "type": "object"
     2735                        }
     2736                    }
     2737                }
     2738            ]
     2739        },
     2740        "/wp/v2/blocks/(?P<parent>[\\d]+)/autosaves/(?P<id>[\\d]+)": {
     2741            "namespace": "wp/v2",
     2742            "methods": [
     2743                "GET"
     2744            ],
     2745            "endpoints": [
     2746                {
     2747                    "methods": [
     2748                        "GET"
     2749                    ],
     2750                    "args": {
     2751                        "parent": {
     2752                            "required": false,
     2753                            "description": "The ID for the parent of the object.",
     2754                            "type": "integer"
     2755                        },
     2756                        "id": {
     2757                            "required": false,
     2758                            "description": "The ID for the object.",
     2759                            "type": "integer"
     2760                        },
     2761                        "context": {
     2762                            "required": false,
     2763                            "default": "view",
     2764                            "enum": [
     2765                                "view",
     2766                                "embed",
     2767                                "edit"
     2768                            ],
     2769                            "description": "Scope under which the request is made; determines fields present in response.",
     2770                            "type": "string"
     2771                        }
     2772                    }
     2773                }
     2774            ]
     2775        },
    22742776        "/wp/v2/types": {
    22752777            "namespace": "wp/v2",
     
    38624364                "self": "http://example.org/index.php?rest_route=/wp/v2/search"
    38634365            }
     4366        },
     4367        "/wp/v2/block-renderer/(?P<name>core/block)": {
     4368            "namespace": "wp/v2",
     4369            "methods": [
     4370                "GET"
     4371            ],
     4372            "endpoints": [
     4373                {
     4374                    "methods": [
     4375                        "GET"
     4376                    ],
     4377                    "args": {
     4378                        "name": {
     4379                            "required": false,
     4380                            "description": "Unique registered name for the block.",
     4381                            "type": "string"
     4382                        },
     4383                        "context": {
     4384                            "required": false,
     4385                            "default": "view",
     4386                            "enum": [
     4387                                "edit"
     4388                            ],
     4389                            "description": "Scope under which the request is made; determines fields present in response.",
     4390                            "type": "string"
     4391                        },
     4392                        "attributes": {
     4393                            "required": false,
     4394                            "description": "Attributes for core/block block",
     4395                            "type": "object"
     4396                        },
     4397                        "post_id": {
     4398                            "required": false,
     4399                            "description": "ID of the post context.",
     4400                            "type": "integer"
     4401                        }
     4402                    }
     4403                }
     4404            ]
     4405        },
     4406        "/wp/v2/block-renderer/(?P<name>core/latest-comments)": {
     4407            "namespace": "wp/v2",
     4408            "methods": [
     4409                "GET"
     4410            ],
     4411            "endpoints": [
     4412                {
     4413                    "methods": [
     4414                        "GET"
     4415                    ],
     4416                    "args": {
     4417                        "name": {
     4418                            "required": false,
     4419                            "description": "Unique registered name for the block.",
     4420                            "type": "string"
     4421                        },
     4422                        "context": {
     4423                            "required": false,
     4424                            "default": "view",
     4425                            "enum": [
     4426                                "edit"
     4427                            ],
     4428                            "description": "Scope under which the request is made; determines fields present in response.",
     4429                            "type": "string"
     4430                        },
     4431                        "attributes": {
     4432                            "required": false,
     4433                            "description": "Attributes for core/latest-comments block",
     4434                            "type": "object"
     4435                        },
     4436                        "post_id": {
     4437                            "required": false,
     4438                            "description": "ID of the post context.",
     4439                            "type": "integer"
     4440                        }
     4441                    }
     4442                }
     4443            ]
     4444        },
     4445        "/wp/v2/block-renderer/(?P<name>core/archives)": {
     4446            "namespace": "wp/v2",
     4447            "methods": [
     4448                "GET"
     4449            ],
     4450            "endpoints": [
     4451                {
     4452                    "methods": [
     4453                        "GET"
     4454                    ],
     4455                    "args": {
     4456                        "name": {
     4457                            "required": false,
     4458                            "description": "Unique registered name for the block.",
     4459                            "type": "string"
     4460                        },
     4461                        "context": {
     4462                            "required": false,
     4463                            "default": "view",
     4464                            "enum": [
     4465                                "edit"
     4466                            ],
     4467                            "description": "Scope under which the request is made; determines fields present in response.",
     4468                            "type": "string"
     4469                        },
     4470                        "attributes": {
     4471                            "required": false,
     4472                            "description": "Attributes for core/archives block",
     4473                            "type": "object"
     4474                        },
     4475                        "post_id": {
     4476                            "required": false,
     4477                            "description": "ID of the post context.",
     4478                            "type": "integer"
     4479                        }
     4480                    }
     4481                }
     4482            ]
     4483        },
     4484        "/wp/v2/block-renderer/(?P<name>core/categories)": {
     4485            "namespace": "wp/v2",
     4486            "methods": [
     4487                "GET"
     4488            ],
     4489            "endpoints": [
     4490                {
     4491                    "methods": [
     4492                        "GET"
     4493                    ],
     4494                    "args": {
     4495                        "name": {
     4496                            "required": false,
     4497                            "description": "Unique registered name for the block.",
     4498                            "type": "string"
     4499                        },
     4500                        "context": {
     4501                            "required": false,
     4502                            "default": "view",
     4503                            "enum": [
     4504                                "edit"
     4505                            ],
     4506                            "description": "Scope under which the request is made; determines fields present in response.",
     4507                            "type": "string"
     4508                        },
     4509                        "attributes": {
     4510                            "required": false,
     4511                            "description": "Attributes for core/categories block",
     4512                            "type": "object"
     4513                        },
     4514                        "post_id": {
     4515                            "required": false,
     4516                            "description": "ID of the post context.",
     4517                            "type": "integer"
     4518                        }
     4519                    }
     4520                }
     4521            ]
     4522        },
     4523        "/wp/v2/block-renderer/(?P<name>core/latest-posts)": {
     4524            "namespace": "wp/v2",
     4525            "methods": [
     4526                "GET"
     4527            ],
     4528            "endpoints": [
     4529                {
     4530                    "methods": [
     4531                        "GET"
     4532                    ],
     4533                    "args": {
     4534                        "name": {
     4535                            "required": false,
     4536                            "description": "Unique registered name for the block.",
     4537                            "type": "string"
     4538                        },
     4539                        "context": {
     4540                            "required": false,
     4541                            "default": "view",
     4542                            "enum": [
     4543                                "edit"
     4544                            ],
     4545                            "description": "Scope under which the request is made; determines fields present in response.",
     4546                            "type": "string"
     4547                        },
     4548                        "attributes": {
     4549                            "required": false,
     4550                            "description": "Attributes for core/latest-posts block",
     4551                            "type": "object"
     4552                        },
     4553                        "post_id": {
     4554                            "required": false,
     4555                            "description": "ID of the post context.",
     4556                            "type": "integer"
     4557                        }
     4558                    }
     4559                }
     4560            ]
     4561        },
     4562        "/wp/v2/block-renderer/(?P<name>core/shortcode)": {
     4563            "namespace": "wp/v2",
     4564            "methods": [
     4565                "GET"
     4566            ],
     4567            "endpoints": [
     4568                {
     4569                    "methods": [
     4570                        "GET"
     4571                    ],
     4572                    "args": {
     4573                        "name": {
     4574                            "required": false,
     4575                            "description": "Unique registered name for the block.",
     4576                            "type": "string"
     4577                        },
     4578                        "context": {
     4579                            "required": false,
     4580                            "default": "view",
     4581                            "enum": [
     4582                                "edit"
     4583                            ],
     4584                            "description": "Scope under which the request is made; determines fields present in response.",
     4585                            "type": "string"
     4586                        },
     4587                        "attributes": {
     4588                            "required": false,
     4589                            "description": "Attributes for core/shortcode block",
     4590                            "type": "object"
     4591                        },
     4592                        "post_id": {
     4593                            "required": false,
     4594                            "description": "ID of the post context.",
     4595                            "type": "integer"
     4596                        }
     4597                    }
     4598                }
     4599            ]
    38644600        },
    38654601        "/wp/v2/settings": {
     
    43405076    },
    43415077    {
    4342         "author": 389,
     5078        "author": 405,
    43435079        "date": "2017-02-14T00:00:00",
    43445080        "date_gmt": "2017-02-14T00:00:00",
    4345         "id": 36710,
     5081        "id": 1527,
    43465082        "modified": "2017-02-14T00:00:00",
    43475083        "modified_gmt": "2017-02-14T00:00:00",
    4348         "parent": 36709,
    4349         "slug": "36709-revision-v1",
     5084        "parent": 1526,
     5085        "slug": "1526-revision-v1",
    43505086        "guid": {
    4351             "rendered": "http://example.org/?p=36710"
     5087            "rendered": "http://example.org/?p=1527"
    43525088        },
    43535089        "title": {
     
    43635099            "parent": [
    43645100                {
    4365                     "href": "http://example.org/index.php?rest_route=/wp/v2/posts/36709"
     5101                    "href": "http://example.org/index.php?rest_route=/wp/v2/posts/1526"
    43665102                }
    43675103            ]
     
    43955131mockedApiResponse.postAutosaves = [
    43965132    {
    4397         "author": 389,
     5133        "author": 405,
    43985134        "date": "2017-02-14T00:00:00",
    43995135        "date_gmt": "2017-02-14T00:00:00",
    4400         "id": 36711,
     5136        "id": 1528,
    44015137        "modified": "2017-02-14T00:00:00",
    44025138        "modified_gmt": "2017-02-14T00:00:00",
    4403         "parent": 36709,
    4404         "slug": "36709-autosave-v1",
     5139        "parent": 1526,
     5140        "slug": "1526-autosave-v1",
    44055141        "guid": {
    4406             "rendered": "http://example.org/?p=36711"
     5142            "rendered": "http://example.org/?p=1528"
    44075143        },
    44085144        "title": {
     
    44185154            "parent": [
    44195155                {
    4420                     "href": "http://example.org/index.php?rest_route=/wp/v2/posts/36709"
     5156                    "href": "http://example.org/index.php?rest_route=/wp/v2/posts/1526"
    44215157                }
    44225158            ]
     
    44265162
    44275163mockedApiResponse.autosave = {
    4428     "author": 389,
     5164    "author": 405,
    44295165    "date": "2017-02-14T00:00:00",
    44305166    "date_gmt": "2017-02-14T00:00:00",
    4431     "id": 36711,
     5167    "id": 1528,
    44325168    "modified": "2017-02-14T00:00:00",
    44335169    "modified_gmt": "2017-02-14T00:00:00",
    4434     "parent": 36709,
    4435     "slug": "36709-autosave-v1",
     5170    "parent": 1526,
     5171    "slug": "1526-autosave-v1",
    44365172    "guid": {
    4437         "rendered": "http://example.org/?p=36711"
     5173        "rendered": "http://example.org/?p=1528"
    44385174    },
    44395175    "title": {
     
    46005336    },
    46015337    {
    4602         "author": 389,
     5338        "author": 405,
    46035339        "date": "2017-02-14T00:00:00",
    46045340        "date_gmt": "2017-02-14T00:00:00",
    4605         "id": 36713,
     5341        "id": 1530,
    46065342        "modified": "2017-02-14T00:00:00",
    46075343        "modified_gmt": "2017-02-14T00:00:00",
    4608         "parent": 36712,
    4609         "slug": "36712-revision-v1",
     5344        "parent": 1529,
     5345        "slug": "1529-revision-v1",
    46105346        "guid": {
    4611             "rendered": "http://example.org/?p=36713"
     5347            "rendered": "http://example.org/?p=1530"
    46125348        },
    46135349        "title": {
     
    46235359            "parent": [
    46245360                {
    4625                     "href": "http://example.org/index.php?rest_route=/wp/v2/pages/36712"
     5361                    "href": "http://example.org/index.php?rest_route=/wp/v2/pages/1529"
    46265362                }
    46275363            ]
     
    46555391mockedApiResponse.pageAutosaves = [
    46565392    {
    4657         "author": 389,
     5393        "author": 405,
    46585394        "date": "2017-02-14T00:00:00",
    46595395        "date_gmt": "2017-02-14T00:00:00",
    4660         "id": 36714,
     5396        "id": 1531,
    46615397        "modified": "2017-02-14T00:00:00",
    46625398        "modified_gmt": "2017-02-14T00:00:00",
    4663         "parent": 36712,
    4664         "slug": "36712-autosave-v1",
     5399        "parent": 1529,
     5400        "slug": "1529-autosave-v1",
    46655401        "guid": {
    4666             "rendered": "http://example.org/?p=36714"
     5402            "rendered": "http://example.org/?p=1531"
    46675403        },
    46685404        "title": {
     
    46785414            "parent": [
    46795415                {
    4680                     "href": "http://example.org/index.php?rest_route=/wp/v2/pages/36712"
     5416                    "href": "http://example.org/index.php?rest_route=/wp/v2/pages/1529"
    46815417                }
    46825418            ]
     
    46865422
    46875423mockedApiResponse.pageAutosave = {
    4688     "author": 389,
     5424    "author": 405,
    46895425    "date": "2017-02-14T00:00:00",
    46905426    "date_gmt": "2017-02-14T00:00:00",
    4691     "id": 36714,
     5427    "id": 1531,
    46925428    "modified": "2017-02-14T00:00:00",
    46935429    "modified_gmt": "2017-02-14T00:00:00",
    4694     "parent": 36712,
    4695     "slug": "36712-autosave-v1",
     5430    "parent": 1529,
     5431    "slug": "1529-autosave-v1",
    46965432    "guid": {
    4697         "rendered": "http://example.org/?p=36714"
     5433        "rendered": "http://example.org/?p=1531"
    46985434    },
    46995435    "title": {
     
    48915627            ]
    48925628        }
     5629    },
     5630    "wp_block": {
     5631        "description": "",
     5632        "hierarchical": false,
     5633        "name": "Blocks",
     5634        "slug": "wp_block",
     5635        "taxonomies": [],
     5636        "rest_base": "blocks",
     5637        "_links": {
     5638            "collection": [
     5639                {
     5640                    "href": "http://example.org/index.php?rest_route=/wp/v2/types"
     5641                }
     5642            ],
     5643            "wp:items": [
     5644                {
     5645                    "href": "http://example.org/index.php?rest_route=/wp/v2/blocks"
     5646                }
     5647            ],
     5648            "curies": [
     5649                {
     5650                    "name": "wp",
     5651                    "href": "https://api.w.org/{rel}",
     5652                    "templated": true
     5653                }
     5654            ]
     5655        }
    48935656    }
    48945657};
Note: See TracChangeset for help on using the changeset viewer.