default_password_nag_handler

Definition:
function default_password_nag_handler($errors = false) {}

Parameters

  • $errors

Source code

function default_password_nag_handler($errors = false) {

	global $user_ID;

	if ( ! get_user_option('default_password_nag') ) //Short circuit it.

		return;



	//get_user_setting = JS saved UI setting. else no-js-falback code.

	if ( 'hide' == get_user_setting('default_password_nag') || isset($_GET['default_password_nag']) && '0' == $_GET['default_password_nag'] ) {

		delete_user_setting('default_password_nag');

		update_user_option($user_ID, 'default_password_nag', false, true);

	}

}

784

default_password_nag_edit_user

Definition:
function default_password_nag_edit_user($user_ID, $old_data) {}

Parameters

  • $user_ID
  • $old_data

Source code

function default_password_nag_edit_user($user_ID, $old_data) {

	if ( ! get_user_option('default_password_nag', $user_ID) ) //Short circuit it.

		return;



	$new_data = get_userdata($user_ID);



	if ( $new_data->user_pass != $old_data->user_pass ) { //Remove the nag if the password has been changed.

		delete_user_setting('default_password_nag', $user_ID);

		update_user_option($user_ID, 'default_password_nag', false, true);

	}

}

782

default_password_nag

Definition:
function default_password_nag() {}

Source code

function default_password_nag() {

	global $pagenow;

	if ( 'profile.php' == $pagenow || ! get_user_option('default_password_nag') ) //Short circuit it.

		return;



	echo '<div class="error default-password-nag">';

	echo '<p>';

	echo '<strong>' . __('Notice:') . '</strong> ';

	_e('You&rsquo;re using the auto-generated password for your account. Would you like to change it to something easier to remember?');

	echo '</p><p>';

	printf( '<a href="%s">' . __('Yes, take me to my profile page') . '</a> | ', admin_url('profile.php') . '#password' );

	printf( '<a href="%s" id="default-password-nag-no">' . __('No thanks, do not remind me again') . '</a>', '?default_password_nag=0' );

	echo '</p></div>';

}

780

debug_fwrite

Definition:
function debug_fwrite( $fp, $string ) {}

Write contents to the file used for debugging.
Technically, this can be used to write to any file handle when the global $debug is set to 1 or true.

Parameters

  • resource $fp: File handle for debugging file.
  • string $string: Content to write to debug file.

Source code

function debug_fwrite( $fp, $string ) {

	global $debug;

	if ( 1 == $debug )

		fwrite( $fp, $string );

}

778

debug_fopen

Definition:
function debug_fopen( $filename, $mode ) {}

Open the file handle for debugging.
This function is used for XMLRPC feature, but it is general purpose enough to be used in anywhere.

Parameters

  • string $filename: File path to debug file.
  • string $mode: Same as fopen() mode parameter.

Return values

returns:File handle. False on failure.

Source code

function debug_fopen( $filename, $mode ) {

	global $debug;

	if ( 1 == $debug ) {

		$fp = fopen( $filename, $mode );

		return $fp;

	} else {

		return false;

	}

}

776