Support » Plugin: Admin Page Framework » How to add Toggle?!

  • Resolved Nathan Noom

    (@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)
  • Nathan Noom

    (@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.

    Nathan Noom

    (@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 2 months ago by  miunosoft. Reason: formatting the link

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.