Per Søderlind

I code for fun

DropzoneJS & WordPress REST API with Custom Endpoint

The plugin provides drag’n’drop file uploads and uses the wp rest api to upload the file. This version adds a custom endpoint, has code for handling the upload and uploads the file to uploads/yyyy/mm without adding the file to the media library.  If you need to upload the file to the...

DropzoneJS & WordPress REST API

The plugin provides drag’n’drop file uploads and uses the wp rest api to upload the file. BTW, I've written a similar plugin that uses the WordPress AJAX API for file uploads. dropzonejs-wp-rest-api.php dropzonejs-wp-rest-api.js Installation Save dropzonejs-wp-rest-api.php in wp-content/plugins/dropzonejs-wp-rest-api/ Save dropzonejs-wp-rest-api.js in wp-content/plugins/dropzonejs-wp-rest-api/js/ Use After activating the plugin, add the [dropzonerest]...

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...