Per Søderlind

I code for fun

DropzoneJS & WordPress AJAX API

  The plugin below demos how to integrate DropzoneJS with WordPress. BTW, I've written a similar plugin that uses the WP REST API for file upload. Install and activate the plugin, and use the `[dropzonejs]` shortcode to display the drop zone. Plugin customize_dropzonejs.js Here's a sample customize_dropzonejs.js, the options are documented...

A faster load_textdomain() for WordPress

Somehow, living outsite the 7 bit world of the US, we've missed that loading translations in WordPress is extreamly slow. Using the pluging below, you can improve your pageload by 40ms per request.

WordPress, how to modify the HTML of an oEmbed link

Introduction Background: EPiServer is the CMS for the Norwegian Government main site, www.regjeringen.no and we use WordPress for more ad hoc sites. Task: Based on the design guide for regjeringen.no, add 23 video to WordPress. 23 video supports oembed, so adding it is easy <?php // replace NAME with your...

CSS Flags library for WordPress

The CSS Flags plugin / library for WordPress loads a dynamicly created CSS. It has the following responsive Scalable Vector Graphics (SVG) flags: [cssflag countries="all"] Usage The total CSS file size is 4 MB, and you don't want to send all that data back to the users, so you must use...

WordPress theme development, add and activate required plugins

At work we're developing a new WordPress theme. The theme "depends" on a few plugins. We are adding the plugins using the TGM Plugin Activation library. Our implementation is using most of the example.php code, but I decided to store the plugin data in a json file: [ { "name": "Advanced...

Continuous Deployment from GitHub to WordPress Azure

  TL;DR: Create a .deployment file and push it to GitHub: [config] DEPLOYMENT_TARGET=D:\home\site\wwwroot\wp-content\themes\my-theme At work we are developing a new theme for our WordPress sites. We use git and GitHub, and to test changes we do continuous deployment to a free WordPress site at Azure. Setting up contious deployment from GitHub to...