Skip to content

Instantly share code, notes, and snippets.

@JRMorris77
JRMorris77 / remove-admin-notices.php
Created November 22, 2017 06:24
Remove Notices from WordPress Admin Pages
<?php
// Removes Notices from WordPress Admin pages.
function remove_admin_notices() {
remove_all_actions( 'admin_notices' );
echo "<style>.wp-admin .notice {display:none !important;}</style>";
}
add_action( 'admin_head', 'remove_admin_notices' );
@JRMorris77
JRMorris77 / geotag-wp.php
Created October 18, 2017 03:27
Change Geotagging limit from hard set 6 to unlimited in WPMU DEV Google Maps Add-on
<?php
/*
Plugin Name: Geotag my posts
Description: Allows you to add location context to your posts, pages or custom post types.<br />Activate the Add-on and then select which post-types you want to geotag. After this you will find a new metabox in the post editor where you can enter an address. <br>To display a map with all geo-tagged posts use the shortcode <code>[agm_gwp_geocoded_posts]</code>
Example: [agm_gwp_geocoded_posts]
Plugin URI: http://premium.wpmudev.org/project/wordpress-google-maps-plugin
Version: 1.0
Author: Ve Bailovity (Incsub)
*/
<script>
//Add HTML elements around text strings inside of a parent element.
jQuery("div.feature-text:contains('products')").html(function(_, html) {
return html.split('products').join("<a class='a'>products</a>");
});
jQuery("div.feature-text:contains('100')").html(function(_, html) {
return html.split('100').join("<a class='b'>100</a>");
});
</script>
<?php
/*
Plugin Name: Remove WordPress Admin Menu
Plugin URI: https://premium.wpmudev.org/support/
Description: A simple mu-plugin that removes the WordPress menu from the Admin menu.
Version: 0.0.1
Author: James Morris - WPMU DEV
Author URI: https://premium.wpmudev.org/profile/jrmorris77
Network: true
*/
<?php
if (isDEVAvailible('http://premium.wpmudev.org'))
{
echo "<h1>premium.wpmudev.org is Up and running!</h1>";
}
else
{
echo "<h1>Woops, nothing found at premium.wpmudev.org.</h1>";
}
<?php
add_action('admin_head', 'disable_notice');
function disable_notice() {
echo '<style>
.wp-core-ui .notice.is-dismissible {
display: none;
}
</style>';
}
<?php
// This changes the color of the login page
function hook_css() {
?>
<style>
body.login {
background: #006699;
}
</style>
<?php
<?php
/*
Plugin Name: Simple Login Redirect
Plugin URI: https://premium.wpmudev.org/support/
Description: A simple mu-plugin that redirects users to their subsite on login.
Version: 0.0.1
Author: James Morris - WPMU DEV
Author URI: https://premium.wpmudev.org/profile/jrmorris77
Network: true
*/
<!DOCTYPE html>
<head>
<title>Info</title>
<style type="text/css" media="screen">
body{
margin:0;
padding:0;
text-align:left;
}
.info {
// Reduce Snapshot Table Query Chunks
define('SNAPSHOT_TABLESET_CHUNK_SIZE', 100);
// Reduce Snapshot File Chunks
define('SNAPSHOT_FILESET_CHUNK_SIZE', 10);
// DEV Plugins w/o DEV Dashboard
define( 'WPMUDEV_APIKEY', 'YOUR-API-KEY');
//Enable conditional debug mode in wordpress: