is conditional settings possible?

Forum Homepage Forums Community General is conditional settings possible?

This topic contains 3 replies, has 2 voices, and was last updated by Avatar of bowe bowe 11 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1377
    Avatar of Ünsal Korkmaz
    unsalkorkmaz
    Participant
    Post count: 40

    I want to add extra options to theme panel with conditions.. like:

    <code>if (get_option("example_option")) {
     /* add option to theme settings here */
    }
    </code>

    is it possible?

    #1378
    Avatar of bowe
    bowe
    Participant
    Post count: 698

    Currently you can link options together with your options.ini file. I don’t think you can show/hide an option based on if the option is filled in. It’s something that we really want to do in the future (using Ajax to show/hide more options as soon as a user selects a radio box for example.

    Here’s a code example of how you can link options:

    <code>[balance_box_layout]
    section = "global"
    title = "Box Layout"
    description = "Enable Box layout?"
    type = "select"
    field_options[] = "yes=Yes"
    field_options[] = "no=No"
    default_value = "no"
    
    [balance_box_radius]
    type = "ui/slider"
    section = "global"
    title = "Box Border Radius"
    description = "Select the border radius (rounded corners) of the box"
    default_value="12"
    min = 0
    max = 40
    step = 1
    suffix = " pixels"
    parent = "balance_box_layout"
    </code>

    The magic is in the “parent” directive at the bottom.

    #1379
    Avatar of Ünsal Korkmaz
    unsalkorkmaz
    Participant
    Post count: 40

    I mean blog options. Basically: “if a plugin activated, show an extra option” like that

    #1380
    Avatar of bowe
    bowe
    Participant
    Post count: 698

    This is a good feature request.. I know it can be done using our Extensions API.. @marshall could you chip in?

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.