background preloader

Administration Menus

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 Related:  WORDPRESS Developpement

Creating Options Pages ? WordPress Codex Creating Options Pages Languages: English • 日本語 • Русский • (Add your language) This article is in transition to meet Settings API, which was introduced in Version 2.7. For information prior to 2.7 see this revision. Introduction Creating custom options panels in WordPress is relatively easy. First, to create the menu item and the new page, see Adding Administration Menus. So long as you stick to this structure, WordPress will handle all of the option creation, update, saving, and redirection for you. Several new functions were added in WordPress 2.7. This article only covers the markup of the Settings page itself. Where to Save the Code You can either put the code for your options page in your plugin php file (or, for Themes, in functions.php), or you can create a second file called options.php, for example, and include it using the php include function - Opening the Page <div class="wrap"><h2>Your Plugin Page Title</h2> Form Tag Closing Tags <?

70 Expert Ideas For Better CSS Coding Advertisement CSS isn’t always easy to deal with. Depending on your skills and your experience, CSS coding can sometimes become a nightmare, particularly if you aren’t sure which selectors are actually being applied to document elements. An easy way to minimize the complexity of the code is as useful as not-so-well-known CSS attributes and properties you can use to create a semantically correct markup. We’ve taken a close look at some of the most useful CSS tricks, tips, ideas, methods, techniques and coding solutions and listed them below. And what has come out of it is an overview of over 70 expert CSS ideas which can improve your efficiency of CSS coding. We’d like to express sincere gratitude to all designers who shared their ideas, techniques, methods, knowledge and experience with their readers. Update (29/05/2007): Brazilian-Portuguese translation of the article2 is also available. 1.1. 1.2. 1.3. Keep containers to a minimum. 1.4.

Ultimate Guide to Roles and Capabilities » SolisLab Since Roles and Capabilities are introduced in WordPress 2.0, the User Level approach has been declared deprecated. However, it’s disappointing that a lot of plugins and themes out there still use user levels to control access to admin option pages and other functionalities. This guide shows you how to properly use Roles and Capabilities in your plugins and themes. Note: This article is a long one, therefore you should probably bookmark it so that you can always come back later for reference. Table of Contents What are Roles and Capabilities? As in other CMS and web applications, WordPress has a built-in system to verify whether a particular user has enough privilege to take a certain action. This system of Roles and Capabilities is much more flexible than User Level, since it enables you to add, remove or reassign capabilities among roles. Capabilities and administration menus As you can see, there’s always a required parameter called capability for each of those functions. WP_Role Class

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. 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. For a thorough listing of all action and filter hooks in WP see Adam Brown's WordPress Hooks Database. Function Reference Actions Modify database data. The basic steps to make this happen (described in more detail below) are: where:

