Per Søderlind

I code for fun

101: How to fetch a git pull request

  You should test pull requests locally before you merge them with your code. Fetching a pull request from a remote repository is simple, just do: In your local project folder, do: git ls-remote You'll get a list like this: From https://github.com/soderlind/myproject.git 15438eca8b7f62f371985823fe6fa8c60d7a3b50 HEAD 15438eca8b7f62f371985823fe6fa8c60d7a3b50 refs/heads/master 4abd4e393cc1bc57af576a67a1a56b3dae6ecabd refs/pull/2/head e05af83eeebb01e52d8b42f24c570c8290e0b351 refs/pull/4/head...

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.