Tuesday Oct 07, 2008

How to create project for every WordPress plugin

In the previous entries about WordPress I have describe how to develop a WordPress plugin inside WordPress. This entry describes how to set up a project in NetBeans for every plugin separately. 

Let say that I develop many WordPress plugin. The folder structure is displayed on the picture.

I have folder WordPressPlugins that contains all plugins which I develop. Also I have one copy of WordPress sources in WordPressSources folder jut only for development reason. I will explain the reason later.

Then there is wordpress folder under Apache document root, which is accessible through the URL http://localhost/wordpress.

Now create the next plugin. Open new PHP Application wizard and call the project for example AnotherWPPlugin. The source folder for the project will be under the folder, where all WordPress plugins are developed. NetBeans will create in WordPressPlugins folder AnotherWPPlugin folder with the sources and nbproject folder for NetBeans metadata. The second step in the wizard should look like on the picture.

Basically similar approach is if you want to create project for an already existing plugin. 

In the next step you specify, how the project will be run. Run Configuration should be Local Web Site. The WodPress is reachable under http://localhost/wordpress URL. Also you have to say to NetBeans that the plugin sources has to be copied to the WordPress. So check the Copy files form Source Folder to another location and browse the plugins folder under the Apache's documented root.

So the third step of the wizard should look like:

After creating the project go to the Project properties and add the WordPressSources folder into Include Path. The reason is that we want to have the WordPress API in code completion. Sure we can put into Include Path the wordpress folder located under the Apache's document root, but then you will see the statements from the developed plugin in code completion twise. The first one from the sources folder and the second one from the plugins folder under document root.

NetBeans will create index.php file. You can use it and change the content to be an entry point for the plugin. More here.


Sunday Aug 17, 2008

My first WordPress plugin in NetBeans

When I read Jan's tutorial how to configure WordPress in NetBeans I started to think, how it can be difficult to write a plugin for WordPress and whether NetBeans can help me in this. This entry is tutorial how to write simple plugin for WordPress.

What the plugin will do? The plugin will look through content of displayed entries to replace NetBeans with link to NetBeans.org site. It's simple and it should take only few minutes.

[Read More]

Wednesday Aug 06, 2008

Configuring a NetBeans PHP Project for WordPress

I've been experimenting with WordPress a little bit lately while setting up a blog on my personal web server. The installation was completely smooth, but I was interested in some of the WP internals and also wanted to get a better understanding of what it takes to develop WordPress extensions. So, I set up a NetBeans PHP project for my experiments.

I thought other folks might be interested in this, or perhaps, would like to see how to set up a project in NetBeans for their existing PHP applications in general. Therefore, I wrote this brief tutorial and published it in NetBeans wiki. In the future, I'd like to write another tutorial about developing a real WordPress plugin.

 Comments welcome.

About

This blogs is written by NetBeans developers who contribute to the PHP support mainly.

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today