Per Søderlind

I code for fun

oAuth, using WordPress native methods

I like to use the WordPress native methods when I can, here's my take on oAuth. The examples below retrieves the access token Facebook <br /> &lt;?php<br /> define('FACEBOOK_APPID','123'); // replace 123 with your app id<br /> define('FACEBOOK_APPSECRET','abc'); // replace abc with your app secret<br /> define('REDIRECTURI','http://your.redirect.url');</p> <p>if ($_GET['code'] !=...

An alternative Hide ACF Menu from Clients

Here's an alternative to Hide ACF Menu from Clients, add it to your functions.php: <br /> add_action( 'admin_menu', function() {<br /> if (! current_user_can('administrator')) {<br /> remove_menu_page('edit.php?post_type=acf');<br /> }<br /> });<br /> Note, remove_menu_page() needs WordPress 3.1 or newer

Date and Time Picker field for Advanced Custom Fields

  This is an add-on for the Advanced Custom Fields (ACF) WordPress plugin, that allows you to add a Date and Time Picker field type. Works with ACF v3 and v4. ACF PRO 5.0+ is no longer supported, ACF PRO has its own date and time picker. Brought To You By...

Adding WP-PageNavi to the Yoko theme

I'm using the Yoko theme and WP-PageNavi here at soderlind.no Yoko is a modern three-column blog theme. A responsive layout optimizes the theme for mobile devices like tablet pcs and modern smartphones (the layout switches to a two- or one-column layout depending on the screen size the theme is viewed...

WordPress plugin: Remove "Comments are closed"

On posts where comments are closed, the plugin will remove the text 'Comments are closed.' The plugin supports any languages/text domains, and will remove the text from themes and plugins. Prerequisite: Since the plugin is filtering gettext, your theme/plugin must be localized. The plugin is available in the WordPress plugin...

Adding custom headers to the WordPress plugin directory

As an experiment, Matt has turned on custom headers for the plugin directory. How to add a custom header: Make a 772×250 pixel jpeg or png In the plugin root directory, create a new directory "assets": [shell light="true"]mkdir assets[/shell] After you've created the assets directory, you should have the following...

WordPress and WebPutty

I've written a simple plugin that allows you to modify your WordPress sites using WebPutty. So what's WebPutty? WebPutty is a simple CSS editing and hosting service. WebPutty gives you a syntax-highlighting CSS editor you can use from anywhere, the power of SCSS and Compass, a side-by-side preview pane, and...

Modernizr 101

.. or, why I like it. When developing for the web, I've always been a fan of checking for functionality using object detection, I NEVER try to detect which browser you are using. Modernizr does this much better that the other methods I've seen (and used). Modernizr is a small JavaScript...

Front-end editor in WordPress 3.3 is easy

Update: Things will have to change, TinyMCE 4.0 is in core: New UI and UI API. New theme. Revamped events system/API. Better code quality, readability and build process. Lots of (inline) documentation. And generally many improvements everywhere. TinyMCE 4.0 Highlights Demos Thanks to sushkov, WordPress 3.4 adds support for DFW...