Astra_Ext_Advanced_Hooks_Loader::get_specific_rule( string $type = '' )
Get saved specific post/page rules values.
Description
Parameters
- $type
-
(string) (Optional) is type Add rule or exclusion rule.
Default value: ''
Return
(array)
Source
File: addons/advanced-hooks/classes/class-astra-ext-advanced-hooks-loader.php
public function get_specific_rule( $type = '' ) { global $post; $post_id = $post->ID; $location_label = array(); if ( 'exclusion' === $type ) { $locations = get_post_meta( $post_id, 'ast-advanced-hook-exclusion', true ); } else { $locations = get_post_meta( $post_id, 'ast-advanced-hook-location', true ); } if ( ! isset( $locations['specific'] ) ) { return $location_label; } foreach ( $locations['specific'] as $location ) { $label = Astra_Target_Rules_Fields::get_location_by_key( $location ); $location_label[] = array( 'label' => $label, 'value' => $location, ); } return $location_label; }
Expand full source code Collapse full source code View on Trac
Changelog
Version | Description |
---|---|
3.6.4 | Introduced. |