Developing WordPress Plugins

Slides:



Advertisements
Similar presentations
WordPress Installation for Beginners Sheila Bergman
Advertisements

RP Designs Semi-Custom e-Commerce Package. Overview RP Designs semi- custom e-commerce package is a complete website solution. Visitors can browse a catalog.
WordPress Themes.
WordPress from Start to Finish Day 3: Working with plugins (
© 2012 Entrinsik, Inc. Informer Administration Exploring the system menu and functions PRESENTER: Jason Vorenkamp| Informer Software Engineer| March 2012.
Wordpress. Background Content Management System Why we use it How it works – PHP – MySQL.
Seattle Drupal Clinic Introduction to Drupal and Web Content Management.
Νοέμβριος 2007 ΝΙΚΟΛΑΟΣ ΚΑΝΤΖΕΛΗΣ Use Worpress to create your own blog WORDPRESS 2.0.
Kick start your career with WordPress
1 of 6 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 Computing for Todays Lecture 22 Yumei Huo Fall 2006.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2006 Microsoft Corporation.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2006 Microsoft Corporation.
Get closer to the most advanced CMS Mihail Semedzhiev Joomla!
Open Source Content Management System - JOOMLA Swapnil S. Chafale Nagpur (M.S.) India Paper-Presentation For ATCON-2009 Conference.
Wordpress Tutorial 22 – 24 April Table of Contents Introduction Designing blog Writing and Publishing blog Pages Posts Categories Tags Links Comments.
Sahil Narang What is CMS? A content management system (CMS) is a computer application that allows publishing, editing and modifying content,
Tutorial Introduction Fidelity NTSConnect is an innovative Web-based software solution designed for use by customers of Fidelity National Title Insurance.
Drupal Workshop Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology, Drupal technology, directories.
Web Content Management Systems. Lecture Contents Web Content Management Systems Non-technical users manage content Workflow management system Different.
WordPress Web. WordPress Blogging system with full content management Personal publishing system Built on PHP scripting language and MySQL relational.
WORDPRESS TECHNOLOGY BY AMEER. WELCOME INTRODUCTION WordPress is an Open Source software system used by millions of people around the world to create.
WordPress Fast Track. What Is WordPress? Learn what WordPress is Know why WordPress is a popular tool in making websites and blogs Discover some of the.
WordPress Plugin Development A Starter Guide For Beginners.
WordPress Architecture ► Core files – PHP ► MySQL database  Configured by the installation script ► wp-content directory  themes subdirectory: layout.
Development of Multiplatform, VR Applications Pablo Figueroa 1, Pierre Boulanger 1, H. J. Hoover 1, Mark Green 2, Robyn Taylor 1 1.University of Alberta.
Seattle Drupal Clinic Introduction to Drupal Part 1: Web Content Management, Advantages/Disadvantages of Drupal, Drupal terminology.
What’s new in Kentico CMS 5.0 Michal Neuwirth Product Manager Kentico Software.
USING WORDPRESS TO CREATE A WEBSITE (RATHER THAN A BLOG) STEP-BY-STEP INSTRUCTIONS.
IBM Lotus Software © 2006 IBM Corporation IBM Lotus Notes Domino Blog Template Steve Castledine.
+ Publishing Your First Post USING WORDPRESS. + A CMS (content management system) is an application that allows you to publish, edit, modify, organize,
: Information Retrieval อาจารย์ ธีภากรณ์ นฤมาณนลิณี
Joomla Awdhesh Kumar Singsys Pte Ltd. What is Joomla? Joomla is an award-winning content management system (CMS), which enables you to build Web sites.
PowerTalk automatically speaks the text in presentations while you operate PowerPoint as usual. It uses computer speech that comes with Windows XP and.
XP Creating Web Pages with Microsoft Office
How to Apply PDF in Flipbook on Website. Description If you are finding solution for applying PDF in flipbook mode on website, and adding multimedia items.
Chapter 5 Using a Template to Create a Resume and Sharing a Finished Document Microsoft Word 2013.
Electronic Document Management By Portford Solutions Group, Inc.
The main menu options and their usage are: Dashboard This will display your main Dashboard ‘homepage’. In the top left of your Dashboard you’ll see some.
Introduction To Simple WordPress Plugin Development
General System Navigation
Intro to WordPress (Using XAMPP)
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Internet Made Easy! Make sure all your information is always up to date and instantly available to all your clients.
Blogging together 1st Vocational School - 1st Laboratory Center
District And Club database
About SharePoint Server 2007 My Sites
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
LMEvents SharePoint Portal How-to Guide
Cascading Style Sheets
What is a Blog? short for Weblog journal on a website
Section 17.1 Section 17.2 Add an audio file using HTML
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Ultimate Guide to WordPress Plugin Development
How to create a website using WordPress? Part 2: Dashboard
Simple Way to Manage WordPress Ads with AdRotate Plugin Guided By:- wpglobalsupport.comwpglobalsupport.com.
Adding Post Type Archive in WordPress Navigation Menus Guided By: wpglobalsupportwpglobalsupport.
Content Management Systems
Easy Way to Improve Your 404 Page Template in Wordpress If you want to improve your 404 error page. So we are here to explain to you how to improve your.
WordPress Plugin Development
Easy Website Creation Using WordPress
WordPress Development
Welcome USAS – R March 20th, 2019 Valley View 4/7/2019.
Wordpress test.cs.edinboro.edu.
Rational Publishing Engine RQM Multi Level Report Tutorial
SAS v17 Contents and schedule.
Presentation transcript:

Developing WordPress Plugins Markku Seguerra http://rebelpixel.com

What is a WordPress plugin? Little applications used to enhance functionality or add specific functions tailored to a site's specific needs.

Some plugins: - Akismet - WordPress Database Backup - WordPress.com Stats - wp-recent-links - Comment Hilite

What do you need to make a plugin? - a problem to solve - some PHP knowledge - some spare time - a test server with your test WordPress (XAMPP is good.)‏

Structure: Things to remember - A unique descriptive name - Naming: myplugin.php or /myplugin/ folder - Readme.txt format for wordpress.org/extend/plugins - Plugin home page - File headers (very important!)‏

Headers <?php /* Plugin Name: Name Of The Plugin Plugin URI: http://mypage.com/myplugin/ Description: What does it do? Version: 1.0 Author: Name Of The Plugin Author Author URI: http://mypage.com/ */ ?>

Include your license details! The GPL (and compatible licenses) is commonly used for plugins.

Plugin Programming Before WP 1.2, customizations required altering the core files, causing conflicts among hacks (remember my-hacks.php?) and making upgrades very tedious. The solution?

Plugin API - Enabled "hooks" - Extend functionality without editing the core code - Two categories: Actions and Filters

Actions Specific points in the WordPress code that can be used to trigger plugin-specified events and functions. add_action( 'hook_name', 'your_function_name', [priority], [accepted_args] );

Sample action: “wp_login” function notify_on_login()‏ { // your code here // email to admin, etc... } add_action('wp_login', 'notify_on_login');

Filters Functions that modify text, lists and various types of information that are used and produced by WordPress. add_filter('hook_name', 'your_filter_function', [priority], [accepted_args]);

Sample filter: “the_content” function add_rss_invite()‏ { // output to screen the link to RSS feed // if 1st time visitor } add_filter('the_content', 'add_rss_invite');

Template Tags Plugins can also be used to generate special template tags that display custom content. - Recent comments - Top posts - Ad display

Storing Plugin Data - For large amount of data, create your own database table. - For fairly small and/or static data, use built-in WP "Options" capability. add_option($name, $value, $deprecated, $autoload); get_option($option); update_option($option_name, $newvalue);

Administration Menus & Pages - There are specific functions to add pages and menu items. add_menu_page(page_title, menu_title, access_level/capability, file, [function]); add_submenu_page(); add_options_page(); add_management_page(); add_theme_page();

Other things to consider - Internationalization - WordPress Coding Standards & inline documentation - Function prefixes to avoid name collision - When creating tables, use $wpdb->prefix - Minimize database writes. - Write secure code! (Use nonces, sanitize, etc.)‏ - Be aware of user roles and capabilities. - Stick to the WordPress API to avoid problems!

Sample plugin: Strip! <?php /* Plugin Name: Strip! Plugin URI: http://rebelpixel.com/ Description: Removes hyperlink tags from a given comment. Version: 0.1 Author: Markku Seguerra Author URI: http://rebelpixel.com/projects/strip/ */

/* Copyright 2008 Markku Seguerra (email : markku@gmail.com)‏ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */

add_filter('comment_text', 'strip_comments_add_admin'); function strip_comments_add_admin($text)‏ { // add the strip button to the comment } add_filter('comment_text', 'strip_comments_add'); add_filter('get_comment_author_link', 'strip_comments_add'); function strip_comments_add($text)‏ // mark the comment as stripped and displays // it without links

add_action('wp_ajax_strip', 'do_strip'); function do_strip()‏ { // function to mark comment as stripped // triggered via ajax } add_action('wp_ajax_unstrip', 'do_unstrip'); function do_unstrip()‏ function strip_selected_tags($text, $tags = array())‏ // our filter function that removes links

add_action('admin_head', 'strip_comments_head'); function strip_comments_head()‏ { // show the necessary css and ajax // functions used in the admin interface }

<script type="text/javascript"> //<![CDATA[ function strip_now(cid) { jQuery.post("<?php echo get_option('siteurl'); ?>/wp-admin/admin-ajax.php", {action:"strip", "c":cid, "cookie": encodeURIComponent(document.cookie)}, function(str) { pn = '#p-' + cid; jQuery(pn).html(str); }); } function unstrip_now(cid) { {action:"unstrip", "c":cid, "cookie": encodeURIComponent(document.cookie)}, //]]> </script>

Thank you! Markku Seguerra http://rebelpixel.com