Filter hook 'pre_option_enable_xmlrpc'

in WP Core File wp-includes/class-wp-xmlrpc-server.php at line 194

View Source

pre_option_enable_xmlrpc

Filter Hook
Description
Sets wp_xmlrpc_server::$is_enabled property. Determines whether the xmlrpc server is enabled on this WordPress install and set the is_enabled property accordingly. / private function set_is_enabled() { /* Respect old get_option() filters left for back-compat when the 'enable_xmlrpc' option was deprecated in 3.5.0. Use the {@see 'xmlrpc_enabled'} hook instead.

Hook Information

File Location wp-includes/class-wp-xmlrpc-server.php View on GitHub
Hook Type Filter
Line Number 194

Hook Parameters

This hook doesn't accept any parameters.

Usage Examples

Basic Usage
<?php
// Hook into pre_option_enable_xmlrpc
add_filter('pre_option_enable_xmlrpc', 'my_custom_filter');

function my_custom_filter() {
    // Your custom filtering logic here
    return 'modified_value';
}

Source Code Context

wp-includes/class-wp-xmlrpc-server.php:194 - How this hook is used in WordPress core
<?php
 189  	private function set_is_enabled() {
 190  		/*
 191  		 * Respect old get_option() filters left for back-compat when the 'enable_xmlrpc'
 192  		 * option was deprecated in 3.5.0. Use the {@see 'xmlrpc_enabled'} hook instead.
 193  		 */
 194  		$is_enabled = apply_filters( 'pre_option_enable_xmlrpc', false );
 195  		if ( false === $is_enabled ) {
 196  			$is_enabled = apply_filters( 'option_enable_xmlrpc', true );
 197  		}
 198  
 199  		/**

PHP Documentation

<?php
/**
	 * Sets wp_xmlrpc_server::$is_enabled property.
	 *
	 * Determines whether the xmlrpc server is enabled on this WordPress install
	 * and set the is_enabled property accordingly.
	 *
	 * @since 5.7.3
	 */
	private function set_is_enabled() {
		/*
		 * Respect old get_option() filters left for back-compat when the 'enable_xmlrpc'
		 * option was deprecated in 3.5.0. Use the {@see 'xmlrpc_enabled'} hook instead.
		 */
Quick Info
  • Hook Type: Filter
  • Parameters: 0
  • File: wp-includes/class-wp-xmlrpc-server.php
Related Hooks

Related hooks will be displayed here in future updates.