1
vote
1answer
50 views

How do I extend one plugin I'm writing with another I'm writing using classes?

I have a set of plugins that do different things. I'm wanting to write a plugin with a class I can extend in each of my custom plugins to meet a common goal. In my "socket" plugin I have something ...
0
votes
1answer
105 views

learning OOP with wordpress plugin

I used to develop in functional design so far and I am now learning OOP. I stumbled upon following problem. Sometimes in OOP a function needs to send and argument as an array. Example. I want to ...
0
votes
2answers
43 views

private functions in plugins

I've developed two plugins in which one function is the same (same name, same functionality). When trying to activate both plugins Wordpress throws an error because it doesn't let me defining the ...
0
votes
3answers
166 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
69 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
691 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
314 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
135 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
216 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 ...
18
votes
5answers
1k 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
2k 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 ...
24
votes
6answers
3k 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 ...