Wp post-type (WP-CLI): verschil tussen versies
Naar navigatie springen
Naar zoeken springen
k (Jeroen Strompf heeft pagina Wp post-type(WP-CLI) hernoemd naar Wp post-type (WP-CLI)) |
|||
Regel 1: | Regel 1: | ||
− | ' | + | <pre> |
+ | $ wp help post-type | ||
+ | |||
+ | NAME | ||
+ | |||
+ | wp post-type | ||
+ | |||
+ | DESCRIPTION | ||
+ | |||
+ | Retrieves details on the site's registered post types. | ||
+ | |||
+ | SYNOPSIS | ||
+ | |||
+ | wp post-type <command> | ||
+ | |||
+ | SUBCOMMANDS | ||
+ | |||
+ | get Gets details about a registered post type. | ||
+ | list Lists registered post types. | ||
+ | |||
+ | Get information on WordPress' built-in and the site's [custom post types][1]. | ||
+ | |||
+ | --- | ||
+ | [1] https://developer.wordpress.org/plugins/post-types/ | ||
+ | |||
+ | EXAMPLES | ||
+ | |||
+ | # Get details about a post type | ||
+ | $ wp post-type get page --fields=name,label,hierarchical --format=json | ||
+ | {"name":"page","label":"Pages","hierarchical":true} | ||
+ | |||
+ | # List post types with 'post' capability type | ||
+ | $ wp post-type list --capability_type=post --fields=name,public | ||
+ | +---------------+--------+ | ||
+ | | name | public | | ||
+ | +---------------+--------+ | ||
+ | | post | 1 | | ||
+ | | attachment | 1 | | ||
+ | | revision | | | ||
+ | | nav_menu_item | | | ||
+ | +---------------+--------+ | ||
+ | </pre> |
Huidige versie van 11 okt 2023 om 20:12
$ wp help post-type NAME wp post-type DESCRIPTION Retrieves details on the site's registered post types. SYNOPSIS wp post-type <command> SUBCOMMANDS get Gets details about a registered post type. list Lists registered post types. Get information on WordPress' built-in and the site's [custom post types][1]. --- [1] https://developer.wordpress.org/plugins/post-types/ EXAMPLES # Get details about a post type $ wp post-type get page --fields=name,label,hierarchical --format=json {"name":"page","label":"Pages","hierarchical":true} # List post types with 'post' capability type $ wp post-type list --capability_type=post --fields=name,public +---------------+--------+ | name | public | +---------------+--------+ | post | 1 | | attachment | 1 | | revision | | | nav_menu_item | | +---------------+--------+