Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
LLMS_Post_Relationships::unset_relationships( WP_Post $post, array $data )
Unsets relationship data from post_meta when a post is deleted.
Parameters Parameters
- $post
-
(WP_Post) (Required) WP Post that's been deleted.
- $data
-
(array) (Required) Relationship data array.
Return Return
(void)
Source Source
File: includes/class.llms.post.relationships.php
private function unset_relationships( $post, $data ) { $relationships = $this->get_related_posts( $post->ID, $data['post_type'], $data['meta_key'] ); foreach ( $relationships as $id ) { delete_post_meta( $id, $data['meta_key'], $post->ID ); if ( isset( $data['meta_keys_additional'] ) ) { foreach ( $data['meta_keys_additional'] as $key ) { delete_post_meta( $id, $key ); } } } }
Expand full source code Collapse full source code View on GitHub
Changelog Changelog
Version | Description |
---|---|
3.24.0 | Unknown. |
3.16.12 | Introduced. |