background preloader

WordPress

Facebook Twitter

10 Must-Know Skills for a WordPress Plugin Developer. WordPress is the most powerful CMS framework available at the moment. It can be used to create highly flexible and extendable websites with very little work. I believe that the Plugins and Themes structure is the main reason behind its success as a CMS. There are around 21,000 plugins available for free on the official WordPress website. I always prefer creating my own plugins whenever possible. I recommend you learn plugin development; you’ll be able to customize your site very easily and earn good money as a WordPress developer. In this article, I am going to discuss the most essential things you need to know about WordPress plugin development; I am assuming you have a basic knowledge of the WordPress folder structure here. 1.

The first step will be creating your own plugin folder in the /wp-content/plugins folder. Sample file name: wp-multi-slider.php Inside your main file you should have the following comment structure in order for WordPress to identify your plugin. <? 2. 3. 4. 5. 6. How to leverage the Theme Customizer in your own themes. Note: Everything I’m talking about here, including the code, is in beta mode. It will be subject to change. I’ll update this post after release to fix any code changes that may occur between now and then. I’m releasing this post now so that theme authors can start looking at their themes and thinking about how they might want to change the way they do options pages. So, WordPress 3.4 has this nifty new feature you can find on the main Theme selection page. It’s a link next to each theme labeled “Customize”.

This is the new Theme Customizer, and it’s way cool. In fact, you can’t see what it does with a simple picture, so here’s a video. So, now you know what it does, and if you’re a theme author, you’ve probably just gotten some great ideas. First, note that if you already support the built in Custom Header and Custom Background functionality the WordPress core provides, then those will magically show up and work in the theme customizer. Existing Options 1. 2. 3.

Object Orientation Sections. Load Minimum of WordPress. A small contribution for all those using WordPress as a backend, framework or something similar. The applications, especially in the B2B sector, becoming more and more, as do the questions. So far, I've always liked to recommended BackPress. But even a well-maintained standard is feasible, with all its advantages in the context of the philosophy of updates. WordPress reduces initializing to a minimum, if the constant SHORTINIT is set. The wp-settings.php of WordPress is the key. // Stop most of WordPress from being loaded if we just want the basics.if ( SHORTINIT ) return false; Thus, the loading process is much slimmer and files that are loaded later, must be integrated via a Plugin or Theme functions. Activating in wp-config.php via define( 'SHORTINIT', TRUE ); is done quickly and you can start the test, but note: the globals $wp, $wp_query, $wp_the_query was set as NULL. Ultimatum | Unleash WordPress. Learning WordPress: Most Useful Tips and Tutorials - Smashing Magazine.

