Skip to content

Instantly share code, notes, and snippets.

View ericandrewlewis's full-sized avatar

Eric Lewis ericandrewlewis

View GitHub Profile
@ericandrewlewis
ericandrewlewis / gist:6664486
Created September 22, 2013 22:30
Good + Bad hook descriptions
<?php
// Bad action description
/**
* Allows you to register custom post types, custom taxonomies, and other general housekeeping tasks after a lot of WordPress core has loaded.
*/
do_action( 'init' );
// Good action description
<?php
/**
* This is a docblock.
*
*/
/*
* This is a multiline inline comment.
*
/*
* Comment
*/
<?php
/**
* Filter the content of the notification email for new user signup success.
*
* @since MU
*
* @param string $content Content of the notification email.
* @param string $user User login name.
* @param string $user_email User email address.
* @param string $key Activation key created in wpmu_signup_blog().
@ericandrewlewis
ericandrewlewis / gist:7441441
Created November 13, 2013 00:32
Meanderings on a new Settings API
<?php
/**
* A singular settings object. By itself, it only describes the relationship of
* the setting to any WordPress objects (post type, taxonomy term, the WP instance)
* that it relates to.
*/
$setting = new WP_Setting(
array(
'key' => 'title_color',
<html>
<head>
<title></title>
</head>
<body>
<?php
/**
* Convert an RGB value to HSL.
*
* @param int $r Red value.
<?php
$term = get_term_by( 'slug', get_query_var( 'pro' ), "post_tag" );
$tagslug = $term->slug;
$ukposts = get_posts( array(
'posts_per_page' => -1,
'post_type' => 'uk',
'post_status' => 'publish'
) );
$proposts = get_posts( array(
'posts_per_page' => -1,

Thoughts for the Developer Experience at WordCamp

I’ve been thinking a bit about the developer track at WCNYC. I’d like to share my opinions, even if it is a bit early. Would love reactions, and your opinions as well.

Foundations Day

The idea of a foundations day before the classic WordCamp day appeals to me; that can be the place to send novice developers. We could have a 101 day on Friday somewhere small, which we’ve spoken about. The cream of the crop can teach some sessions here – “Setting up a local environment” with Brad Williams; “Introduction to Version Control” with John James Jacoby. It’s a bit mind-boggling to me we could offer such a valuable experience for next to nothing.

Developer Track @ WordCamp Day

We set the end goal of the Metadata plugin to be brought into WordPress core. This seems dangerous, and drives us towards producing something as speedily as we can. We are creating with use cases of today in mind. We are building software which lets you go farther with ease. It is 1903 and we are offering you a car. However, what happens when you realize that you live on a small island? That car does not make sense anymore. You want to go further. You need an airplane. Now, turn your car into an airplane. But that’s tricky, there are different considerations when you’re talking about aerodynamics required for flight speeds versus driving speeds.

As we will build software that eases the configuration of complex architecture, a year from now the use cases may be much different than what we planned for.

Warning: require_once(/srv/www/clients/xxxxxxxxxx/wp-content/plugins/gravityforms/common.php): failed to open stream: No such file or directory in /srv/www/clients/xxxxxxxxxx/wp-content/mu-plugins/gravityforms/gravityforms.php on line 74

Fatal error: require_once(): Failed opening required ‘/srv/www/clients/xxxxxxxxxx/wp-content/plugins/gravityforms/common.php’ (include_path=‘.:/usr/share/php:/usr/share/pear’) in /srv/www/clients/xxxxxxxxxx/wp-content/mu-plugins/gravityforms/gravityforms.php on line 74