remove_filter

Definition:
function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {}

Removes a function from a specified filter hook.
This function removes a function attached to a specified filter hook. This method can be used to remove default functions attached to a specific filter hook and possibly replace them with a substitute.

Parameters

  • string $tag: The filter hook to which the function to be removed is hooked.
  • callback $function_to_remove: The name of the function which should be removed.
  • int $priority: optional. The priority of the function (default: 10).
  • int $accepted_args: optional. The number of arguments the function accepts (default: 1).

Return values

returns:Whether the function existed before it was removed.

Source code

function remove_filter($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {

	$function_to_remove = _wp_filter_build_unique_id($tag, $function_to_remove, $priority);



	$r = isset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]);



	if ( true === $r) {

		unset($GLOBALS['wp_filter'][$tag][$priority][$function_to_remove]);

		if ( empty($GLOBALS['wp_filter'][$tag][$priority]) )

			unset($GLOBALS['wp_filter'][$tag][$priority]);

		unset($GLOBALS['merged_filters'][$tag]);

	}



	return $r;

}

2709

remove_all_shortcodes

Definition:
function remove_all_shortcodes() {}

Clear all shortcodes.
This function is simple, it clears all of the shortcode tags by replacing the shortcodes global by a empty array. This is actually a very efficient method for removing all shortcodes.

Source code

function remove_all_shortcodes() {

	global $shortcode_tags;



	$shortcode_tags = array();

}

2707

remove_all_filters

Definition:
function remove_all_filters($tag, $priority = false) {}

Remove all of the hooks from a filter.

Parameters

  • string $tag: The filter to remove hooks from.
  • int $priority: The priority number to remove.

Return values

returns:True when finished.

Source code

function remove_all_filters($tag, $priority = false) {

	global $wp_filter, $merged_filters;



	if( isset($wp_filter[$tag]) ) {

		if( false !== $priority && isset($wp_filter[$tag][$priority]) )

			unset($wp_filter[$tag][$priority]);

		else

			unset($wp_filter[$tag]);

	}



	if( isset($merged_filters[$tag]) )

		unset($merged_filters[$tag]);



	return true;

}

2705

remove_all_actions

Definition:
function remove_all_actions($tag, $priority = false) {}

Remove all of the hooks from an action.

Parameters

  • string $tag: The action to remove hooks from.
  • int $priority: The priority number to remove them from.

Return values

returns:True when finished.

Source code

function remove_all_actions($tag, $priority = false) {

	return remove_all_filters($tag, $priority);

}

2703

remove_action

Definition:
function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {}

Removes a function from a specified action hook.
This function removes a function attached to a specified action hook. This method can be used to remove default functions attached to a specific filter hook and possibly replace them with a substitute.

Parameters

  • string $tag: The action hook to which the function to be removed is hooked.
  • callback $function_to_remove: The name of the function which should be removed.
  • int $priority: optional The priority of the function (default: 10).
  • int $accepted_args: optional. The number of arguments the function accepts (default: 1).

Return values

returns:Whether the function is removed.

Source code

function remove_action($tag, $function_to_remove, $priority = 10, $accepted_args = 1) {

	return remove_filter($tag, $function_to_remove, $priority, $accepted_args);

}

2701