wordpress plugin development

39
Building WordPress plugins Mario Peshev DevriX http://devwp.eu

Upload: mario-peshev

Post on 07-Sep-2014

1.361 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: WordPress Plugin Development

Building WordPress plugins

Mario Peshev

DevriX

http://devwp.eu

Page 2: WordPress Plugin Development

Mario Peshev

1. WordPress Engineer @ Placester

2. DevirX CTO

3. @no_fear_inc

4. Java/PHP/Python

background

Page 3: WordPress Plugin Development

Contents

1. What is a WordPress plugin?

2. Prerequisites

3. Start it Smart

4. Conventions

Page 4: WordPress Plugin Development

What is WordPress plugin?

1. A separate module

2. Hooked to the WordPress core

3. Providing extra functionality

A WordPress Plugin is a program, or a set of one or more functions, written in the PHP scripting language, that adds a specific set of features or services to the WordPress weblog, which can be seamlessly integrated with the weblog using access points and methods provided by the WordPress PluginApplication Program Interface (API).

Page 5: WordPress Plugin Development

Existing Plugins

1. WPORG repository

Page 6: WordPress Plugin Development

WordPress APIsand components

Page 10: WordPress Plugin Development

i18n1. What is I18n?

I18n is a abbreviation

for internationalization, or the process of

making an application ready for

translation.

2. load_plugin_textdomain

3. __()

4. _e()

5. _x, _n ...

Page 12: WordPress Plugin Development

Scripts and Styles

1. wp_enqueue_script

2. wp_enqueue_style

3. admin_enqueue_scripts hook

4. wp_enqueue_scripts hook

* A safe way to add/enqueue a CSS/JS files

to the WordPress generated page

Page 15: WordPress Plugin Development

Top paid plugins

1. Gravity Forms

2. WPML

3. Toolset

4. BackupBuddy

5. UberMenu

6. …and more

Page 16: WordPress Plugin Development

How to create a plugin?

Page 17: WordPress Plugin Development

How to create a plugin?

1. What my plugin will do?

2. Make a plan

3. Follow plugin development

recommendations.

4. Let's do some coding

Page 18: WordPress Plugin Development

Let's create a slider plugin

Page 19: WordPress Plugin Development

Step 1

1. Create a folder in wp-content/plugins

2. Create a new .php file in there

3. Add this on the top of the file:

Page 20: WordPress Plugin Development

Step 2

1. Go to Admin Dashboard and activate the

plugin

Page 21: WordPress Plugin Development

Step 3

1. Create a slide custom post type

Page 22: WordPress Plugin Development

Step 4

1. Slider taxonomy

Page 23: WordPress Plugin Development

Step 5

1. Add Options Page

Create dx-lite-slide-options.php file

Page 24: WordPress Plugin Development

Step 6

1. dx-lite-slide-options.php

Page 25: WordPress Plugin Development

DX Lite Slide Options Page

Page 26: WordPress Plugin Development

Step 7

1. Add some data

Page 27: WordPress Plugin Development

Step 8

1. Add shortcode

Page 28: WordPress Plugin Development

Step 9

1. Add some CSS/JS

Page 29: WordPress Plugin Development

Step 10

1. Create a Page and add Slider shotcode

[dx_display_slideshow]

Page 30: WordPress Plugin Development

The Result

Page 31: WordPress Plugin Development

Demo

Page 32: WordPress Plugin Development

Congratulations!

You have built your first WordPress plugin.

Page 33: WordPress Plugin Development

License

1. It is customary to follow the standard header with

information about licensing for the Plugin. Most Plugins

use the GPL2 license used by WordPress or a

license compatible with the GPL2. To indicate a GPL2

license, include the following lines in your Plugin

Page 36: WordPress Plugin Development

Best Practices1. Find a unique plugin name

2. Setup a plugin prefix (it should be related

with your brand)

3. Use proper constants and functions to

detect paths to plugin files

4. Create activation and deactivation

functions

5. Create an uninstall script

Page 37: WordPress Plugin Development

Submit on WordPress.org

Prepare a readme.txt based on the readme

standards

The readme would define the plugin page

description

Apply for a plugin hosting on WordPress.org

After the approval, you’ll be able to push to

the Subversion repository.

37

Page 38: WordPress Plugin Development

форум програмиране, форум уеб дизайнкурсове и уроци по програмиране , уеб дизайн – безплатно

програмиране за деца – безплатни курсове и уроцибезплатен SEO курс - оптимизация за търсачки

уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop

уроци по програмиране и уеб дизайн за ученициASP.NET MVC курс – HTML, SQL, C#, .NET, ASP.NET MVC

безплатен курс "Разработка на софтуер в cloud среда"

BG Coder - онлайн състезателна система - online judge

курсове и уроци по програмиране , книги – безплатно от Наков

безплатен курс "Качествен програмен код"

алго академия – състезателно програмиране, състезания

ASP.NET курс - уеб програмиране, бази данни, C#, .NET, ASP.NETкурсове и уроци по програмиране – Телерик академия

курс мобилни приложения с iPhone, Android, WP7, PhoneGap

free C# book, безплатна книга C#, книга Java, книга C#Дончо Минков - сайт за програмиранеНиколай Костов - блог за програмиране

C# курс, програмиране, безплатно

Building WordPress plugins

http://academy.telerik.comMario Peshev

http://devwp.eu

Page 39: WordPress Plugin Development

Free Trainings @ Telerik Academy

Telerik Software Academy

academy.telerik.com

Telerik Academy @ Facebook

facebook.com/TelerikAcademy

Telerik Software Academy Forums

forums.academy.telerik.com