wp_doc_link_parse

Definition:
function wp_doc_link_parse( $content ) {}

Parameters

  • $content

Defined filters

  • documentation_ignore_functions
    apply_filters( 'documentation_ignore_functions', $ignore_functions )

Source code

function wp_doc_link_parse( $content ) {

	if ( !is_string( $content ) || empty( $content ) )

		return array();



	if ( !function_exists('token_get_all') )

		return array();



	$tokens = token_get_all( $content );

	$functions = array();

	$ignore_functions = array();

	for ( $t = 0, $count = count( $tokens ); $t < $count; $t++ ) {

		if ( !is_array( $tokens[$t] ) ) continue;

		if ( T_STRING == $tokens[$t][0] && ( '(' == $tokens[ $t + 1 ] || '(' == $tokens[ $t + 2 ] ) ) {

			// If it's a function or class defined locally, there's not going to be any docs available

			if ( ( isset( $tokens[ $t - 2 ][1] ) && in_array( $tokens[ $t - 2 ][1], array( 'function', 'class' ) ) ) || ( isset( $tokens[ $t - 2 ][0] ) && T_OBJECT_OPERATOR == $tokens[ $t - 1 ][0] ) ) {

				$ignore_functions[] = $tokens[$t][1];

			}

			// Add this to our stack of unique references

			$functions[] = $tokens[$t][1];

		}

	}



	$functions = array_unique( $functions );

	sort( $functions );

	$ignore_functions = apply_filters( 'documentation_ignore_functions', $ignore_functions );

	$ignore_functions = array_unique( $ignore_functions );



	$out = array();

	foreach ( $functions as $function ) {

		if ( in_array( $function, $ignore_functions ) )

			continue;

		$out[] = $function;

	}



	return $out;

}

3609

wp_die

Definition:
function wp_die( $message, $title = '', $args = array() {}

Kill WordPress execution and display HTML message with error message.
This function complements the die() PHP function. The difference is that HTML will be displayed to the user. It is recommended to use this function only, when the execution should not continue any further. It is not recommended to call this function very often and try to handle as many errors as possible silently.

Parameters

  • string $message: Error message.
  • string $title: Error title.
  • string|array $args: Optional arguments to control behavior.

Defined filters

  • wp_die_handler
    apply_filters( 'wp_die_handler', '_default_wp_die_handler')

Source code

function wp_die( $message, $title = '', $args = array() ) {

	if ( defined( 'DOING_AJAX' ) && DOING_AJAX )

		die('-1');



	if ( function_exists( 'apply_filters' ) ) {

		$function = apply_filters( 'wp_die_handler', '_default_wp_die_handler');

	} else {

		$function = '_default_wp_die_handler';

	}



	call_user_func( $function, $message, $title, $args );

}

3607

wp_deregister_style

Definition:
function wp_deregister_style( $handle ) {}

Remove a registered CSS file.

Parameters

  • string $handle: Name of the stylesheet.

Source code

function wp_deregister_style( $handle ) {

	global $wp_styles;

	if ( ! is_a( $wp_styles, 'WP_Styles' ) ) {

		if ( ! did_action( 'init' ) )

			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),

				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );

		$wp_styles = new WP_Styles();

	}



	$wp_styles->remove( $handle );

}

3605

wp_deregister_script

Definition:
function wp_deregister_script( $handle ) {}

Remove a registered script.

Parameters

  • $handle

Source code

function wp_deregister_script( $handle ) {

	global $wp_scripts;

	if ( ! is_a( $wp_scripts, 'WP_Scripts' ) ) {

		if ( ! did_action( 'init' ) )

			_doing_it_wrong( __FUNCTION__, sprintf( __( 'Scripts and styles should not be registered or enqueued until the %1$s, %2$s, or %3$s hooks.' ),

				'<code>wp_enqueue_scripts</code>', '<code>admin_enqueue_scripts</code>', '<code>init</code>' ), '3.3' );

		$wp_scripts = new WP_Scripts();

	}



	$wp_scripts->remove( $handle );

}

3603

wp_delete_user

Definition:
function wp_delete_user( $id, $reassign = 'novalue' ) {}

Remove user and optionally reassign posts and links to another user.
If the $reassign parameter is not assigned to an User ID, then all posts will be deleted of that user. The action ‘delete_user’ that is passed the User ID being deleted will be run after the posts are either reassigned or deleted. The user meta will also be deleted that are for that User ID.

Parameters

  • int $id: User ID.
  • int $reassign: Optional. Reassign posts and links to new User ID.

Return values

returns:True when finished.

Defined actions

  • delete_user
    do_action('delete_user', $id);

Source code

function wp_delete_user( $id, $reassign = 'novalue' ) {

	global $wpdb;



	$id = (int) $id;



	// allow for transaction statement

	do_action('delete_user', $id);



	if ( 'novalue' === $reassign || null === $reassign ) {

		$post_ids = $wpdb->get_col( $wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_author = %d", $id) );



		if ( $post_ids ) {

			foreach ( $post_ids as $post_id )

				wp_delete_post($post_id);

		}



		// Clean links

		$link_ids = $wpdb->get_col( $wpdb->prepare("SELECT link_id FROM $wpdb->links WHERE link_owner = %d", $id) );



		if ( $link_ids ) {

			foreach ( $link_ids as $link_id )

				wp_delete_link($link_id);

		}

	} else {

		$reassign = (int) $reassign;

		$wpdb->update( $wpdb->posts, array('post_author' => $reassign), array('post_author' => $id) );

		$wpdb->update( $wpdb->links, array('link_owner' => $reassign), array('link_owner' => $id) );

	}



	clean_user_cache($id);



	// FINALLY, delete user

	if ( !is_multisite() ) {

		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->usermeta WHERE user_id = %d", $id) );

		$wpdb->query( $wpdb->prepare("DELETE FROM $wpdb->users WHERE ID = %d", $id) );

	} else {

		$level_key = $wpdb->get_blog_prefix() . 'capabilities'; // wpmu site admins don't have user_levels

		$wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = $id AND meta_key = '{$level_key}'");

	}

3601