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
add_filter( 'option_blogname', 'jp_dev_blogname' ); | |
/** | |
* Prepend '(DEV) ' to blog name | |
*/ | |
function jp_dev_blogname( $value ): string { | |
return '(DEV) ' . $value; | |
} |
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: JP Plugin Update Disabler | |
* Description: Disables plugin updates for specified plugins. | |
* Version: 1.0 | |
* Author: John Parris | |
*/ | |
add_filter( 'http_request_args', 'jp_disable_plugin_updates', 10, 2 ); | |
function jp_disable_plugin_updates( $args, $url ) { | |
if ( str_starts_with( $url, 'https://api.wordpress.org/plugins/update-check/1.1/' ) ) { |
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
// Why? Because GitHub's UI only allows 25 at a time, and doing it manually with a mouse is annoying. | |
// With this you can just paste in the console and press enter, wait for reload, do it again. | |
// I'm sure there's a "better" way, but I did not want to dive into their API docs for a one-time thing. | |
// Click the Select All checkbox | |
var el = document.querySelector('[aria-labelledby="select-all-subscriptions-text"]'); | |
el.click(); | |
// Click the Unsubscribe button | |
var un = document.querySelector('button.ml-3'); |
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 | |
// This loads the react-devtools script in wp-admin when using Safari. | |
add_action( 'admin_enqueue_scripts', function() { | |
if ( ! empty( $_SERVER['HTTP_USER_AGENT'] ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'Safari' ) !== false ) { | |
?> | |
<script src="http://localhost:8097"></script> | |
<?php | |
} | |
} ); |
NewerOlder