Skip to content

Commit

Permalink
#749 Adding xml-rpc prevention filters
Browse files Browse the repository at this point in the history
  • Loading branch information
thetwopct committed Mar 14, 2023
1 parent f7078f8 commit c4b7b0a
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions web/wp-content/themes/lfevents/library/cleanup.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,27 @@ function foundationpress_cleanup_head() {
// Emoji styles.
remove_action( 'wp_print_styles', 'print_emoji_styles' );

// Remove emojis.
add_filter( 'emoji_svg_url', '__return_false' );

// stop xmlrpc.
add_filter( 'xmlrpc_enabled', '__return_false' );

// remove application passwords.
add_filter( 'wp_is_application_passwords_available', '__return_false' );

// controls whether XML-RPC methods requiring authentication are enabled.
add_filter( 'xmlrpc_enabled', '__return_false' );

// Unregister the whole XML-RPC method space.
add_filter( 'xmlrpc_methods', fn( $methods ) => array() );

// deactivate x-pingback HTTP header.
add_filter(
'wp_headers',
function( $headers ) {
unset( $headers['X-Pingback'] );
return $headers;
}
);

}
endif;

Expand Down

0 comments on commit c4b7b0a

Please sign in to comment.