Per Søderlind

I code for fun

On your Mac, use Larvel Valet for local WordPress and PHP development

[caption id="attachment_4777" align="aligncenter" width="625"] Photo by Richard Walker[/caption] You need Homebrew `brew install php70` `brew install mariadb` (server=127.0.0.1, username=root and password=an empty string) `brew install composer` `brew install wp-cli` `composer global require laravel/valet` Add ~/.composer/vendor/bin to PATH `valet install` `mkdir ~/Sites` `cd ~/Sites` `valet park` `mkdir ~/Sites/wp-valet` `cd ~/Sites/wp-valet` `wp...

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