Skip to content

Instantly share code, notes, and snippets.

View Screenfeed's full-sized avatar

Grégory Viguier Screenfeed

View GitHub Profile
@Screenfeed
Screenfeed / glotpress-last.php
Created June 16, 2017 14:07
Use translations from #WordPress plugins first
<?php
/**
* Plugin Name: GlotPress Last
* Plugin URI: https://www.screenfeed.fr
* Description: Prevent WP from loading a plugin's .mo files from the languages directory first. Instead, WP will first try to load the files from the plugin.
* Version: 1.0
* Author: Grégory Viguier
* Author URI: https://www.screenfeed.fr/greg/
* License: GPLv3
* License URI: https://www.screenfeed.fr/gpl-v3.txt
@Screenfeed
Screenfeed / no-ultimate-maintenance-mode-external-resources.php
Last active May 19, 2017 15:51
Some people think they can add external resources as they please in your site.
<?php
/* !---------------------------------------------------------------------------- */
/* ! ULTIMATE MAINTENANCE MODE */
/* ----------------------------------------------------------------------------- */
/**
* Make it local or die:
* Remove the image ad from the settings page (the link stays in place).
*/
@Screenfeed
Screenfeed / conditional-js-scripts.php
Last active July 28, 2021 10:28
Conditional JS scripts for WordPress
// !Tool to easily add a "conditional" data to a script.
if ( ! function_exists('sf_conditional_script') ):
function sf_conditional_script( $script, $condition = 'lt IE 9' ) {
return $GLOBALS['wp_scripts']->add_data( $script, 'conditional', $condition );
}
endif;
// !Enqueue script(s).
@Screenfeed
Screenfeed / sf_remove_fuckin_maps_maker_ad.php
Created December 17, 2014 09:00
Keeping your shit at home is fine. Spreading it everywhere is not.
// !WordPress Plugin "Leaflet Maps Marker"
if ( class_exists( 'Leafletmapsmarker' ) ) :
// !Remove the fuckin' ad from the plugins list (I'm not paid to do that, it just makes me happy). Next time, follow WP guidelines. Kisses =)
add_action( 'admin_print_styles-plugins.php', 'sf_remove_fuckin_maps_maker_ad_from_plugins_list' );
function sf_remove_fuckin_maps_maker_ad_from_plugins_list() {
global $wp_filter;