Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $element->add_control(
- 'wpf_visibility',
- [
- 'label' => __( 'Visibility', 'wp-fusion' ),
- 'type' => \Elementor\Controls_Manager::SELECT,
- 'default' => 'everyone',
- 'options' => array(
- 'everyone' => __( 'Everyone', 'wp-fusion' ),
- 'loggedin' => __( 'Logged In Users', 'wp-fusion' ),
- 'loggedout' => __( 'Logged Out Users', 'wp-fusion' ),
- ),
- 'multiple' => false,
- 'label_block' => true,
- ]
- );
- $element->add_control(
- 'wpf_tags',
- [
- 'label' => sprintf( __( 'Required %s Tags (Any)', 'wp-fusion' ), wp_fusion()->crm->name ),
- 'type' => \Elementor\Controls_Manager::SELECT2,
- 'options' => $data,
- 'multiple' => true,
- 'label_block' => true,
- 'condition' => array(
- 'wpf_visibility' => [ 'loggedin', 'everyone' ],
- ),
- //'description' => __( 'The user must be logged in and have at least one of the tags specified to access the content.', 'wp-fusion' ),
- ]
- );
- $element->add_control(
- 'wpf_tags_all',
- [
- 'label' => sprintf( __( 'Required %s Tags (All)', 'wp-fusion' ), wp_fusion()->crm->name ),
- 'type' => \Elementor\Controls_Manager::SELECT2,
- 'options' => $data,
- 'multiple' => true,
- 'label_block' => true,
- 'condition' => array(
- 'wpf_visibility' => [ 'loggedin', 'everyone' ],
- ),
- //'description' => __( 'The user must be logged in and have <em>all</em> of the tags specified to access the content.', 'wp-fusion' ),
- ]
- );
- $element->add_control(
- 'wpf_tags_not',
- [
- 'label' => sprintf( __( 'Required %s Tags (Not)', 'wp-fusion' ), wp_fusion()->crm->name ),
- 'type' => \Elementor\Controls_Manager::SELECT2,
- 'options' => $data,
- 'multiple' => true,
- 'label_block' => true,
- 'condition' => array(
- 'wpf_visibility' => [ 'everyone', 'loggedin' ],
- ),
- 'description' => __( 'If the user is logged in and has any of these tags, the content will be hidden.', 'wp-fusion' ),
- ]
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement