A Crash-Course in WordPress Plugin Development Despite an extensive codex, many WordPress users remain unfamiliar with how to create their own custom plugins. In today's screencast, we'll start from scratch and build our first usable plugin. For this example, we'll write a simple "tuts formatting" function that allows a blog editor to more easily format articles. When creating a WordPress plugin, the first step is obviously to make sure that you have access to a WordPress installation. Visit WordPress.org and download the most recent version to your harddrive. * Note - this isn't a "getting started with WordPress" tutorial. Once WordPress is running, browse to wp-content -> plugins. Within the plugins folder, right-click and create a new folder - call it "Tuts_Formatting". WordPress recognizes these comments and then creates an option within your admin panel. Note that if these comments are not included, WordPress will NOT recognize your plugin. Place all headings within H3 tags. That's exactly what I did. From the WordPress codex...
WordPress Hooks Richmond Virginia Web Developer · Francis Yaconiello I’ve noticed that a bunch of the how-to-write-a-plugin articles out there focus on demonstrating the minimum amount of code needed to get a plugin going. Not many focus on good plugin structure or convention. This tutorial explains how to create a class based WordPress plugin that makes sense. Start with a Directory WordPress plugins can be defined in a single file or a directory of files. Starting with a directory gives you more flexibility and allows you to use common structures and folder layouts between projects and will add a level of maintainability. Generally, I use the following folder tree: wp-plugin-name.php Every plugin begins with a docblock PHP comment describing the plugin. <? After the plugin definition comment, you need to define your main plugin logic. if(! At the bottom of the plugin class register the activation/deactivation hooks and instantiate the plugin class by calling the constructor. ###Add a settings page Add your menu with a callback to a class function. if(!
Transférer son site distant WordPress en local en moins de 10 étapes Parce qu’il m’est arrivé de me planter plus d’une fois sur des transferts de sites de distant à local avec WordPress, je tenais à partager ma méthode à d’autres, qui, comme moi se sont assez régulièrement pris la tête sur cette manipulation. Vous rencontrerez très souvent ce cas lors de la refonte d’un site. On peut aussi avoir besoin de sauvegarder son site sur son serveur local. 1. Avant toute chose, il faut commencer par exporter la base de données de votre site existant en ligne. Une fois connecté à votre base de données, il faut l’exporter mais pas entièrement. Choisissez une exportation personnalisée et trouvez les meilleurs paramètres selon le cas. 2. Une fois votre base de données téléchargée, vous allez devoir mettre les mains dedans, mais ça reste hyper simple. 3. Il est temps, maintenant de créer votre nouvelle base de données en local. 4. Je ne détaille pas cette étape car elle fait l’objet de nombreux tutoriels sur le web. 5. 6. 7. 8. 9.
uploads - Saving Media - Which Hook is Fired Translate a WordPress Theme Last updated on Lately, more and more people are asking us how to translate a WordPress theme into a language other than English. And with an estimated 2 billion people now online, it’s no wonder. Fortunately, it’s a fairly straightforward process, and I’ve boiled it down into 3 simple steps. This tutorial assumes the WordPress theme to be translated has been localized using the the GNU gettext framework. In other words, the theme is ready to be translated. 1. POT stands for “Portable Object Template,” and a POT file (aka .po file) is basically a list of all the English-language text found within the files of a localized WordPress theme. If you’re using a theme other than a Solostream theme (gasp), check with the theme author to see if they offer a POT file. 2. Once you have the POT file, you’ll need to open it in a program like POEdit, and translate the English language into your preferred language. Find a list of language codes at WordPress in your Language. 3. Other Helpful Links
Plugin API Plugin API Languages: বাংলা • English • Español • Français • 日本語 • 한국어 • Português do Brasil • ไทย • 中文(简体) • Русский • (Add your language) Introduction This page documents the API (Application Programming Interface) hooks available to WordPress plugin developers, and how to use them. This article assumes you have already read Writing a Plugin, which gives an overview (and many details) of how to develop a plugin. This article is specifically about the API of "Hooks", also known as "Filters" and "Actions", that WordPress uses to set your plugin in motion. These hooks may also be used in themes, as described here. Hooks, Actions and Filters Hooks are provided by WordPress to allow your plugin to 'hook into' the rest of WordPress; that is, to call functions in your plugin at specific times, and thereby set your plugin in motion. You can sometimes accomplish the same goal with either an action or a filter. Function Reference Actions Modify database data. Create an Action Function Hook to WordPress
Shortcodes Wordpress Note : Cet article a été publié en août 2011, certaines choses peuvent avoir changé depuis. 2inShare Voici le premier article invité sur WP Themes Pro, il a été rédigé par Vincent Anselmo que j’ai déjà interviewé dans un précédent article car il est développeur de thèmes WordPress. Il a souhaité partager ses connaissances avec les lecteurs de WP Themes Pro, j’espère que cet article vous sera utile :) Si vous souhaitez à votre tour proposer un article, je vous invite à vous rendre sur la page contribuer. Depuis la version 2.5 de WordPress, il est possible d’utiliser les fonctions de l’API Shortcode. Ces fonctions sont désormais incontournables pour tout bon développeur de thèmes et de plug-ins. Qu’est ce qu’un shortcode ? En traduction littérale shortcode signifie “un code court”. Besoin d'un thème WordPress français ? Vous l’aurez compris, les shortcodes sont prévus pour réduire les taches rébarbatives (le copier coller de code HTML par exemple, pour des éléments de mise en page.). 13.
Administration Menus Administration Menus Languages: English • 中文(简体) • 日本語 • Русский • (Add your language) Introduction Usually, plugin and theme authors need to provide access to a settings (options) screen so users can customize how the plugin or theme is used. Function Reference Every Plot Needs a Hook To add an administration menu, you must do three things: Create a function that contains the menu-building code Register the above function using the admin_menu action hook. It is that second step that is often overlooked by new developers. Here is a very simple example of the three steps just described. <? In this example, the function my_plugin_menu() adds a new item to the Settings administration menu via the add_options_page() function. These processes are described in more detail in the sections below. Determining Location for New Menus Before creating a new menu, first decide if the menu should be a top-level menu, or a sub-level menu item. Dashboard Posts Media Links Pages Comments Appearance Plugins Users Tools
Utilizing User Roles In WordPress