Tagged Questions
0
votes
3answers
82 views
Need oop for wordpress theme? [duplicate]
I know how to program in PHP, but I don't know OOPS(Object Oriented Programming). Is it better to make themes in OOPS(Object Oriented Programming) or with normal coding? Is it better for performances, ...
-3
votes
1answer
48 views
$_html is empty when var dumped
So I have run across a bizzar issue, in which I know is working as i expect it to in terms of the array values, yet the _html variable returns something like string(29) " " which to my knowledge ...
6
votes
2answers
245 views
What is the correct way to build a widget using OOP
I am working on a simple search form widget, with a built in autocomplete capability (You can download the current version here). The plugin is working, but I am currently rewriting all the code using ...
0
votes
1answer
164 views
Check if a class exists within a method
I'm new to OOP and I'm writing my first plugin. I want to check if the Facebook plugin has already been activated. If so, I want to skip some code:
class MyClass {
...
function fb_js_sdk_setup() ...
0
votes
2answers
89 views
Get options from database using php class
I want to make a php class that gets an option from the wp database (which is an array of options) and be able to call this class with the name of the option and the class to return the options value.
...
1
vote
2answers
167 views
Applying OO patterns and principles to plugin development
I'm busy writing my first plugin, using PHP 5.3.5. I come from a C# environment, and I must say I'm more than happy with the level of support for good, solid OOP techniques in PHP. However, I'm a ...
15
votes
5answers
951 views
Should all plugins be encapsulated in a Class?
When developing a plugin should the functions be grouped together into a Class to avoid namespace conflicts?
Does using classes create performance overheads for PHP?
If there is a performance hit, ...
4
votes
2answers
1k views
Does an activated plugin automatically mean its methods are available to other WP functions?
I made a WordPress plugin like this:
Class MY_CLASS {
//codes
}
Global $myclass;
$myclass = New MY_CLASS ();
After installed and activated the plugin, can I use this class in other plugins without ...
21
votes
6answers
2k views
Using OOP in themes
I see a lot of plugins making use of object-oriented coding when there isn't really necessary.
But what's even worse is that theme developers are starting to do the same thing. Commercial themes and ...
