프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$args | |||
$post_plural | |||
$post_plural_low | |||
$post_singular | |||
$post_singular_low | |||
$post_slug | |||
$post_type | Some other member variables you don't need to worry about: |
프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$defaults | array | The arguments listed are the ones which differ from the defaults in register_post_type(). |
메소드 | 설명 | |
---|---|---|
__construct ( string $post_type, array $args = [], array $names = [] ) | Class constructor. | |
add_query_vars ( array $vars ) : array | Add our filter names to the public query vars. | |
add_taxonomy ( string $taxonomy, array $args = [], array $names = [] ) : object | false | Helper function for registering a taxonomy and adding it to this post type. | |
add_to_feed ( array $vars ) : array | Add our post type to the feed. | |
extend ( stdClass | WP_Post_Type $pto ) | Extends an existing post type object. Currently only handles labels. | |
get_filter_vars ( array $query, array $filters ) : array | Get the array of private query vars for the given filters, to apply to the current query in order to filter it by the given public query vars. | |
get_sort_field_vars ( array $vars, array $sortables ) : array | Get the array of private and public query vars for the given sortables, to apply to the current query in order to sort it by the requested orderby field. | |
get_sort_taxonomy_clauses ( array $clauses, array $vars, array $sortables ) : array | Get the array of SQL clauses for the given sortables, to apply to the current query in order to sort it by the requested orderby field. | |
maybe_filter ( WP_Query $wp_query ) | Set the relevant query vars for filtering posts by our front-end filters. | |
maybe_sort_by_fields ( WP_Query $wp_query ) | Set the relevant query vars for sorting posts by our front-end sortables. | |
maybe_sort_by_taxonomy ( array $clauses, WP_Query $wp_query ) : array | Filter the query's SQL clauses so we can sort posts by taxonomy terms. | |
override_private_query_vars ( WP $wp ) : WP | Add to or override our post type archive's private query vars. | |
post_type_link ( string $post_link, WP_Post $post, boolean $leavename, boolean $sample ) : string | Filter the post type permalink in order to populate its rewrite tags. | |
register_post_type ( ) | Registers our post type. | |
registered_post_type ( string $post_type, stdClass | WP_Post_Type $args ) | Action fired after a CPT is registered in order to set up the custom permalink structure for the post type. | |
rewrite_testing_tests ( array $tests ) : array | Add our rewrite tests to the Rewrite Rule Testing tests array. |
public add_query_vars ( array $vars ) : array | ||
$vars | array | Public query variables. |
리턴 | array | Updated public query variables. |
public add_taxonomy ( string $taxonomy, array $args = [], array $names = [] ) : object | false | ||
$taxonomy | string | The taxonomy name. |
$args | array | Optional. The taxonomy arguments. |
$names | array | Optional. An associative array of the plural, singular, and slug names. |
리턴 | object | false | Taxonomy object, or boolean false if there's a problem. |
public add_to_feed ( array $vars ) : array | ||
$vars | array | Request parameters. |
리턴 | array | Updated request parameters. |
public extend ( stdClass | WP_Post_Type $pto ) | ||
$pto | stdClass | WP_Post_Type | A post type object |
public static get_filter_vars ( array $query, array $filters ) : array | ||
$query | array | The public query vars, usually from `$wp_query->query`. |
$filters | array | The filters valid for this query (usually the value of the `admin_filters` or `site_filters` argument when registering an extended post type). |
리턴 | array | The list of private query vars to apply to the query. |
public static get_sort_field_vars ( array $vars, array $sortables ) : array | ||
$vars | array | The public query vars, usually from `$wp_query->query`. |
$sortables | array | The sortables valid for this query (usually the value of the `admin_cols` or `site_sortables` argument when registering an extended post type. |
리턴 | array | The list of private and public query vars to apply to the query. |
public static get_sort_taxonomy_clauses ( array $clauses, array $vars, array $sortables ) : array | ||
$clauses | array | The query's SQL clauses. |
$vars | array | The public query vars, usually from `$wp_query->query`. |
$sortables | array | The sortables valid for this query (usually the value of the `admin_cols` or `site_sortables` argument when registering an extended post type). |
리턴 | array | The list of SQL clauses to apply to the query. |
public maybe_filter ( WP_Query $wp_query ) | ||
$wp_query | WP_Query | The current WP_Query object. |
public maybe_sort_by_fields ( WP_Query $wp_query ) | ||
$wp_query | WP_Query | The current WP_Query object. |
public maybe_sort_by_taxonomy ( array $clauses, WP_Query $wp_query ) : array | ||
$clauses | array | The current query's SQL clauses. |
$wp_query | WP_Query | The current `WP_Query` object. |
리턴 | array | The updated SQL clauses. |
public override_private_query_vars ( WP $wp ) : WP | ||
$wp | WP | The WP request object. |
리턴 | WP | Updated WP request object. |
public post_type_link ( string $post_link, WP_Post $post, boolean $leavename, boolean $sample ) : string | ||
$post_link | string | The post's permalink. |
$post | WP_Post | The post in question. |
$leavename | boolean | Whether to keep the post name. |
$sample | boolean | Is it a sample permalink. |
리턴 | string | The post's permalink. |
public register_post_type ( ) |
public registered_post_type ( string $post_type, stdClass | WP_Post_Type $args ) | ||
$post_type | string | Post type name. |
$args | stdClass | WP_Post_Type | Arguments used to register the post type. |
public rewrite_testing_tests ( array $tests ) : array | ||
$tests | array | The existing rewrite rule tests. |
리턴 | array | Updated rewrite rule tests. |
protected array $defaults | ||
리턴 | array |