Astra_Target_Rules_Fields::remove_exclusion_rule_posts( string $post_type, array $option )
Remove exclusion rule posts.
Description
Parameters
- $post_type
-
(string) (Required) Post Type.
- $option
-
(array) (Required) meta option name.
Source
File: classes/modules/target-rule/class-astra-target-rules-fields.php
public function remove_exclusion_rule_posts( $post_type, $option ) { $exclusion = isset( $option['exclusion'] ) ? $option['exclusion'] : ''; $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 ) { $exclusion_rules = get_post_meta( $c_post_id, $exclusion, true ); $is_exclude = $this->parse_layout_display_condition( $current_post_id, $exclusion_rules ); if ( $is_exclude ) { 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. |