Skip to content

Instantly share code, notes, and snippets.

@jaworowicz
Last active October 21, 2019 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaworowicz/8bd320b36e29e1c45a93a7e7e78ebfbe to your computer and use it in GitHub Desktop.
Save jaworowicz/8bd320b36e29e1c45a93a7e7e78ebfbe to your computer and use it in GitHub Desktop.
Hide wp_generator
// Ukrycie RSS
remove_action('wp_head', 'wp_generator');
// Ukrycie w RSS
function jcz_generator( $generator, $type ) {
return '';
}
add_filter( 'the_generator', 'jcz_generator', 10, 2 );
// Usunięcie Query w skryptach
function jcz_usun_src_version( $src ) {
global $wp_version;
$version_str = '?ver='.$wp_version;
$offset = strlen( $src ) - strlen( $version_str );
if ( $offset >= 0 && strpos($src, $version_str, $offset) !== FALSE )
return substr( $src, 0, $offset );
return $src;
}
add_filter( 'script_loader_src', 'jcz_usun_src_version' );
add_filter( 'style_loader_src', 'jcz_usun_src_version' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment