siteguard-admin-filter.php
3 years ago
siteguard-base.php
3 years ago
siteguard-captcha.php
3 years ago
siteguard-config.php
3 years ago
siteguard-disable-author-query.php
3 years ago
siteguard-disable-pingback.php
3 years ago
siteguard-disable-xmlrpc.php
3 years ago
siteguard-htaccess.php
3 years ago
siteguard-login-alert.php
3 years ago
siteguard-login-history.php
3 years ago
siteguard-login-lock.php
3 years ago
siteguard-rename-login.php
2 years ago
siteguard-updates-notify.php
3 years ago
siteguard-waf-exclude-rule.php
3 years ago
siteguard-disable-pingback.php
26 lines
| 1 | <?php |
| 2 | |
| 3 | class SiteGuard_Disable_Pingback extends SiteGuard_Base { |
| 4 | |
| 5 | function __construct() { |
| 6 | global $siteguard_config; |
| 7 | if ( '1' == $siteguard_config->get( 'disable_pingback_enable' ) ) { |
| 8 | add_filter( 'xmlrpc_methods', array( $this, 'handler_xmlrpc_methods' ) ); |
| 9 | } |
| 10 | } |
| 11 | function init() { |
| 12 | global $siteguard_config; |
| 13 | if ( true === siteguard_check_multisite() ) { |
| 14 | $siteguard_config->set( 'disable_pingback_enable', '1' ); |
| 15 | } else { |
| 16 | $siteguard_config->set( 'disable_pingback_enable', '0' ); |
| 17 | } |
| 18 | $siteguard_config->update(); |
| 19 | } |
| 20 | function handler_xmlrpc_methods( $methods ) { |
| 21 | unset( $methods['pingback.ping'] ); |
| 22 | unset( $methods['pingback.extensions.getPingbacks'] ); |
| 23 | return $methods; |
| 24 | } |
| 25 | } |
| 26 |