llms_bulk_delete_user_postmeta( int $user_id, int $post_id, array $data = array() )
Bulk remove user postmeta data.
Parameters Parameters
- $user_id
-
(int) (Required) WP User ID.
- $post_id
-
(int) (Required) WP Post ID.
- $data
-
(array) (Optional) Associative array of meta keys => meta values to delete. If not meta values supplied, all matching items will be removed.
Default value: array()
Return Return
(array|boolean) On error returns an associative array of the submitted keys, each item will be true for success or false for error. On success returns true.
Source Source
File: includes/functions/llms.functions.user.postmeta.php
function llms_bulk_delete_user_postmeta( $user_id, $post_id, $data = array() ) { $res = array_fill_keys( array_keys( $data ), null ); $err = false; if ( ! empty( $data ) ) { foreach ( $data as $key => $value ) { $delete = llms_delete_user_postmeta( $user_id, $post_id, $key, $value ); $res[ $key ] = $delete; if ( ! $delete ) { $err = true; } } } else { $res = llms_delete_user_postmeta( $user_id, $post_id ); $err = ! $res; } return $err ? $res : true; }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.33.0 | Introduced. |