Skip to content
Advertisement

WordPress JavaScript

I’m trying to achieve a custom option inside the “Publish Metabox” in WordPress admin custom post. And I want to know is there any native way to do expand/collapse divs (Check the below screenshot).

I wonder how WordPress itself achieves it like the below screenshot? (Maybe match the IDs like bootstrap JS libraries do ?).

Screenshot

Advertisement

Answer

And I want to know is there any native way to do expand/collapse divs.

There is. WordPress uses the jQuery library on the admin side for interactive elements. In this case, it’s just using a simple toggle effect.

Display or hide the matched elements.

JavaScript
JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement