Skip to content

Instantly share code, notes, and snippets.

@tommyskott
Last active June 21, 2022 09:37
Show Gist options
  • Save tommyskott/6bbfac21508de147a6678d8232d32d07 to your computer and use it in GitHub Desktop.
Save tommyskott/6bbfac21508de147a6678d8232d32d07 to your computer and use it in GitHub Desktop.
Require WordPress mu-plugins in vanilla wp projects.
<?php
/*
Plugin Name: B&S Autoloader
Plugin URI: https://github.com/borgenfalkskott
Description: Mu-plugin autoloader for vanilla Wp.
Version: 1.1.0
Author: Borgenfalk & Skott
Author URI: https://borgenfalk.se
License: MIT
*/
defined( 'ABSPATH' ) or die( 'No script kiddies please!' );
require_once __DIR__ . '/bs-wp-reset/bs-wp-reset.php';
require_once __DIR__ . '/bs-wp-meta/bs-wp-meta.php';
require_once __DIR__ . '/bs-wp-no-jquery/bs-wp-no-jquery.php';
?>
@tommyskott
Copy link
Author

tommyskott commented Jun 9, 2021

NOTE: You only need this autoloader if your plugin lives in a sub folder e.g. /plugin-name/plugin-name.php

Place the autoloader.php in /wp-content/mu-plugins/.
WordPress looks automatically for plugin files in the mu-plugins folder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment