Upgraded display

Dell sells some pretty nice monitors. Just picked up a nice UltraSharp 27-inch display. Great color accuracy and good build quality. The old 20″ Apple Cinema Display (with the old ADC connector) is now retired after close to 10 years of use. It might get used as a 2nd monitor, but there’s not enough desk now at this point. And some people will ask “Why not a 4K monitor?”. Two reasons. Expensive, and I don’t “need” 4K for anything right now or in the near future. It’s kind of a technology looking for a problem to solve – for me at any rate. So no 4k.

Thoughts on WordPress 3.8

Responsive, platform/screen agnostic back-end for the win.

Not enough value contrast on the back-end styles for my tastes. A bit more value differentiation between the darkest gray (#222) and the slightly lighter dark gray (#333) would have been nice (say a #444). The other styles to choose from are interesting. Some are quite vibrant but again suffer from not enough value differentiation and some come across as overly monochromatic.

Larger font sizes – good.

The Dashboard is nice and roomy, removing some of the previous “clutter”. I still think the At A Glance should be a bit more prominent. A Dashboard is supposed to provide a useful, timely information about your WordPress installation.

Appearance is quite nice – it’s very clear about what theme is active, how many themes you have, and, a good way to help users add more themes.

Widgets and Menus are a pain-point and will need to be looked at in the future. With more complex sites these can be quite burdensome to use. They just don’t scale up all that well.

Plugin management – well done. Good indicators on which plugins are activated and which ones need updating.

Final thought: another good release, primarily backend user interface and usability focused, laying the visual groundwork for future developments.

A very useful WordPress code snippet to know…

As I was working on a custom WordPress theme (based on _s) I found myself trying to get the slug of a post to use as a class for additional styling. Unfortunately, WordPress doesn’t have a get_the_slug() function or a the_slug() function. Well, not built out like that at any rate. The “why not?” is basically because the global $post object contains that info and thus can be found already and no extra functions needed. And then I ran into this wonderful bit of code from TCBarret (code commenting is mine):

/*This function gets the slug of a post 
- you need this to use the next code snippet.
*/
function get_the_slug( $id=null ){
  if( empty($id) ):
    global $post;
    if( empty($post) )
      return ''; // No global $post var available.
    $id = $post->ID;
  endif;

  $slug = basename( get_permalink($id) );
  return $slug;
}

So again, the above code will get_the_slug();. Now to use it, we want a filter and echo out the filtered post ID as the_slug(). And that code is:

/*This adds a filter and allows us to display the results of the
get_the_slug() function noted above.
*/
function the_slug( $id=null ){
  echo apply_filters( 'the_slug', get_the_slug($id) );
}

How to use this? Well I decided to build out a little utility plugin which incorporates the above code so I can use it pretty much in any WordPress install – it’s not tied to a theme or what not. You can use the above code in a theme’s functions.php instead of a plugin but I think a plugin is a better choice as it means the functionality is usable across whatever theme you decide to use. Anyway, special thanks to TCBarret for his excellent (and very useful) code.