Last active
October 13, 2024 16:06
-
-
Save afragen/763e57af7ddc5a40692fdf5d977f2902 to your computer and use it in GitHub Desktop.
One off plugin to add Git Updater dot org overrides so the hook remains active even when the specific plugin is not active.
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 | |
/** | |
* Git Updater Overrides for WP.org repo. | |
* | |
* @package GU_Overrides | |
* | |
* Plugin Name: Git Updater Overrides for WP.org | |
* Plugin URI: https://gist.github.com/afragen/763e57af7ddc5a40692fdf5d977f2902 | |
* Description: Override WP.org updates for plugins and themes in favor of updates from Git Updater. | |
* Version: 0.2.0 | |
* Author: Andy Fragen | |
* License: MIT | |
* Requires at least: 6.2 | |
* Requires PHP: 7.4 | |
* Gist Plugin URI: https://gist.github.com/afragen/763e57af7ddc5a40692fdf5d977f2902 | |
*/ | |
namespace Fragen\GU_Overrides; | |
/* | |
* Add plugin or theme elements to the following array. | |
* | |
* Plugin format is `my-plugin/my-plugin.php`. | |
* Theme format is `my-popular-theme`. | |
*/ | |
$my_gu_overrides = array(); | |
add_filter( | |
'gu_override_dot_org', | |
function ( $overrides ) use ( $my_gu_overrides ) { | |
return array_merge( $overrides, $my_gu_overrides ); | |
} | |
); | |
// Activating this filter works similarly to adding every plugin/theme to the `$my_gu_overrides` array. | |
// add_filter( 'gu_ignore_dot_org', '__return_true' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment