• 0

How to include multiple sections into one plugin


Posted (edited) · Report post

I've figured out how to turn a single section into a plugin by looking at the code for the PL Next Box. And this loads into DMS with no problems. 


Here's an example of the header

  Plugin Name: SMS Spacer
  PageLines: true
  Version: 1.0.0
  Section: true
  Class Name: SMS_Spacer
  Filter: component
  Loading: active

class SMS_Spacer extends PageLinesSection {
  //do section stuff

However, I have yet to figure out how to load in a pack of sections from one plugin. Is this possible?


Am I posting this message in the most applicable forum category?

Edited by rsmm

Share this post

Link to post
Share on other sites

2 answers to this question

  • 0

Posted · Report post

Hey There,


A lot of people use a section wrapper to create the effect you're going for.  If you look at many of the third party sections that are out there you can see how it's done.  We also have a starter section that you can use for reference.




The way it works is that the first level is the 'plugin' which tells WordPress to look in the sections folder.  In that sections folder you can put multiple sections, at least I believe you can. I personally haven't tested it out in a while.  


The reason for that is because when you're creating extensions for WordPress, the best practice is to separate functionality into multiple plugins/sections. This way users can choose which functionality they want enabled and which they don't.


Hope that helps!



Share this post

Link to post
Share on other sites
  • 0

Posted · Report post

Great. I'll give this a try.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now