WordPress Easter Egg

The creators of WordPress, Automattic, really are a fantastic group who not only made the greatest CMS currently available, they also take time to have a little fun. This is evident by this WordPress Easter Egg.

What’s an Easter Egg? Well, aside from those plastic eggs filled with delicous chocolate, an Easter Egg is an inside joke by developers. Sometimes they’re un-intrusive and only funny if you know the backstory, some are more obvious, if you can find them, like this WordPress Easter Egg.

WordPress Easter Egg

Here is a fun WordPress Easter Egg that occurs whenever you compare WordPress post revisions. You’ll see an animated series of events that calls you out by your author name or WordPress username and then proceeds to re-create events from the classic movie – The Matrix. Give it a try yourself or watch the video.

How to Remove the WordPress Easter Egg

If you have a non-technical client who would freak out and be rather upset about this WordPress Easter Egg (it’s happened), then the following code snippet will hide the WordPress Easter Egg. Simply paste it in your WordPress theme’s functions.php file.

function prevent_matrix_easter_egg() {
    $left = empty( $_POST['left'] ) ? ( empty( $_GET['left'] ) ? '' : $_GET['left'] ) : $_POST['left'];
    $right = empty( $_POST['right'] ) ? ( empty( $_GET['right'] ) ? '' : $_GET['right'] ) : $_POST['right'];
 
    if($left == $right) {
        $redirect = get_edit_post_link( $left );
        wp_die("Error: Cannot compare a revision to itself.<br /><a href=\"" . $redirect . "\">Go Back</a>");
    }
}
add_action('admin_action_diff', 'prevent_matrix_easter_egg');

Follow wpLifeGuard

« Back to Blog