Plugin API/Action Reference Languages: English • Русский • 日本語 • Português do Brasil • (Add your language) This is a (hopefully) comprehensive list of action hooks available in WordPress version 2.1 and above. For more information: To learn more about what filter and action hooks are, see Plugin API. (If you want to add to or clarify this documentation, please follow the style of the existing entries. Actions Run During a Typical Request These actions are called when a logged-in user opens the home page in Version 3.3.1. Actions are called with the function do_action(), except those marked (ref array), which are called with the function do_action_ref_array(). Actions Run During an Admin Page Request These actions are run when a logged-in user opens the Posts page in Version 3.3.1. In these actions, (hookname) depends on the page. Post, Page, Attachment, and Category Actions (Admin) post_submitbox_misc_actions add_attachment Runs when an attached file is first added to the database. add_category Same as create_category. wp

Writing a Plugin ? WordPress Codex 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. 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. 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. This section of the article goes through the steps you need to follow – and some things you need to to consider – when creating a well-structured WordPress Plugin. Plugin Name

flickrRSS for WordPress — Eightface This WordPress plugin allows you to display Flickr photos on your weblog. It supports user, set, favorite, group and community photostreams, and is relatively easy to setup and configure via a settings panel. The plugin also has cache support, allowing you to save thumbnails on your own server. Download flickrRSS from Installation Put the flickrRSS files into your plugins directory.Activate the plugin.Configure your options under the Settings tab.To use an image cache, create a writable directory and specify its location in the settings.Add <? Support & Questions At the moment, I’m not using the plugin and don’t have the time to support it. Want to work on the plugin? If you want to improve things, I’ve dropped the code on github, so you can fork it and have a go.

Rôles, droits et privilèges des utilisateurs WordPress WordPress utilise un concept de rôles, conçu pour donner au propriétaire du site la possibilité de contrôler ce que les utilisateurs peuvent ou ne peuvent pas faire sur le site. Un propriétaire de site peut donc gérer l'accès des utilisateurs à des tâches telles que l'écriture et l'édition d'articles, la création de pages, la définition des liens, créer des catégories, modérer les commentaires, la gestion des plugins, la gestion des thèmes, et la gestion des autres utilisateurs, en assignant un rôle spécifique à chacun des utilisateurs. Qui a le droit de quoi sur WordPress ? Administrateur : Accès à toutes les fonctionnalités de l'administration WordPressEditeur : Peut publier et gérer les pages ainsi que celles des autres utilisateursAuteur : Peut publier et gérer ses propres articles uniquementContributeur : Peut écrire et gérer ses propres articles mais ne peut pas les publierAbonné : Peut uniquement gérer son profil Récapitulatif des Rôles, droits et privilèges sous WordPress

WordPress hooks database - action and filter hooks for wp plugin developers -- Adam Brown, BYU Political Science What is a hook? In brief, WordPress hooks enable you to change how WordPress behaves without editing any core files. Because you leave the WordPress files untouched, you can painlessly upgrade your blog with each new version of WordPress. If you don't know what WordPress hooks are for, read the Plugin API or this tutorial. What is this directory? If you're a plugin or theme developer, you know how difficult it can be to figure out which hooks are available. What is this good for? See what new hooks are available with each new version of WordPress See which hooks have been deprecated or renamed (use the "view all hooks" option) Easily learn exactly which WP file(s) use each hook. How to help? Update and improve the official action and filter references.

Wordpress Reference Guide 3.0+ Presented by: Get Attachment Link get_attachment_link(); Returns the URI of the page for an attachment. $id Integer • Default: The current post ID, when used in The Loop. (Optional) The numeric ID of the attachment. Is Attachment is_attachment(); This Conditional Tag checks if an attachment is being displayed. The Attachment Link the_attachment_link(); Outputs a hyperlink to the attachment file, or Missing Attachment if the attachment can't be found. Integer • Default: the ID of the current post (Optional) ID of the desired attachment. $fullsize Boolean • Default: false (Optional) For an image attachment, use the original image (true) or Wordpress-generated thumbnail (false). $permalink (Optional) Link to the attachment page (true) or directly to the file/image (false). WP Attachment Is Image wp_attachment_is_image(); This function determines if a post's attachment is an image. $post_id Integer • Default: 0 Integer ID of the post. WP Get Attachment Image wp_get_attachment_image(); $attachment_id $size

Ten Things Every WordPress Plugin Developer Should Know - Smashing Magazine 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. 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: With those lines added to your wp-config.php file, debugging is fully enabled. if (! if (!

Event Calendar Inserts a list of the next few upcoming events. The formatting of the list is highly configurable. Simple Example: Add this code to your sidebar.php <li>Events <?php ec3_get_events(5); ? Parameters: $limit The maximum number of future events or days to list. $template_event (OPTIONAL) DEFAULT=”<a xhref=’%LINK%’>%TITLE% (%TIME%)</a>”. %TITLE% - the title of the event. $template_day (OPTIONAL) DEFAULT=”%DATE%:”. %DATE% - The date of the post. $date_format (OPTIONAL) DEFAULT=”j F”. $template_month (OPTIONAL) DEFAULT=”". %MONTH% - The month of the post. $month_format (OPTIONAL) DEFAULT=”F Y”. Example 1. <li>Events <? 2 January: First event. 5 January: Second event. 5 January: Third event. Example 2. <li>Events <? 2 January: First event. (10:00) 5 January: Second event. (09:00) Third event. (12:00) 14 February: Fourth event. Example 3. <li>Events <? January 2006: 2: First event. 5: Second event. 5: Third event.

User Switching J’ai parlé récemment du plugin User Admin Password qui permet de se connecter à votre site avec le profil d’un de vos membres. User Switching permet la même manipulation de manière très différente. En allant sur le profil du membre, vous verrez apparaître un nouveau lien « Switch to » qui va vous permettre de vous mettre à la place du membre. Vous pouvez vous reconnecter automatiquement en tant qu’administrateur en cliquant sur le lien « Switch back to » qui apparait sur le tableau de bord du membre. Utilisation - site du plugin: - compatibilité à ce jour: WP 3.1 > WP 3.5.1 - version testée: 0.7.1

Function Reference/wp upload dir Function Reference/wp upload dir Description Returns an array of key => value pairs containing path information on the currently configured uploads directory. Checks the 'upload_path' option, which should be from the web root folder, and if it isn't empty it will be used. The upload URL path is set either by the 'upload_url_path' option or by using the 'WP_CONTENT_URL' constant and appending '/uploads' to the path. If the 'uploads_use_yearmonth_folders' is set to true (checkbox if checked in the administration settings panel), then the time will be used. If the path couldn't be created, then an error will be returned with the key 'error' containing the error message. On success, the returned array will have many indices: Usage Parameters $time (string) (optional) Time formatted in 'yyyy/mm'. Default: null Example Basic example to produce the upload directory URL. More in-depth break down of the data returned. <? Important Note Folder Name define( 'UPLOADS', trailingslashit( WP_CONTENT_DIR ).' Related