Class DT_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
add_shared(string $post_type, integer $post_id, integer $user_id, array $meta = null, boolean $send_notifications = true, boolean $check_permissions = true, boolean $insert_activity = true) : false|integer|\WP_Error
string
integer
integer
array
boolean
boolean
boolean
false|integer|\WP_Error
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
create_post(string $post_type, array $fields, boolean $silent = false, boolean $check_permissions = true) : array|\WP_Error
string
array
boolean
boolean
array|\WP_Error
delete_post(\int $post_id, \string $post_type)
\int
\string
delete_post_comment(\int $comment_id, \bool $check_permissions = true)
\int
\bool
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(string $post_type, integer $post_id, boolean $use_cache = true, boolean $check_permissions = true) : array|\WP_Error
string
integer
boolean
boolean
array|\WP_Error
get_post_activity(string $post_type, integer $post_id, array $args = array()) : array|null|object|\WP_Error
string
integer
array
array|null|object|\WP_Error
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_post_comments(string $post_type, integer $post_id, boolean $check_permissions = true, string $type = "all", array $args = array()) : array|integer|\WP_Error
string
integer
boolean
string
array
array|integer|\WP_Error
get_post_settings(string $post_type) : array|\WP_Error
string
array|\WP_Error
get_post_single_activity(\string $post_type, \int $post_id, \int $activity_id)
\string
\int
\int
get_posts_shared_with_user(string $post_type, integer $user_id, $search_for_post_name = '') : array
string
integer
array
get_shared_with(string $post_type, integer $post_id, boolean $check_permissions = true) : array|mixed
string
integer
boolean
array|mixed
get_subassigned_users( $post_id)
get_users_following_post( $post_type, $post_id, boolean $check_permissions = true) : array|\WP_Error
boolean
array|\WP_Error
get_viewable(string $post_type, integer $most_recent) : array|\WP_Error|\WP_Query
string
integer
array|\WP_Error|\WP_Query
get_viewable_compact(string $post_type, string $search_string) : array|\WP_Error|\WP_Query
string
string
array|\WP_Error|\WP_Query
is_post_key_contact_method_or_connection( $post_settings, $key)
list_posts( $post_type, $search_and_filter_query) : array|\WP_Error
array|\WP_Error
remove_connection_from_post(\string $post_type, \int $post_id, \string $field_key, \int $value)
\string
\int
\string
\int
remove_shared(string $post_type, integer $post_id, integer $user_id) : false|integer|\WP_Error
string
integer
integer
false|integer|\WP_Error
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(string $post_type, integer $post_id, array $fields, boolean $silent = false, boolean $check_permissions = true) : array|\WP_Error
string
integer
array
boolean
boolean
array|\WP_Error
update_post_comment(\int $comment_id, \string $comment_content, \bool $check_permissions = true, \string $comment_type = "comment")
\int
\string
\bool
\string
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
add_post_comment
Arguments
$post_type
string$post_id
integer$comment_html
string$type
stringnormally 'comment', different comment types can have their own section in the comments activity
$args
array[user_id, comment_date, comment_author etc]
$check_permissions
boolean$silent
booleanResponse
false|integer|\WP_Error