• Resolved Trinadin

    (@nathannoom)


    How on earth do you utilize the Toggle functionality?! Not a single tutorial exists for this anywhere on the internet. The feature is there if you check the box when generating your plugin, but you’re on your own to figure out how to use it. I’ve dug through the code and I can’t figure it out. Help?!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter Trinadin

    (@nathannoom)

    FYI, this does not work. All the other field types work this way, and this is what the demo shows, but it does nothing.

    public function setUp() {
    $this->addSettingFields(
    [
    ‘type’ => ‘toggle’,
    ]
    );
    }

    Plugin Author miunosoft

    (@miunosoft)

    Hi,

    I think you are looking for a tutorial for collapsible sections. Basically you just set non-true value to the collapsible section argument. Check out the code examples of sections in advanced usage.

    Hope this helps.

    Thread Starter Trinadin

    (@nathannoom)

    Thank you for the response.

    I’m actually referring to the “toggle” feature under “Bundled Custom Field Types.” The description is as follows:

    toggle – lets the user toggle a switch button.

    I’m unable to find any working examples of it, and the ones I do see in the demo don’t seem to work. type=”toggle” doesn’t do anything for me.

    Plugin Author miunosoft

    (@miunosoft)

    Ah, I see.

    You are talking about the one shown in the custom field types.

    Please refer to the FAQ item, Custom field types do not seem to show up. What did I do wrong?

    • This reply was modified 7 years, 9 months ago by miunosoft. Reason: formatting the link
    Thread Starter Trinadin

    (@nathannoom)

    Thank you! I was able to make it show up this way.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to add Toggle?!’ is closed to new replies.