Wp post get (WP-CLI): verschil tussen versies
Naar navigatie springen
Naar zoeken springen
(Nieuwe pagina aangemaakt met '''wp post get'': Get details about a post. Voorbeeld: <pre> $ wp post get 51110 +-----------------------+---------------------------------------------+ | Field...') |
|||
Regel 1: | Regel 1: | ||
− | ''wp post get'': | + | ''wp post get'': Retrieve details about a post. |
+ | <pre> | ||
+ | NAME | ||
+ | |||
+ | wp post get | ||
+ | |||
+ | DESCRIPTION | ||
+ | |||
+ | Gets details about a post. | ||
+ | |||
+ | SYNOPSIS | ||
+ | |||
+ | wp post get <id> [--field=<field>] [--fields=<fields>] [--format=<format>] | ||
+ | |||
+ | OPTIONS | ||
+ | |||
+ | <id> | ||
+ | The ID of the post to get. | ||
+ | |||
+ | [--field=<field>] | ||
+ | Instead of returning the whole post, returns the value of a single field. | ||
+ | |||
+ | [--fields=<fields>] | ||
+ | Limit the output to specific fields. Defaults to all fields. | ||
+ | |||
+ | [--format=<format>] | ||
+ | Render output in a particular format. | ||
+ | --- | ||
+ | default: table | ||
+ | options: | ||
+ | - table | ||
+ | - csv | ||
+ | - json | ||
+ | - yaml | ||
+ | --- | ||
+ | |||
+ | EXAMPLES | ||
+ | |||
+ | # Save the post content to a file | ||
+ | $ wp post get 123 --field=content > file.txt | ||
+ | </pre> | ||
Voorbeeld: | Voorbeeld: | ||
Versie van 7 sep 2022 19:55
wp post get: Retrieve details about a post.
NAME wp post get DESCRIPTION Gets details about a post. SYNOPSIS wp post get <id> [--field=<field>] [--fields=<fields>] [--format=<format>] OPTIONS <id> The ID of the post to get. [--field=<field>] Instead of returning the whole post, returns the value of a single field. [--fields=<fields>] Limit the output to specific fields. Defaults to all fields. [--format=<format>] Render output in a particular format. --- default: table options: - table - csv - json - yaml --- EXAMPLES # Save the post content to a file $ wp post get 123 --field=content > file.txt
Voorbeeld:
$ wp post get 51110 +-----------------------+---------------------------------------------+ | Field | Value | +-----------------------+---------------------------------------------+ | ID | 51110 | | post_author | 4 | | post_date | 2020-05-05 18:13:15 | | post_date_gmt | 2020-05-05 18:13:15 | | post_content | | | post_title | Widgets for ABC - Kies je Toepassing | | post_excerpt | | | post_status | publish | | comment_status | closed | | ping_status | closed | | post_password | | | post_name | widgets-voor-abc-kies-je-apparaat | | to_ping | | | pinged | | | post_modified | 2021-03-12 13:17:54 | | post_modified_gmt | 2021-03-12 12:17:54 | | post_content_filtered | | | post_parent | 0 | | guid | http://en.s1/?page_id=51110 | | menu_order | 0 | | post_type | page | | post_mime_type | | | comment_count | 0 | | nl | null | +-----------------------+---------------------------------------------+