THE PENDING DRAFT

Add a custom WordPress Dashboard Widget

August 26, 2013

Sometimes you want to show a custom widget in the WordPress Dashboard. I use this function a lot, for example on client sites to provide some direct access to contact information for support or to show some custom messages to guide your clients with your theme, plugin or service. This little snippet will create a new widget and show it in the Admin Dashboard. Nothing more.

// Create the function for the content of our custom widget
function pdr_dashboard_widget_function() {
    echo "Display whatever it is you want to display inside your custom dashboard widget";
}

// Add our custom dashboard widget
function pdr_add_dashboard_widgets() {
    wp_add_dashboard_widget('pdr_dashboard_widget', 'Custom Dashboard Widget', 'pdr_dashboard_widget_function');
}

// Hook everything into the 'wp_dashboard_setup' action to register our functions
add_action('wp_dashboard_setup', 'pdr_add_dashboard_widgets' );

 

Put that code inside your functions.php, or inside a custom plugin and you will have a basic widget right in your WP Dashboard.

Remote Debugging for iOS Devices with Safari

August 25, 2013

I was pretty impressed when i first saw how Ghostlab enables us to remotely debug a design on a mobile device. While Ghostlab can do many other things, remote debugging on an iOS device is also possible directly from within Safari. I’m honestly not sure if this is a new feature or not, but it’s very cool and pretty easy to use.

1. Connect your device via USB
2. On your iPhone, go to Settings / Safari / Advanced and activate “Web Information”
3. On OS X, open Safari and activate the dev tools
4. Open any website on your iOS Device
5. Now you should see your device(s) in the Menu “Developer” in Safari form where you can access the Web Inspector for any open site on your iOS device.

As far as i found out, this is only possible with iOS 6 and up and Safari on a Mac. There’s a similar function in Chrome to remotely debug on Android devices, which i haven’t tried yet, but looks exactly the same.

Apply Filters – A WordPress Development Podcast

August 23, 2013

applyfilters

Brad Touesnard and Pippin Williamson launched a new Podcast about WordPress Development. It is focused solely on Developing and Coding for WordPress, so they don’t have to “worry about annoying the non-developer listeners in the audience”, in their own words.

Here’s what they have to say about Apply Filters in the description:

Our discussions will include everything from development in WordPress core, plugins, and themes. We will be sharing much of our own experiences as developers that work fulltime in WordPress development, as well as bringing on guest developers to share their stories.

But don’t be afraid of that, i would consider myself more of a designer than a coder and still really enjoyed the first episode and looking forward to the next one.

Brad Touesnard is the founder of Delicious Brains, the company behind such great plugins as WP Migrate DB Pro, a plugin to easily migrate your WordPress databases.

Pippin Williamson is the head of Pippins Plugins and creator of many popular plugins such as Easy Digital Downloads or Restrict Content Pro. He also reviews plugins for the official WordPress.org plugin repository and contributes to WordPress core and bbPress.

I even learned something new right in the first episode when they talked about a new function get_attached_media(), which was introduced in WP 3.6. As the name suggests, it loads all media attached to a particular post, which always was a bit hacky to do in the past and it’s good to know there’s a better way by now.

If you’re into WordPress Development, whether as a Theme Designer or a Plugin Developer and want to learn a new trick or two, go check them out.

Apply Filters – WordPress Development Podcast

Ghostlab – Synchronized testing for web and mobile.

August 15, 2013

Ghostlab by Vanamco

If you design or develop for mobile devices you might know the hassle to get a local installation on different devices.

My testing usually covers IE7-9 on Windows via Parallels Desktop, FireFox, Chrome and Safari on Mac OS X, iPhone, iPad and Chrome on a Nexus 7 Android Tablet. To get the same site on all those Systems is possible but not what you would call convenient.

Thats where Ghostlab comes into play. It generates a local “server” which you can access via a local IP address and it works perfectly to view (for example) my local WordPress development installation live on all my devices as well as on Windows under Parallels Desktop. On top of that it syncs your actions, whether they are on your desktop or mobile, so everything you click, scroll or touch will be synced on all devices. Cool stuff.

“Ok, but setup a server on OS X to test on several devices locally isn’t THAT hard, and i don’t need this fancy syncing stuff”, you might say. Yes, but it doesn’t stop there, it also gives you the ability to use Web Inspector with your Mobile Devices. Yes, you heard it right! Inspect your CSS Styles. On your Mobile Device.

Oh, and as a bonus, Ghostlab shows you a QR-Code so you don’t have to type in the IP address manually on your mobile devices, which may be the first example of a QR-code which does something more than wasting space.

The App is developed by Vanamco AG in Zurich and can be bought for 49$ from their website, which is a very fair price if you consider how much time and nerves this little thingy will save you. Of course you can also download a demo version, which i suggest you to do now.

Ghostlab by Vanamco AG

mobble WordPress Plugin detects different mobile devices

August 12, 2013

Just stumbled upon this neat little plugin which promises to provide conditional functions which can be used to identify different devices easily.

Helper plugin that provides conditional functions for detecting a variety of mobile devices & tablets. Perfect accompaniment to CSS Media Queries.

I didn’t have the time to completely try it out right now, but it sounds very promising from the description. What it does is checking which device is in use using PHP class Mobile_Detect and provide us with conditional functions in the form of “is_mobile()” or “is_tablet()” etc. so we can display different stuff depending on the device.

As we already have the ability to generate, let’s say, different image sizes when uploading an image, this seems to be a very easy and logical solution. One concern that comes to my mind is if and how it will perform with caching. The developer – Scott Evans –  addresses this issue in the FAQs:

Please note that in certain setups caching will cause undesired behaviour. If your cache is set too aggressively PHP will be skipped and the device detection will not work.

Anyone using this plugin already? Do i miss something important? Better alternatives? Let us know what you think in the comments.

mobble – Download in the WordPress.org Plugin Directory

Release Post from Scott Evans with more Info and some Examples

Brad Frost on Bullshit

August 12, 2013

Great Presentation by Brad Frost talking about bullshit in our information overflowed world today.

When we develop sites for clients, sometimes it makes sense to remove some of the UI items they don’t need in the admin area to make it less intimidating. We used many of these admin customizations with WordPress Multisite (or WPMU), to make our customer’s sites more user-friendly. (The code in this article works with normal WP and multisite)

Some handy tipps on how to customize the WordPress Dashboard for your clients.

How to Simplify & Customize the WordPress admin | Press Coders.