Comments (12)
+1 I'm all for this.
Also an extra var/define/constant/whatever to make the class unique would be great. Many times I need to tweet or add something project-specific that doesn't make sense to send in as pull request. It would be very handy in that case to not have conflicts with multiple plugins that use the class.
from wordpress-settings-api-class.
Version number added on 96f4373
@daankortenbach I am not sure what you meant, but doesn't the if ( !class_exists( 'WeDevs_Settings_API' ) )
makes it to not conflict?
from wordpress-settings-api-class.
if ( !class_exists( 'WeDevs_Settings_API' ) )
makes it no conflict but if I use a modified version it will nullify the modifications. But renaming the class will solve that. Simple.
from wordpress-settings-api-class.
Okay got it. But if you have any idea to make the class unique, let me know :)
from wordpress-settings-api-class.
Haha, you funny guy. Sorry dude, sometimes I have a brainfart that just doesn't make sense ;)
(extend class with basename that calls specific class with version number in classname)
from wordpress-settings-api-class.
My suggestion is to rename the class per plugin I use it with. this is what I do. this is to avoid any conflicts with other plugins that may use older or newer version. sometimes I also have small modifications in the class so this will also avoid problems to the other plugins in case my plugin loads first.
from wordpress-settings-api-class.
Why would you want to load the class multiple times for multiple plugins? The cool thing about a class like this is that it can be loaded once and reused in different plugins. Now what I like to do is to use the latest version of the class no matter which plugins that are using it.
from wordpress-settings-api-class.
because I know I have changes. you can use 1 name for all your plugins as you can track and update the class for all your plugins but I think it should still be different than the default from whats in the git.
Other people might use this class with their changes or not and there might be a collision or bad behavior, etc.
I try to submit the changes I do but for example I added input type url which if my class won't load there will be a problem and a bad behavior.
if my pull request will be accepted then it will be fine but maybe other plugin uses the old class and will be loaded first. then there is still a bad behavior.
that's why my plugin uses a different name.
from wordpress-settings-api-class.
So why don't you just rename your class? I really don't get your logic and the big problem here?
Just change line 13 in the main php file.
from wordpress-settings-api-class.
There is no problem. That's what I said. I renamed the class.
On Thu, Apr 9, 2015, 20:55 ahansson89 [email protected] wrote:
So why don't you just rename your class? I really don't get your logic and
the big problem here?Reply to this email directly or view it on GitHub
#21 (comment)
.
from wordpress-settings-api-class.
Well, then it is two different use cases. For other people using this class, without any modifications, they want the WP admin to load the latest version of the class no matter which plugin is using it. This is why I opened this ticket.
from wordpress-settings-api-class.
Just added initial composer support (see readme), so you can stay updated. Haven't added the version number yet. Also updated the directory structure. Added changelog too
from wordpress-settings-api-class.
Related Issues (20)
- [Tips] Creating a single col(colspan 2) subheading field HOT 3
- register_setting 3rd argument is array since 4.7.0 HOT 3
- Register subsection
- Please add feature for subsection.
- Custom Element Class
- Please change settings_sections property private to protected
- Licence your code HOT 1
- Multicheck: unable to uncheck all boxes when defaults are set HOT 3
- Save default values to the database upon activation HOT 4
- What is the get_pages() function used for? HOT 2
- Reset Options to Default HOT 1
- The procedural example does not work. HOT 2
- Release tag
- Only the active Tab fields saved, others don't HOT 2
- Feature Request: Add 'class' field attribute
- Directly Into theme
- New Release
- Number field does not rendering min, max and step attribute
- It is not working for network setting page? HOT 4
- Password field values are saved as plain-text HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wordpress-settings-api-class.