Namespacing And Autoloaders In WordPress Plugins

One thing I have been experimenting with recently is adding namespacing and autoloaders to new WordPress plugins. What Are PHP Namespaces PHP namespaces was introduced in version 5.3. Namespaces is a way of grouping classes together into virtual directories, the main reason we would want to do this is to help avoid collision of class names in your application. In PHP you can not define two classes with the same

Read more...

Using Googles NoCaptcha ReCaptcha In WordPress

Google has recently announced a new project called recaptcha which is a way of spam protecting your website from bots but making it easy for humans to submit the form by simply recreating a checkbox for users to click. Registering Your Website To use Google NoCaptcha ReCaptcha for your website you must first register your domain with the ReCaptcha API and get the site API key and the site secret

Read more...

New Functions Available In WordPress 4.1

In this article we are going to have a look at some of the new features and functions that are available to WordPress developers in version 4.1. Auto-generated Title Tag In previous versions of WordPress the theme developer will need to implement their own version of the HTML title tag which you would do using the function wp_title(). Now with WordPress 4.1 the title tag can now be auto-generated by

Read more...

Display A Category Checklist In WordPress

When you have a category hierarchy setup on your WordPress site you will be displayed with a list of checkboxes with parent/child indents on the edit post screen. This will allow you to choose the category that you want to assign to the post. In this tutorial we are going to look at how you will create your own checklist just like this which you can use on the front-end

Read more...

Improving WordPress Shortcode Usability

In this tutorial we are going to talk about WordPress shortcodes and what I think is the missing piece with shortcodes in WordPress. First I'll start by saying I really like shortcodes, it allows you to give the author of the website full control of the content on the site and where it is positioned. What Is A Shortcode? A shortcode allows the user to run a PHP function at

Read more...

Add Custom Meta To Taxonomies

In this tutorial we are going to learn how we can add additional data to your taxonomies. WordPress comes with the ability to add meta data onto both the posts and user objects. These are stored in separate tables such as the wp_postmeta and wp_usermeta tables. Both of these tables use a key and value pair columns to store the different data just like in the wp_options table. There is

Read more...

Register New Post Statuses In WordPress

WordPress posts allow you to have some form of workflow when editing your posts. This is done by assigning a post status for each stage of the WordPress posts. By default the WordPress will take up the status of Draft which tells WordPress to create a post but not to publish it on the front-end of the site, it will only publish it on the site when you hit the

Read more...

Using AJAX In WordPress

In the following tutorial we are going to learn how you can use AJAX in WordPress to run your own functions. The way this works in WordPress is by allowing you to attach your own actions that you can access from an AJAX request to change the content on the page. What Is AJAX? Normally on a webpage you have to wait for the server to load the content of

Read more...

Add Custom User Fields To User Profile Page

In a previous article I explained how you can modify the contact information on the WordPress User profile page, but what if you want to know more custom information from the user that requires more that just a text field. In this tutorial we are going to look at how we can add new fields to the User profile page to collect custom information that requires a dropdown or checkbox.

Read more...

Add Scripts To Shortcode Only When Used

Since version 2.5 WordPress introduced a new way of developers to provide dynamic content for the content author of the website with the use of Shortcodes. What Is A Shortcode? A shortcode allows the user to run a PHP function at any point you want in the content. A default shortcode you get with WordPress is the gallery shortcode, to add a gallery to your website all you have to

Read more...

1 2 3 4 5 6 7 8 9 12