background preloader

Wordpress

Facebook Twitter

Tutoriel vidéo WordPress : Créer un widget Wordpress. Writing a Plugin. Languages: English • العربية • বাংলা • Español • Italiano • a Plugin 日本語 한국어 • Português do Brasil • Русский • ไทย • 中文(简体) • (Add your language) WordPress Plugins allow you to easily modify, customize, and enhance a WordPress site.

Writing a Plugin

Instead of changing the core program code of WordPress, you can add functionality with WordPress Plugins. Here is a basic definition. 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 site. You can seamlessly integrate a plugin with the site using access points and methods provided by the WordPress Plugin Application Program Interface (API). Wish that WordPress had some new or modified functionality?

This article assumes you are already familiar with the basic functionality of WordPress and with PHP programming. Resources To understand how WordPress Plugins work and how to install them on your WordPress blog, see Plugins. Plugin Name Home Page. 7 Simple Rules: WordPress Plugin Development Best Practices. We've been talking a lot about "Best Practices" here on Wptuts lately.

7 Simple Rules: WordPress Plugin Development Best Practices

Today, we'll cover some important best practices for creating a WordPress plugin. From security tips to namespacing tricks, follow these rules and you'll do no wrong. Whether you're a budding new plugin developer or a time-tested veteran, these simple rules and suggestions will make you a better developer (and the community will thank you for it!)

Rule 01: Have a Strategy Yes, a strategy. Is my plugin just for fun/demonstration purposes or for everyday use in the real world? These questions are important because they impact on how seriously you need to take issues such as coding standards, updates, security, support and documentation. Rule 02: Use Consistent and Clear Coding Standards Which do you prefer, this? Or this? Simple things like consistent spacing, indenting, informative variable naming and succinct comments are a good place to start. Use Namespacing Rule 03: Take Security Seriously Sanitize inputs, escape outputs. Advertisement Plugins are a major part of why WordPress powers millions of blogs and websites around the world.

The ability to extend WordPress to meet just about any need is a powerful motivator for choosing WordPress over other alternatives. Having written several plugins myself, I’ve come to learn many (but certainly not all) of the ins-and-outs of WordPress plugin development, and this article is a culmination of the things I think every WordPress plugin developer should know. Oh, and keep in mind everything you see here is compatible with WordPress 3.0+. Don’t Develop Without Debugging The first thing you should do when developing a WordPress plugin is to enable debugging, and I suggest leaving it on the entire time you’re writing plugin code. Enabling debugging also turns on WordPress notices, which is important because that’s how you’ll know if you’re using any deprecated functions. How to Enable Debugging define('WP_DEBUG', false); Replace that line with the following: if (!

If (! Créer un thème de A à Z - Tutoriel WordPress.