WP_Importer::set_user( int $user_id )


Description Description


Parameters Parameters

$user_id

(int) (Required)


Top ↑

Return Return

(int|void)


Top ↑

Source Source

File: wp-admin/includes/class-wp-importer.php

	public function set_user( $user_id ) {
		if ( is_numeric( $user_id ) ) {
			$user_id = (int) $user_id;
		} else {
			$user_id = (int) username_exists( $user_id );
		}

		if ( !$user_id || !wp_set_current_user( $user_id ) ) {
			fwrite( STDERR, "Error: can not find user\n" );
			exit();
		}

		return $user_id;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.