add_js

Definition:
function add_js() {}

Display JavaScript on the page.

Source code

function add_js() {

	?>

<script type="text/javascript">

//<![CDATA[

jQuery(document).ready(function() {

	jQuery('input:radio.tog').change(function() {

		if ( 'custom' == this.value )

			return;

		jQuery('#permalink_structure').val( this.value );

	});

	jQuery('#permalink_structure').focus(function() {

		jQuery("#custom_selection").attr('checked', 'checked');

	});

});

//]]>

</script>

<?php

}

349

add_filter

Definition:
function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) {}

Hooks a function or method to a specific filter action.
Filters are the hooks that WordPress launches to modify text of various types before adding it to the database or sending it to the browser screen. Plugins can specify that one or more of its PHP functions is executed to modify specific types of text at these times, using the Filter API.

Parameters

  • string $tag: The name of the filter to hook the $function_to_add to.
  • callback $function_to_add: The name of the function to be called when the filter is applied.
  • int $priority: optional. Used to specify the order in which the functions associated with a particular action are executed (default: 10). Lower numbers correspond with earlier execution, and functions with the same priority are executed in the order in which they were added to the action.
  • int $accepted_args: optional. The number of arguments the function accept (default 1).

Return values

returns:true

Source code

function add_filter($tag, $function_to_add, $priority = 10, $accepted_args = 1) {

	global $wp_filter, $merged_filters;



	$idx = _wp_filter_build_unique_id($tag, $function_to_add, $priority);

	$wp_filter[$tag][$priority][$idx] = array('function' => $function_to_add, 'accepted_args' => $accepted_args);

	unset( $merged_filters[ $tag ] );

	return true;

}

347

add_feed

Definition:
function add_feed($feedname, $function) {}

Add a new feed type like /atom1/.

Parameters

  • string $feedname
  • callback $function: Callback to run on feed display.

Return values

returns:Feed action name.

Source code

function add_feed($feedname, $function) {

	global $wp_rewrite;

	if ( ! in_array($feedname, $wp_rewrite->feeds) ) //override the file if it is

		$wp_rewrite->feeds[] = $feedname;

	$hook = 'do_feed_' . $feedname;

	// Remove default function hook

	remove_action($hook, $hook, 10, 1);

	add_action($hook, $function, 10, 1);

	return $hook;

}

345

add_cssclass

Definition:
function add_cssclass($add, $class) {}

Parameters

  • $add
  • $class

Source code

function add_cssclass($add, $class) {

	$class = empty($class) ? $add : $class .= ' ' . $add;

	return $class;

}

343

add_contextual_help

Definition:
function add_contextual_help($screen, $help) {}

Add contextual help text for a page

Parameters

  • string $screen: The handle for the screen to add help to. This is usually the hook name returned by the add_*_page() functions.
  • string $help: Arbitrary help text

Source code

function add_contextual_help($screen, $help) {

	global $_wp_contextual_help;



	if ( is_string($screen) )

		$screen = convert_to_screen($screen);



	if ( !isset($_wp_contextual_help) )

		$_wp_contextual_help = array();



	$_wp_contextual_help[$screen->id] = $help;

}

341