Astra_Target_Rules_Fields::remove_user_rule_posts( int $post_type, array $option )
Remove user rule posts.
Description
Parameters
- $post_type
-
(int) (Required) Post Type.
- $option
-
(array) (Required) meta option name.
Source
File: classes/modules/target-rule/class-astra-target-rules-fields.php
public function remove_user_rule_posts( $post_type, $option ) {
$users = isset( $option['users'] ) ? $option['users'] : '';
$current_post_id = isset( $option['current_post_id'] ) ? $option['current_post_id'] : false;
foreach ( self::$current_page_data[ $post_type ] as $c_post_id => $c_data ) {
$user_rules = get_post_meta( $c_post_id, $users, true );
$is_user = $this->parse_user_role_condition( $current_post_id, $user_rules );
if ( ! $is_user ) {
unset( self::$current_page_data[ $post_type ][ $c_post_id ] );
}
}
}
Expand full source code Collapse full source code View on Trac
Changelog
| Version | Description |
|---|---|
| 1.0.0 | Introduced. |