This file contains 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
111.119.236.122 - - [06/Oct/2015:12:06:54 +0100] "POST /xmlrpc.php HTTP/1.1" 200 899 "-" "-" |
This file contains 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( 'xmlrpc_methods', 'remove_xmlrpc_methods'); | |
function remove_xmlrpc_methods( $methods ) { | |
unset( $methods['system.multicall'] ); | |
unset( $methods['system.listMethods'] ); | |
unset( $methods['system.getCapabilities'] ); | |
return $methods; | |
} |
This file contains 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('xmlrpc_enabled','__return_false'); |
This file contains 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
<files xmlrpc*=""> | |
order deny,allow | |
deny from all | |
</files> |
This file contains 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
function mmuk_scripts() { | |
wp_enqueue_script( 'retina-js', get_template_directory_uri() . '/js/retina.js', '', '', true ); | |
} | |
add_action( 'wp_enqueue_scripts', 'mmuk_scripts' ); |
This file contains 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( 'delete_attachment', 'delete_retina_support_images' ); | |
function delete_retina_support_images( $attachment_id ) { | |
$meta = wp_get_attachment_metadata( $attachment_id ); | |
$upload_dir = wp_upload_dir(); | |
$path = pathinfo( $meta['file'] ); | |
foreach ( $meta as $key => $value ) { | |
if ( 'sizes' === $key ) { | |
foreach ( $value as $sizes => $size ) { | |
$original_filename = $upload_dir['basedir'] . '/' . $path['dirname'] . '/' . $size['file']; | |
$retina_filename = substr_replace( $original_filename, '@2x.', strrpos( $original_filename, '.' ), strlen( '.' ) ); |
This file contains 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
function retina_support_create_images( $file, $width, $height, $crop = false ) { | |
if ( $width || $height ) { | |
$resized_file = wp_get_image_editor( $file ); | |
if ( ! is_wp_error( $resized_file ) ) { | |
$filename = $resized_file->generate_filename( $width . 'x' . $height . '@2x' ); | |
$resized_file->resize( $width * 2, $height * 2, $crop ); | |
$resized_file->save( $filename ); | |
$info = $resized_file->get_size(); |
This file contains 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( 'wp_generate_attachment_metadata', 'retina_support_attachment_meta', 10, 2 ); | |
function retina_support_attachment_meta( $metadata, $attachment_id ) { | |
foreach ( $metadata as $key => $value ) { | |
if ( is_array( $value ) ) { | |
foreach ( $value as $image => $attr ) { | |
if ( is_array( $attr ) ) | |
retina_support_create_images( get_attached_file( $attachment_id ), $attr['width'], $attr['height'], true ); | |
} | |
} | |
} |
This file contains 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
function new_mail_from( $old ) { | |
return '[email protected]'; | |
} | |
function new_mail_from_name( $old ) { | |
return 'Your Name'; | |
} | |
add_filter('wp_mail_from', 'new_mail_from'); | |
add_filter('wp_mail_from_name', 'new_mail_from_name'); |
This file contains 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
From: "Example User" <[email protected]> |
NewerOlder