Last active
July 12, 2021 13:09
-
-
Save idokd/224dec722a22b664c59e8d6ec221d997 to your computer and use it in GitHub Desktop.
WordPress Initialization MU-Plugin (Must Use Plugin)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Plugin Name: Initialization Plugin | |
| * Plugin URI: https://gist.github.com/idokd/224dec722a22b664c59e8d6ec221d997 | |
| * Description: Plugin to hook and define necessary functions before other all other plugins | |
| * Version: 1.0.0 | |
| * Author: Ido Kobelkowsky | |
| * Author URI: https://github.com/idokd | |
| */ | |
| $thememuplugins = get_stylesheet_directory() . '/mu-plugins.php'; | |
| if ( file_exists( $thememuplugins ) ) require_once( $thememuplugins ); |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is intended to when you require to override specific functions before all other plugins, and you wish to have those functions inside your theme folder so for example
you create a PHP file: /wp-content/themes/{{your-theme}}/mu-plugins.php
and inside you can override specific functions
this is when plugins use function_exists() before declaring the function, so they basically allows overriding those functions.