• Resolved Iulia Cazan

    (@iulia-cazan)


    Hi,

    I am trying to display programmatically some custom UserData attributes in the “select user data” dropdown when I am creating a new conditional statement, but I cannot find the right hook for this.
    I am using the logichop_session_create action to add custom user attributes.

    Is there a filter I could use to achieve this?

    View post on imgur.com

    Please advise.

    Thank you!
    Iulia

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Logic Hop

    (@logichop)

    Hi Lulia,

    We just pushed a new version of Logic Hop (3.4.8) with a filter that will allow you to override and add to the condition builder options.

    If you wanted to add a new User Data option the User Data condition you can now use the following filter:

     function filter_condition_builder ( $builder ) {
       $_builder = json_decode( $builder );
    
       $_builder->userdata->inputs[0]->options->my_custom_var = 'My Custom Var';
    
       return json_encode( $_builder );
     }
     add_filter( 'logichop_admin_condition_builder', 'filter_condition_builder', 10, 1 );

    The object my_custom_var should have the same name as the key you added to the stored UserData. The string ‘My Custom Var’ is the name which will appear in the select option.

    I hope that’s helpful and works for your needs.

    Thanks!

    • This reply was modified 4 years, 7 months ago by Logic Hop.
    Thread Starter Iulia Cazan

    (@iulia-cazan)

    You are amazing! This is perfect, thank you so much!
    Iulia

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Showing UserData custom attributes when creating conditional statements’ is closed to new replies.