get_author_user_ids

Definition:
function get_author_user_ids() {}

Return values

returns:List of user IDs.

Source code

function get_author_user_ids() {

	_deprecated_function( __FUNCTION__, '3.1', 'get_users()' );



	global $wpdb;

	if ( !is_multisite() )

		$level_key = $wpdb->get_blog_prefix() . 'user_level';

	else

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



	return $wpdb->get_col( $wpdb->prepare("SELECT user_id FROM $wpdb->usermeta WHERE meta_key = %s AND meta_value != '0'", $level_key) );

}

9361

get_ancestors

Definition:
function get_ancestors($object_id = 0, $object_type = '') {}

Get an array of ancestor IDs for a given object.

Parameters

  • int $object_id: The ID of the object
  • string $object_type: The type of object for which we’ll be retrieving ancestors.

Return values

returns:of ancestors from lowest to highest in the hierarchy.

Defined filters

  • get_ancestors
    apply_filters('get_ancestors', $ancestors, $object_id, $object_type)
  • get_ancestors
    apply_filters('get_ancestors', $ancestors, $object_id, $object_type)

Source code

function get_ancestors($object_id = 0, $object_type = '') {

	$object_id = (int) $object_id;



	$ancestors = array();



	if ( empty( $object_id ) ) {

		return apply_filters('get_ancestors', $ancestors, $object_id, $object_type);

	}



	if ( is_taxonomy_hierarchical( $object_type ) ) {

		$term = get_term($object_id, $object_type);

		while ( ! is_wp_error($term) && ! empty( $term->parent ) && ! in_array( $term->parent, $ancestors ) ) {

			$ancestors[] = (int) $term->parent;

			$term = get_term($term->parent, $object_type);

		}

	} elseif ( null !== get_post_type_object( $object_type ) ) {

		$object = get_post($object_id);

		if ( ! is_wp_error( $object ) && isset( $object->ancestors ) && is_array( $object->ancestors ) )

			$ancestors = $object->ancestors;

		else {

			while ( ! is_wp_error($object) && ! empty( $object->post_parent ) && ! in_array( $object->post_parent, $ancestors ) ) {

				$ancestors[] = (int) $object->post_parent;

				$object = get_post($object->post_parent);

			}

		}

	}



	return apply_filters('get_ancestors', $ancestors, $object_id, $object_type);

}

9341

export_date_options

Definition:
function export_date_options() {}

Source code

function export_date_options() {

	global $wpdb, $wp_locale;



	$months = $wpdb->get_results( "

		SELECT DISTINCT YEAR( post_date ) AS year, MONTH( post_date ) AS month

		FROM $wpdb->posts

		WHERE post_type = 'post' AND post_status != 'auto-draft'

		ORDER BY post_date DESC

	" );



	$month_count = count( $months );

	if ( !$month_count || ( 1 == $month_count && 0 == $months[0]->month ) )

		return;



	foreach ( $months as $date ) {

		if ( 0 == $date->year )

			continue;



		$month = zeroise( $date->month, 2 );

		echo '<option value="' . $date->year . '-' . $month . '">' . $wp_locale->get_month( $month ) . ' ' . $date->year . '</option>';

	}

}

9291

esc_textarea

Definition:
function esc_textarea( $text ) {}

Escaping for textarea values.

Parameters

  • string $text

Defined filters

  • esc_textarea
    apply_filters( 'esc_textarea', $safe_text, $text )

Source code

function esc_textarea( $text ) {

	$safe_text = htmlspecialchars( $text, ENT_QUOTES );

	return apply_filters( 'esc_textarea', $safe_text, $text );

}

9287

email_exists

Definition:
function email_exists( $email ) {}

Checks whether the given email exists.

Parameters

  • string $email: Email.

Return values

returns:The user’s ID on success, and false on failure.

Source code

function email_exists( $email ) {

	if ( $user = get_user_by('email', $email) )

		return $user->ID;



	return false;

}

9272