- Timestamp:
- 05/25/2021 01:11:55 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r50717 r51000 57 57 58 58 /** 59 * Registers the routes for the objects of the controller.59 * Registers the routes for posts. 60 60 * 61 61 * @since 4.7.0 … … 101 101 'args' => array( 102 102 'id' => array( 103 'description' => __( 'Unique identifier for the object.' ),103 'description' => __( 'Unique identifier for the post.' ), 104 104 'type' => 'integer', 105 105 ), … … 2154 2154 'properties' => array( 2155 2155 'date' => array( 2156 'description' => __( "The date the object was published, in the site's timezone." ),2156 'description' => __( "The date the post was published, in the site's timezone." ), 2157 2157 'type' => array( 'string', 'null' ), 2158 2158 'format' => 'date-time', … … 2160 2160 ), 2161 2161 'date_gmt' => array( 2162 'description' => __( 'The date the object was published, as GMT.' ),2162 'description' => __( 'The date the post was published, as GMT.' ), 2163 2163 'type' => array( 'string', 'null' ), 2164 2164 'format' => 'date-time', … … 2166 2166 ), 2167 2167 'guid' => array( 2168 'description' => __( 'The globally unique identifier for the object.' ),2168 'description' => __( 'The globally unique identifier for the post.' ), 2169 2169 'type' => 'object', 2170 2170 'context' => array( 'view', 'edit' ), … … 2172 2172 'properties' => array( 2173 2173 'raw' => array( 2174 'description' => __( 'GUID for the object, as it exists in the database.' ),2174 'description' => __( 'GUID for the post, as it exists in the database.' ), 2175 2175 'type' => 'string', 2176 2176 'context' => array( 'edit' ), … … 2178 2178 ), 2179 2179 'rendered' => array( 2180 'description' => __( 'GUID for the object, transformed for display.' ),2180 'description' => __( 'GUID for the post, transformed for display.' ), 2181 2181 'type' => 'string', 2182 2182 'context' => array( 'view', 'edit' ), … … 2186 2186 ), 2187 2187 'id' => array( 2188 'description' => __( 'Unique identifier for the object.' ),2188 'description' => __( 'Unique identifier for the post.' ), 2189 2189 'type' => 'integer', 2190 2190 'context' => array( 'view', 'edit', 'embed' ), … … 2192 2192 ), 2193 2193 'link' => array( 2194 'description' => __( 'URL to the object.' ),2194 'description' => __( 'URL to the post.' ), 2195 2195 'type' => 'string', 2196 2196 'format' => 'uri', … … 2199 2199 ), 2200 2200 'modified' => array( 2201 'description' => __( "The date the object was last modified, in the site's timezone." ),2201 'description' => __( "The date the post was last modified, in the site's timezone." ), 2202 2202 'type' => 'string', 2203 2203 'format' => 'date-time', … … 2206 2206 ), 2207 2207 'modified_gmt' => array( 2208 'description' => __( 'The date the object was last modified, as GMT.' ),2208 'description' => __( 'The date the post was last modified, as GMT.' ), 2209 2209 'type' => 'string', 2210 2210 'format' => 'date-time', … … 2213 2213 ), 2214 2214 'slug' => array( 2215 'description' => __( 'An alphanumeric identifier for the object unique to its type.' ),2215 'description' => __( 'An alphanumeric identifier for the post unique to its type.' ), 2216 2216 'type' => 'string', 2217 2217 'context' => array( 'view', 'edit', 'embed' ), … … 2221 2221 ), 2222 2222 'status' => array( 2223 'description' => __( 'A named status for the object.' ),2223 'description' => __( 'A named status for the post.' ), 2224 2224 'type' => 'string', 2225 2225 'enum' => array_keys( get_post_stati( array( 'internal' => false ) ) ), … … 2230 2230 ), 2231 2231 'type' => array( 2232 'description' => __( 'Type of Post for the object.' ),2232 'description' => __( 'Type of post.' ), 2233 2233 'type' => 'string', 2234 2234 'context' => array( 'view', 'edit', 'embed' ), … … 2246 2246 if ( is_post_type_viewable( $post_type_obj ) && $post_type_obj->public ) { 2247 2247 $schema['properties']['permalink_template'] = array( 2248 'description' => __( 'Permalink template for the object.' ),2248 'description' => __( 'Permalink template for the post.' ), 2249 2249 'type' => 'string', 2250 2250 'context' => array( 'edit' ), … … 2253 2253 2254 2254 $schema['properties']['generated_slug'] = array( 2255 'description' => __( 'Slug automatically generated from the object title.' ),2255 'description' => __( 'Slug automatically generated from the post title.' ), 2256 2256 'type' => 'string', 2257 2257 'context' => array( 'edit' ), … … 2262 2262 if ( $post_type_obj->hierarchical ) { 2263 2263 $schema['properties']['parent'] = array( 2264 'description' => __( 'The ID for the parent of the object.' ),2264 'description' => __( 'The ID for the parent of the post.' ), 2265 2265 'type' => 'integer', 2266 2266 'context' => array( 'view', 'edit' ), … … 2323 2323 case 'title': 2324 2324 $schema['properties']['title'] = array( 2325 'description' => __( 'The title for the object.' ),2325 'description' => __( 'The title for the post.' ), 2326 2326 'type' => 'object', 2327 2327 'context' => array( 'view', 'edit', 'embed' ), … … 2332 2332 'properties' => array( 2333 2333 'raw' => array( 2334 'description' => __( 'Title for the object, as it exists in the database.' ),2334 'description' => __( 'Title for the post, as it exists in the database.' ), 2335 2335 'type' => 'string', 2336 2336 'context' => array( 'edit' ), 2337 2337 ), 2338 2338 'rendered' => array( 2339 'description' => __( 'HTML title for the object, transformed for display.' ),2339 'description' => __( 'HTML title for the post, transformed for display.' ), 2340 2340 'type' => 'string', 2341 2341 'context' => array( 'view', 'edit', 'embed' ), … … 2348 2348 case 'editor': 2349 2349 $schema['properties']['content'] = array( 2350 'description' => __( 'The content for the object.' ),2350 'description' => __( 'The content for the post.' ), 2351 2351 'type' => 'object', 2352 2352 'context' => array( 'view', 'edit' ), … … 2357 2357 'properties' => array( 2358 2358 'raw' => array( 2359 'description' => __( 'Content for the object, as it exists in the database.' ),2359 'description' => __( 'Content for the post, as it exists in the database.' ), 2360 2360 'type' => 'string', 2361 2361 'context' => array( 'edit' ), 2362 2362 ), 2363 2363 'rendered' => array( 2364 'description' => __( 'HTML content for the object, transformed for display.' ),2364 'description' => __( 'HTML content for the post, transformed for display.' ), 2365 2365 'type' => 'string', 2366 2366 'context' => array( 'view', 'edit' ), … … 2368 2368 ), 2369 2369 'block_version' => array( 2370 'description' => __( 'Version of the content block format used by the object.' ),2370 'description' => __( 'Version of the content block format used by the post.' ), 2371 2371 'type' => 'integer', 2372 2372 'context' => array( 'edit' ), … … 2385 2385 case 'author': 2386 2386 $schema['properties']['author'] = array( 2387 'description' => __( 'The ID for the author of the object.' ),2387 'description' => __( 'The ID for the author of the post.' ), 2388 2388 'type' => 'integer', 2389 2389 'context' => array( 'view', 'edit', 'embed' ), … … 2393 2393 case 'excerpt': 2394 2394 $schema['properties']['excerpt'] = array( 2395 'description' => __( 'The excerpt for the object.' ),2395 'description' => __( 'The excerpt for the post.' ), 2396 2396 'type' => 'object', 2397 2397 'context' => array( 'view', 'edit', 'embed' ), … … 2402 2402 'properties' => array( 2403 2403 'raw' => array( 2404 'description' => __( 'Excerpt for the object, as it exists in the database.' ),2404 'description' => __( 'Excerpt for the post, as it exists in the database.' ), 2405 2405 'type' => 'string', 2406 2406 'context' => array( 'edit' ), 2407 2407 ), 2408 2408 'rendered' => array( 2409 'description' => __( 'HTML excerpt for the object, transformed for display.' ),2409 'description' => __( 'HTML excerpt for the post, transformed for display.' ), 2410 2410 'type' => 'string', 2411 2411 'context' => array( 'view', 'edit', 'embed' ), … … 2424 2424 case 'thumbnail': 2425 2425 $schema['properties']['featured_media'] = array( 2426 'description' => __( 'The ID of the featured media for the object.' ),2426 'description' => __( 'The ID of the featured media for the post.' ), 2427 2427 'type' => 'integer', 2428 2428 'context' => array( 'view', 'edit', 'embed' ), … … 2432 2432 case 'comments': 2433 2433 $schema['properties']['comment_status'] = array( 2434 'description' => __( 'Whether or not comments are open on the object.' ),2434 'description' => __( 'Whether or not comments are open on the post.' ), 2435 2435 'type' => 'string', 2436 2436 'enum' => array( 'open', 'closed' ), … … 2438 2438 ); 2439 2439 $schema['properties']['ping_status'] = array( 2440 'description' => __( 'Whether or not the object can be pinged.' ),2440 'description' => __( 'Whether or not the post can be pinged.' ), 2441 2441 'type' => 'string', 2442 2442 'enum' => array( 'open', 'closed' ), … … 2447 2447 case 'page-attributes': 2448 2448 $schema['properties']['menu_order'] = array( 2449 'description' => __( 'The order of the object in relation to other object of its type.' ),2449 'description' => __( 'The order of the post in relation to other posts.' ), 2450 2450 'type' => 'integer', 2451 2451 'context' => array( 'view', 'edit' ), … … 2458 2458 2459 2459 $schema['properties']['format'] = array( 2460 'description' => __( 'The format for the object.' ),2460 'description' => __( 'The format for the post.' ), 2461 2461 'type' => 'string', 2462 2462 'enum' => $formats, … … 2474 2474 if ( 'post' === $this->post_type ) { 2475 2475 $schema['properties']['sticky'] = array( 2476 'description' => __( 'Whether or not the object should be treated as sticky.' ),2476 'description' => __( 'Whether or not the post should be treated as sticky.' ), 2477 2477 'type' => 'boolean', 2478 2478 'context' => array( 'view', 'edit' ), … … 2481 2481 2482 2482 $schema['properties']['template'] = array( 2483 'description' => __( 'The theme file to use to display the object.' ),2483 'description' => __( 'The theme file to use to display the post.' ), 2484 2484 'type' => 'string', 2485 2485 'context' => array( 'view', 'edit' ), … … 2511 2511 $schema['properties'][ $base ] = array( 2512 2512 /* translators: %s: Taxonomy name. */ 2513 'description' => sprintf( __( 'The terms assigned to the object in the %s taxonomy.' ), $taxonomy->name ),2513 'description' => sprintf( __( 'The terms assigned to the post in the %s taxonomy.' ), $taxonomy->name ), 2514 2514 'type' => 'array', 2515 2515 'items' => array( … … 2781 2781 2782 2782 $query_params['orderby'] = array( 2783 'description' => __( 'Sort collection by object attribute.' ),2783 'description' => __( 'Sort collection by post attribute.' ), 2784 2784 'type' => 'string', 2785 2785 'default' => 'date',
Note: See TracChangeset
for help on using the changeset viewer.