Tagged: parts addon subdirectory
- This topic has 6 replies, 3 voices, and was last updated 5 years, 2 months ago by
Jason.
-
AuthorPosts
-
-
November 18, 2016 at 1:29 am #7563
xeiterParticipantHi,
I have a plugin that has addons sitting in subdirectories of the plugin’s directory. I’d like each addon to have its own “parts” directory.
Is it possible to do and how do I do it if it is?
Kind regards,
Anton -
November 21, 2016 at 12:02 pm #7573
-
November 23, 2016 at 1:47 am #7586
xeiterParticipantThank you, Steve – I will check it out!
…and I am really glad that Piklist is not dead. When I saw that other thread I was like… OMG…. all good whew.. offtopic anyway (https://piklist.com/support/topic/is-it-true-that-piklist-is-dead/).
Thank you for your answer.
Kind regards,
Anton -
November 23, 2016 at 2:15 am #7587
xeiterParticipantHi again Steve,
ok I had a look and unfortunately, unless I don’t understand it correctly, you were talking about Piklist addons and I was talking about addons of my plugin.
Basically, here is the set up I have in my plugin. My plugins has:
1) “Plugin Type: Piklist” in the comments section to get it working with Piklist
2) /vendor directory that holds Piklist framework source code
3) /parts directory that by default holds all the Piklist partsI also have
/src/Addonsdirectory and that’s the directory that has my plugins addons (not Piklist addons)./src/Addons/AddonName1
/src/Addons/AddonName2
/src/Addons/AddonName3Under each of the directories above I’d like to have
partsdirectory and only “activate” those parts if my addon, “AddonName1” for example, is “activated” within my plugin (not using addon activation functinoality that Piklist provides).Basically I am seeking a way to breakout of the Piklist path conventions for parts and addons and have the
partsdirectory sit in each of my plugins addons directory:/src/Addons/AddonName1/parts
/src/Addons/AddonName2/parts
/src/Addons/AddonName3/partsApologies if I confused you. I maybe on the wrong path here. The reason I want it this way is that I am building a plugin that allows to activate/deactivate features and each feature would use Piklist.
Kind regards,
Anton -
November 23, 2016 at 10:42 am #7589
SteveKeymaster@xeiter– Unfortunately, that’s not how Piklist works. The folder structure is pretty important.
A few things;
1) When you say add-ons, what do you mean? With Piklist, add-ons are like the built-in Demos.2) You should NOT INCLUDE PIKLIST IN YOUR PLUGIN. I typed that in all caps for a reason… it’s super important. We don’t approve of it, and never will. Here’s why >
Hope that helps.
-
November 23, 2016 at 6:06 pm #7591
xeiterParticipant@Steve, thank you for picking up the issue of having Piklist included in my plugin – I will refactor.
Re: your question 1) when I say Addons I do not mean Piklist addons. I mean my own plugin addons (let’s call them “Features” instead).
I am building a plugin that would get administrators to enable/disable features through the their own WP admin interface (kind of like Piklist Addons or WP Plugins). It uses PSR4 for its folder structure and each Feature sits inside /src/Feature directory. I am using Piklist as a framework for defining CPTs, metaboxes, setting pages etc. – some tihngs are plugin wide definitions and some are Feature specific.
My thinking here was to get each Feature to be incapsulated into its own directory /Features/Feature-1 and that would include the “parts” directory where I would define stuff only related to the particular Feature.
It’s a not a big issue though. if I can’t have it this way, I will re-think how I would use Piklist here.
Kind regards,
Anton -
November 30, 2016 at 9:06 pm #7596
JasonKeymasterHi @xeiter!
I believe I understand that you’re hoping to have sub-directories for say, meta-boxes. So you’d have /parts/meta-boxes/feature/ and /parts/meta-boxes/foo/ as hypothetical directories. If that’s the case, then unfortunately Piklist doesn’t recursively navigate sub-directories out-of-the-box. You could, however, use hooks in the
piklist::process_partsmethod to make this possible. In fact you’d probably end up using those hooks anyway to enable/disable parts (i.e. meta-boxes, terms, settings, etc.) on your own terms.Hope this helps! 🙂
-
-
AuthorPosts
- You must be logged in to reply to this topic.