Welaika/wordless. WP: Query $args. <? Php * WordPress Query Comprehensive Reference * Compiled by luetkemj - luetkemj.com * CODEX: * Source: $args = array( //////Author Parameters - Show posts associated with certain author. 'author' => '1,2,3,' //(int) - use author id [use minus (-) to exclude authors by ID ex. 'author_name' => 'luetkemj', //(string) - use 'user_nicename' (NOT name) //////Category Parameters - Show posts associated with certain categories. 'cat' => 5,//(int) - use category id. 'category_name' => 'staff', 'news', //(string) - use category slug (NOT name). 'category__and' => array( 2, 6 ), //(array) - use category id. 'category__in' => array( 2, 6 ), //(array) - use category id. 'category__not_in' => array( 2, 6 ), //(array) - use category id.

//////Tag Parameters - Show posts associated with certain tags. 'tag' => 'cooking', //(string) - use tag slug. 'tag_id' => 5, //(int) - use tag id. array( Improving security in Wordpress plugins using Nonces. Using a nonce (number used once) is the best way to protect your plugin against a cross-site request forgery (CSRF) hacker-attack. Nonces are used on requests (saving options in admin, Ajax requests, performing an action etc) and prevent unauthorized access by providing a secret 'key' and checking it each time the code is used. Nonces in WordPress Nonces work in the following way: First you generate a nonce with a unique identifierYou pass the nonce along other query data (link or form) to you scriptYou verify the nonce before doing anything else In order to create a nonce you can use wp_create_nonce() function.

$nonce= wp_create_nonce ('my-nonce'); Next, pass the value of $nonce as a parameter in your request. <a href="myplugin.php? You can use wp_verify_nonce() function to check the nonce before you perform any other action in the plugin. $nonce=$_REQUEST['_wpnonce'];if (! And that's all! Using nonce functions WordPress provides couple of functions to simplify the usage of nonces even more. WordPress Plugin Boilerplate Code Generator | Themergency. Super useful WordPress action hooks and filters. Prevent automatic image compression By default, WordPress compress jpg images when you upload them to your blog.

This is useful because it saves bandwidth and loading time, but sometimes you may prefer to have full quality images (For example, if you’re a photographer using WordPress to showcase your work). Paste the code below into your functions.php file to remove automatic compression of images. add_filter('jpeg_quality', function($arg){return 100;}); → Source: Add target=”blank” to all links I’ve never been a fan of target="blank" links, but I’m always surprised to see how clients love them. This function have to be pasted in your functions.php file. function autoblank($text) { $return = str_replace('<a', '<a target="_blank"', $text); return $return; } add_filter('the_content', 'autoblank'); → Source: Add extra contact methods to user profiles. Speed up your WordPress site the right way with this ultimate guide. Give your site a boost! Implement crucial optimization techniques that will improve not only your ySlow score, but your Google rank too.

In this tutorial we will cover all aspects of W3 caching, ySlow, Google page speed, CSS sprites & htaccess rules, to achieve a high ySlow score like i have done on my blog. Before We Begin A quick note before we start, although this tutorial will cover everything in as much detail as is required, there will (wherever possible) be shortcuts, to save you some time. Step 1: Install the Necessary Components Install a Caching Plugin: First off, whatever caching plugin you are using, switch it off NOW!

Install a Database Manager Plugin: Next you will need another plugin called “WP-DBmanager” again search and install this making sure you have no other database plugins installed. Before we go ahead and start improving your site lets first see what were dealing with. ySlow will then check your site, tell you what’s good, what’s bad and everything in between. WP Google Fonts. Google's free font directory is one of the most exciting developments in web typography in a very long time. The amazing rise of this new font resource has made this plugin the most popular font plugin on WordPress and it shows no signs of stopping.

While font plugin solutions like FontBurner.com have helped bring rich typography to WordPress themes, the selection of fonts easily available to the average blogger have been limited. The WP Google Font plugin makes it even easier to use Google's free service to add high quality fonts to your WordPress powered site. Not only does this plugin add the necessary Google code, but it also gives you the ability to assign the Google fonts to specific CSS elements of your website from within the WordPress admin. Or if you would rather, you can target the Google fonts from your own theme's stylesheet. Right now, the Google Directory has hundreds of great fonts, and the selection is steadily growing. The Ultimate WordPress Cheatsheet [Infographic] 12 Must Have Plugins for WordPress {#Infographic} 32inShare There are many reasons webmasters should adopt WordPress as their content management system.

Having access to thousands of plugins available for this platform is a pretty good reason. Plugins can enhance your site’s functionality and enhance your visitors experience on it. We have already listed plenty of search engine optimization, social media, security, cache, and other types of plugins on WP JEDI. Going through all these lists can take a bit of time though. That’s why we have put together the below infographic to help webmasters download the most essential plugins for their sites as fast as possible. Like it? <a href=" width="700" src=" alt="Infographic: WordPress plugins 101"></a><p/><a href=" have plugins for WordPress</a> by <a href=" Jedi</a> Tagged as: infographic. The Buffer Button WordPress-Plugin is ready [How to] 164 Flares Filament.io 164 Flares × Update: We now have a dedicated button page for you, where you can grab the code for the button much faster and customise it right there.

Get the Buffer button here. As of today Joel has made the WP-Plugin for the Buffer Button available for everyone to use. In the past few weeks we tested a very early version on a few blogs who kindly helped us out. How do I get it? All you have to do is do a search plugins for “Buffer Button” from your WordPress dashboard. If you prefer to install it manually by using the code, here is a wonderful tutorial from Mani on his blog. How To Get Buffer into Sharebar Sharebar is a plugin which you can see in use on the lefthand side of each of our posts. If you want to get your Buffer button in there, like we have, here is a tutorial. What does it look like? Here are few nice examples of various bloggers using it already together with their Twitter buttons and other social sharing functions. Nikki Pilkington from NikkiPilkington. Time Release. Tackle Plugin Compatibility Issues While Using Popular Libraries. I recently got a email from a plugin developer, with regards to him having compatibility issues with one of the plugins I had developed.

It turned out that both our plugins used a popular library called PclZip for adding archiving features. Due to the compatibility issue, accessing his plugin would cause a fatal PHP error saying that the PclZip class cannot be re-declared, when both our plugins were activated. The compatibility issue arose because of two things; A mistake on his part while checking for existence of class objects in the code. Here is a code snippet used to check for class existence. if(! The above code is wrong, since: Class names cannot be accessed as functions. The correct way to check if a class exists or not can be seen in the following code. if(! This change in code actually solved the compatibility issue, but I would like to discuss a bit further on why one should rely on libraries provided by WordPress core instead of using their own custom libraries.

If(! Howdy! The mother of all Wordpress body tags | mimoYmima — creative web design. UPDATED– October 20, 2013: Thanks to Marty (see comments below), for convincing us to change out our method for body classes to filter the default WP body_class() function instead of creating our own. It still gives you all the advantages of our original function plus the classes you get by default. Here’s what it does First, check to see if you are on one of the following and create a class if so: home, 404, category, search, tag.We then make a class prefixed by page_ that has the name of the page or post in it.Then we check to see if the page has a parent, if so, we create a class prefixed by parent_ and put the parent name there.Finally we make a class with the prefix template_ and put the name of the template used there.

The PHP Add this stuff to your functions.php file, or just use our html5 shell and it’s built in. The HTML <body class="<? Your Help 2 Comments. Attachment Tags | Web Design WordPress Function List. 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.

Developer Tools. Jigoshop | A WordPress eCommerce plugin that works. Automatic Updates For Private And Commercial Plugins. Since time immemorial, only plugins hosted in the official WordPress.org plugin directory have supported automatic updates. Now, I’ve written a PHP library that you can use to add automatic update capabilities to any plugin. Public, private and commercial plugins alike – all can now enjoy the benefits of automatic update notifications and one-click upgrades.

The custom update checker integrates closely with the upgrade system already built into WordPress, producing a seamless user experience. Observe : An upgrade notice for a privately hosted plugin. The ‘Plugin Information’ window with placeholder data. Download License This library is licensed under the GPL and is distributed free of charge.

Commercial licensing (e.g. for projects that can’t use an open-source license) is available upon request. Quick-start Guide This section describes the quickest way to get automatic updates working for your plugin. Lets start with the metadata. And that, believe it or not, is it. Class constructor Notes. WordPress Self-Hosted Plugin Update API | Jeremy Clark - TechNet.com. Have a plugin that can’t be submitted to the official repository? Code is now on GitHub please see here for updated version. Many reasons exist but the biggest is that the plugin/support is sold therefore can’t be downloaded for free. But why should the end user be punished after all they bought the plugin and updates should be just as seamless as from the official repo.

With this script this can be accomplished. Examples and a package of sample code can be downloaded below. The original idea and code came from konstruktors.com, but I’ve modified it to add more info and fixed a couple of errors with it. The package containing all the sample code can be downloaded here from GitHub. First I’ll explain the code that goes onto the update server, this code is found in the api folder of the zip file.

Theme Update The theme in $packages['theme'] will need to replaced with your theme’s slug most likely it’s theme folder name. Plugin Update Now onto the plugin section of the api/index.php file. WordPress related blogs, 110+ best. Xtreme Theme - Professional WordPress Themes. 10 WordPress Plugins That Power A-Lists Blogs. Artsy Editor. WordPress Post Formats made easy.