About The Doctor

  • Website: http://wpfirstaid.com or email
  • Biography: My name is Edward Caissie. I am a WordPress enthusiast; theme designer; plugin developer; and blogger ... not necessarily in that order. I founded WP First Aid as a place to help others with WordPress related items and issues.

Posts by The Doctor:

Just __return_* It

on Apr 4, 2012 with No Comments | Short Link
in Functions, Tips
as , , , , ,

WordPress has a lot of helper functions built into its core. Some of these functions are obvious and some are obscure … and almost every one of them can be easily put to use.

A chat group I was in the other day lead me to looking for a set of these helper functions in the code we were discussing … I didn’t find them. Well, I did find them in use but I did not find where they were defined. Next stop, the WordPress core … and there they were.

Now, as the title may suggest I am referring to the following WordPress core functions:

  • __return_true() – returns the Boolean state of true
  • __return_false() – returns the Boolean state of false
  • __return_zero() – returns a value of zero (0)
  • __return_empty_array() – returns an empty array, as in array()
  • __return_null() – returns null (or void)

All of these functions have a very similar structure and were implemented at WordPress version 3.0.0, with the exception of `__return_null` which will be introduced at WordPress version 3.4 per their definitions in ‘../wp-includes/functions.php‘. For example, here is the code for `__return_true`:

function __return_true() {
	return true;
}

Why are these great helper functions? Simple really … they provide easy to remember, and very useful, callback functions for filters. You should not need to write your own return functions now, just __return_* it instead.

Tri-Account Security

on Mar 16, 2012 with No Comments | Short Link
Last modified by The Doctor on March 26, 2012
in Tips
as , , ,

Tri-Account Security and protecting your self-hosted WordPress installation.

Add A Custom Font

on Feb 27, 2012 with No Comments | Short Link
in Tips, Typography
as , ,

Using @font-face and a bit of CSS to add a custom font

Remove Comment Form Website Section

on Jan 17, 2012 with 1 Comment | Short Link
in Functions, Tips
as , , ,

From time to time an interesting Five-Minute-FixTM comes along that sparks a great reason to add another WordPress Tips post. The idea for this tip started with this comment at BuyNowShop.com: … how to remove the website section when leaving a reply/comment … The solution may be obvious to some and can be readily derived [...]

No-Title Sticky Post-Format Posts?!

on Dec 9, 2011 with No Comments | Short Link
in Tips
as , , , ,

Making sure to test all of the combinations these three items can create.

Filtering WP Title

on Nov 30, 2011 with No Comments | Short Link
Last modified by The Doctor on April 26, 2012
in Tips
as , , , , , ,

A recent recommendation, starting with WordPress 3.3, from the WordPress Theme Review Team reads: Themes are REQUIRED to use wp_title filter to filter wp_title() (RECOMMENDED), or pass argument to wp_title() (OPTIONALLY), in order to modify document title content This has been discussed, worked through, and for the most part sorted out … but there doesn’t [...]

Enqueue Plugin Custom Stylesheet

on Nov 15, 2011 with No Comments | Short Link
in Tips
as , , , , , , ,

Now that is a bit of a handful to grab onto … but the code and concept is relatively straight forward and easy to implement. As I was recently updating some of my plugins in preparation for WordPress 3.3 I decided to better implement the style elements being used in these plugins. The current best-practice [...]

Start Using WordPress Beta

on Oct 12, 2011 with 2 Comments | Short Link
Last modified by The Doctor on April 12, 2012
in Tips
as , ,

The basics, as a general guideline, on how to start using the latest WordPress beta version.

Do Not Display Comments HTML Tags

on Aug 7, 2011 with 18 Comments | Short Link
in Functions
as , ,

A standard function found in many themes is the comment_form. This is a core function of WordPress that produces a standard comment form generally consisting of text fields for the name and email address and a textarea for the actual comment. You will also find there are some standard text outputs produced by this function [...]

Dynamic Copyright Revisited

on Jun 13, 2011 with No Comments | Short Link
in Tips
as , , ,

An updated version of the dynamic copyright function found in BuyNowShop.com themes by Cais.