Class Disciple_Tools_Posts Functions for creating, finding, updating or deleting posts
| package |
Disciple_Tools\Posts |
|---|
__construct()
add_connection_to_post(\string $post_type, \int $post_id, \string $field_key, \int $value)
\string
\int
\string
\int
add_post_contact_method(array $post_settings, \int $post_id, \string $key, \string $value, array $field)
array
\int
\string
\string
array
adjust_post_custom_fields(array $post_settings, integer $post_id, array &$fields, array $fields_to_return = array(), null $meta_fields = null, null $post_user_meta = null) : void
arrayThis is what get_custom_fields_settings() returns
integerThe ID number of the contact
arrayThis array will be mutated with the results
arrayif not empty only add the fields that are specified (optional)
nulla way to pass in the post's meta fields instead of getting in from the database (optional)
nullpass in the user post meta if already available (optional)
can_access(string $post_type) : boolean
string
boolean
can_create(string $post_type) : boolean
string
boolean
can_delete(string $post_type) : boolean
string
boolean
can_update(string $post_type, integer $post_id) : boolean
string
integer
boolean
can_view(string $post_type, integer $post_id) : boolean
string
integer
boolean
can_view_all(string $post_type) : boolean
string
boolean
check_for_invalid_post_fields(array $post_settings, array $fields, array $allowed_fields = array()) : array
array
array
array
array
delete_post(\int $post_id, \string $post_type)
\int
\string
filter_wp_post_object_fields(object $post) : array
object
array
format_post_contact_details( $post_settings, $meta_fields, $type, $key, $value)
get_label_for_post_type( $post_type, $singular = false)
get_most_recent_activity_for_field( $post_id, $field_key) : mixed
mixed
get_post_by_title_cached(string $title, string $output = OBJECT, string|array $post_type = 'page', $connection_type = 'none') : \WP_Post|null
| link |
Uncached Functions |
|---|
stringPage title
stringOptional. Output type; OBJECT*, ARRAY_N, or ARRAY_A.
string|arrayOptional. Post type; default is 'page'.
\WP_Post|nullWP_Post on success or null on failure
get_posts_shared_with_user(string $post_type, integer $user_id, $search_for_post_name = '') : array
string
integer
array
get_subassigned_users( $post_id)
get_viewable(string $post_type, integer $most_recent) : array|\WP_Error|\WP_Query
string
integer
array|\WP_Error|\WP_Query
is_post_key_contact_method_or_connection( $post_settings, $key)
remove_connection_from_post(\string $post_type, \int $post_id, \string $field_key, \int $value)
\string
\int
\string
\int
search_viewable_post(\string $post_type, array $query, \bool $check_permissions = true)
\string
array
\bool
unique_hash()
update_connections(array $post_settings, \int $post_id, array $fields, $existing_contact = null)
array
\int
array
update_location_grid_fields(array $field_settings, \int $post_id, array $fields, $post_type, array $existing_post = null)
array
\int
array
array
update_multi_select_fields(array $field_settings, \int $post_id, array $fields, array $existing_contact = null)
array
\int
array
array
update_post_contact_method(\int $post_id, \string $key, array $values)
\int
\string
array
update_post_contact_methods(array $post_settings, \int $post_id, array $fields, array $existing_contact = null)
array
\int
array
array