next_comments_link

Definition:
function next_comments_link( $label = '', $max_page = 0 ) {}

Display the link to next comments page.

Parameters

  • string $label: Optional. Label for link text.
  • int $max_page: Optional. Max page.

Source code

function next_comments_link( $label = '', $max_page = 0 ) {

	echo get_next_comments_link( $label, $max_page );

}

2439

new_user_email_admin_notice

Definition:
function new_user_email_admin_notice() {}

Source code

function new_user_email_admin_notice() {

	if ( strpos( $_SERVER['PHP_SELF'], 'profile.php' ) && isset( $_GET['updated'] ) && $email = get_option( get_current_user_id() . '_new_email' ) )

		echo "<div class='update-nag'>" . sprintf( __( "Your email address has not been updated yet. Please check your inbox at %s for a confirmation email." ), $email['newemail'] ) . "</div>";

}

2437

newuser_notify_siteadmin

Definition:
function newuser_notify_siteadmin( $user_id ) {}

Notifies the network admin that a new user has been activated.
Filter ‘newuser_notify_siteadmin’ to change the content of the notification email.

Parameters

  • int $user_id: The new user’s ID.

Defined filters

  • newuser_notify_siteadmin
    apply_filters( 'newuser_notify_siteadmin', $msg )

Source code

function newuser_notify_siteadmin( $user_id ) {

	if ( get_site_option( 'registrationnotification' ) != 'yes' )

		return false;



	$email = get_site_option( 'admin_email' );



	if ( is_email($email) == false )

		return false;



	$user = new WP_User($user_id);



	$options_site_url = esc_url(network_admin_url('settings.php'));

	$msg = sprintf(__('New User: %1s

Remote IP: %2s



Disable these notifications: %3s'), $user->user_login, $_SERVER['REMOTE_ADDR'], $options_site_url);



	$msg = apply_filters( 'newuser_notify_siteadmin', $msg );

	wp_mail( $email, sprintf(__('New User Registration: %s'), $user->user_login), $msg );

	return true;

}

2435

newblog_notify_siteadmin

Definition:
function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {}

Notifies the network admin that a new site has been activated.
Filter ‘newblog_notify_siteadmin’ to change the content of the notification email.

Parameters

  • int $blog_id: The new site’s ID.
  • $deprecated

Defined filters

  • newblog_notify_siteadmin
    apply_filters( 'newblog_notify_siteadmin', $msg )

Source code

function newblog_notify_siteadmin( $blog_id, $deprecated = '' ) {

	if ( get_site_option( 'registrationnotification' ) != 'yes' )

		return false;



	$email = get_site_option( 'admin_email' );

	if ( is_email($email) == false )

		return false;



	$options_site_url = esc_url(network_admin_url('settings.php'));



	switch_to_blog( $blog_id );

	$blogname = get_option( 'blogname' );

	$siteurl = site_url();

	restore_current_blog();



	$msg = sprintf( __( 'New Site: %1s

URL: %2s

Remote IP: %3s



Disable these notifications: %4s' ), $blogname, $siteurl, $_SERVER['REMOTE_ADDR'], $options_site_url);

	$msg = apply_filters( 'newblog_notify_siteadmin', $msg );



	wp_mail( $email, sprintf( __( 'New Site Registration: %s' ), $siteurl ), $msg );

	return true;

}

2433

network_step2

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

Prints step 2 for Network installation process.

Parameters

  • $errors

Source code

function network_step2( $errors = false ) {

	global $base, $wpdb;

	$hostname = get_clean_basedomain();



	if ( ! isset( $base ) )

		$base = trailingslashit( stripslashes( dirname( dirname( $_SERVER['SCRIPT_NAME'] ) ) ) );



	// Wildcard DNS message.

	if ( is_wp_error( $errors ) )

		echo '<div class="error">' . $errors->get_error_message() . '</div>';



	if ( $_POST ) {

		if ( allow_subdomain_install() )

			$subdomain_install = allow_subdirectory_install() ? ! empty( $_POST['subdomain_install'] ) : true;

		else

			$subdomain_install = false;

	} else {

		if ( is_multisite() ) {

			$subdomain_install = is_subdomain_install();

?>

	<p><?php _e( 'The original configuration steps are shown here for reference.' ); ?></p>

<?php

		} else {

			$subdomain_install = (bool) $wpdb->get_var( "SELECT meta_value FROM $wpdb->sitemeta WHERE site_id = 1 AND meta_key = 'subdomain_install'" );

?>

	<div class="error"><p><strong><?php _e('Warning:'); ?></strong> <?php _e( 'An existing WordPress network was detected.' ); ?></p></div>

	<p><?php _e( 'Please complete the configuration steps. To create a new network, you will need to empty or remove the network database tables.' ); ?></p>

<?php

		}

	}



	if ( $_POST || ! is_multisite() ) {

?>

		<h3><?php esc_html_e( 'Enabling the Network' ); ?></h3>

		<p><?php _e( 'Complete the following steps to enable the features for creating a network of sites.' ); ?></p>

		<div class="updated inline"><p><?php

			if ( file_exists( ABSPATH . '.htaccess' ) )

				printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), '.htaccess' );

			elseif ( file_exists( ABSPATH . 'web.config' ) )

				printf( __( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> and <code>%s</code> files.' ), 'web.config' );

			else

				_e( '<strong>Caution:</strong> We recommend you back up your existing <code>wp-config.php</code> file.' );

		?></p></div>

<?php

	}

?>

		<ol>

			<li><p><?php

				printf( __( 'Create a <code>blogs.dir</code> directory at <code>%s/blogs.dir</code>. This directory is used to store uploaded media for your additional sites and must be writeable by the web server.' ), WP_CONTENT_DIR );

				if ( WP_CONTENT_DIR != ABSPATH . 'wp-content' )

					echo ' <strong>' . __('Warning:') . ' ' . __( 'Networks may not be fully compatible with custom wp-content directories.' ) . '</strong';

			?></p></li>

			<li><p><?php printf( __( 'Add the following to your <code>wp-config.php</code> file in <code>%s</code> <strong>above</strong> the line reading <code>/* That’s all, stop editing! Happy blogging. */</code>:' ), ABSPATH ); ?></p>

				<textarea class="code" readonly="readonly" cols="100" rows="7">

define( 'MULTISITE', true );

define( 'SUBDOMAIN_INSTALL', <?php echo $subdomain_install ? 'true' : 'false'; ?> );

$base = '<?php echo $base; ?>';

define( 'DOMAIN_CURRENT_SITE', '<?php echo $hostname; ?>' );

define( 'PATH_CURRENT_SITE', '<?php echo $base; ?>' );

define( 'SITE_ID_CURRENT_SITE', 1 );

define( 'BLOG_ID_CURRENT_SITE', 1 );</textarea>

<?php

	$keys_salts = array( 'AUTH_KEY' => '', 'SECURE_AUTH_KEY' => '', 'LOGGED_IN_KEY' => '', 'NONCE_KEY' => '', 'AUTH_SALT' => '', 'SECURE_AUTH_SALT' => '', 'LOGGED_IN_SALT' => '', 'NONCE_SALT' => '' );

	foreach ( $keys_salts as $c => $v ) {

		if ( defined( $c ) )

			unset( $keys_salts[ $c ] );

	}

	if ( ! empty( $keys_salts ) ) {

		$keys_salts_str = '';

		$from_api = wp_remote_get( 'https://api.wordpress.org/secret-key/1.1/salt/' );

		if ( is_wp_error( $from_api ) ) {

			foreach ( $keys_salts as $c => $v ) {

				$keys_salts_str .= "\ndefine( '$c', '" . wp_generate_password( 64, true, true ) . "' );";

			}

		} else {

			$from_api = explode( "\n", wp_remote_retrieve_body( $from_api ) );

			foreach ( $keys_salts as $c => $v ) {

				$keys_salts_str .= "\ndefine( '$c', '" . substr( array_shift( $from_api ), 28, 64 ) . "' );";

			}

		}

		$num_keys_salts = count( $keys_salts );

?>

	<p><?php

		echo _n( 'This unique authentication key is also missing from your <code>wp-config.php</code> file.', 'These unique authentication keys are also missing from your <code>wp-config.php</code> file.', $num_keys_salts ); ?> <?php _e( 'To make your installation more secure, you should also add:' ) ?></p>

	<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $num_keys_salts; ?>"><?php echo esc_textarea( $keys_salts_str ); ?></textarea>

<?php

	}

?>

</li>

<?php

	if ( iis7_supports_permalinks() ) :



			if ( $subdomain_install ) {

				$web_config_file =

'<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <rewrite>

            <rules>

                <rule name="WordPress Rule 1" stopProcessing="true">

                    <match url="^index\.php$" ignoreCase="false" />

                    <action type="None" />

                </rule>

                <rule name="WordPress Rule 2" stopProcessing="true">

                    <match url="^files/(.+)" ignoreCase="false" />

                    <action type="Rewrite" url="wp-includes/ms-files.php?file={R:1}" appendQueryString="false" />

                </rule>

                <rule name="WordPress Rule 3" stopProcessing="true">

                    <match url="^" ignoreCase="false" />

                    <conditions logicalGrouping="MatchAny">

                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />

                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />

                    </conditions>

                    <action type="None" />

                </rule>

                <rule name="WordPress Rule 4" stopProcessing="true">

                    <match url="." ignoreCase="false" />

                    <action type="Rewrite" url="index.php" />

                </rule>

            </rules>

        </rewrite>

    </system.webServer>

</configuration>';

			} else {

				$web_config_file =

'<?xml version="1.0" encoding="UTF-8"?>

<configuration>

    <system.webServer>

        <rewrite>

            <rules>

                <rule name="WordPress Rule 1" stopProcessing="true">

                    <match url="^index\.php$" ignoreCase="false" />

                    <action type="None" />

                </rule>

                <rule name="WordPress Rule 2" stopProcessing="true">

                    <match url="^([_0-9a-zA-Z-]+/)?files/(.+)" ignoreCase="false" />

                    <action type="Rewrite" url="wp-includes/ms-files.php?file={R:2}" appendQueryString="false" />

                </rule>

                <rule name="WordPress Rule 3" stopProcessing="true">

                    <match url="^([_0-9a-zA-Z-]+/)?wp-admin$" ignoreCase="false" />

                    <action type="Redirect" url="{R:1}wp-admin/" redirectType="Permanent" />

                </rule>

                <rule name="WordPress Rule 4" stopProcessing="true">

                    <match url="^" ignoreCase="false" />

                    <conditions logicalGrouping="MatchAny">

                        <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" />

                        <add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" />

                    </conditions>

                    <action type="None" />

                </rule>

                <rule name="WordPress Rule 5" stopProcessing="true">

                    <match url="^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*)" ignoreCase="false" />

                    <action type="Rewrite" url="{R:2}" />

                </rule>

                <rule name="WordPress Rule 6" stopProcessing="true">

                    <match url="^([_0-9a-zA-Z-]+/)?(.*\.php)$" ignoreCase="false" />

                    <action type="Rewrite" url="{R:2}" />

                </rule>

                <rule name="WordPress Rule 7" stopProcessing="true">

                    <match url="." ignoreCase="false" />

                    <action type="Rewrite" url="index.php" />

                </rule>

            </rules>

        </rewrite>

    </system.webServer>

</configuration>';

			}

	?>

		<li><p><?php printf( __( 'Add the following to your <code>web.config</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>

		<textarea class="code" readonly="readonly" cols="100" rows="20">

		<?php echo esc_textarea( $web_config_file ); ?>

		</textarea></li>

		</ol>



	<?php else : // end iis7_supports_permalinks(). construct an htaccess file instead:



		$htaccess_file = 'RewriteEngine On

RewriteBase ' . $base . '

RewriteRule ^index\.php$ - [L]



# uploaded files

RewriteRule ^' . ( $subdomain_install ? '' : '([_0-9a-zA-Z-]+/)?' ) . 'files/(.+) wp-includes/ms-files.php?file=$' . ( $subdomain_install ? 1 : 2 ) . ' [L]' . "\n";



		if ( ! $subdomain_install )

			$htaccess_file .= "\n# add a trailing slash to /wp-admin\n" . 'RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]' . "\n";



		$htaccess_file .= "\n" . 'RewriteCond %{REQUEST_FILENAME} -f [OR]

RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^ - [L]';



		// @todo custom content dir.

		if ( ! $subdomain_install )

			$htaccess_file .= "\nRewriteRule  ^[_0-9a-zA-Z-]+/(wp-(content|admin|includes).*) $1 [L]\nRewriteRule  ^[_0-9a-zA-Z-]+/(.*\.php)$ $1 [L]";



		$htaccess_file .= "\nRewriteRule . index.php [L]";



		?>

		<li><p><?php printf( __( 'Add the following to your <code>.htaccess</code> file in <code>%s</code>, replacing other WordPress rules:' ), ABSPATH ); ?></p>

		<textarea class="code" readonly="readonly" cols="100" rows="<?php echo $subdomain_install ? 11 : 16; ?>">

<?php echo esc_textarea( $htaccess_file ); ?></textarea></li>

		</ol>



	<?php endif; // end IIS/Apache code branches.



	if ( !is_multisite() ) { ?>

		<p><?php printf( __( 'Once you complete these steps, your network is enabled and configured. You will have to log in again.') ); ?> <a href="<?php echo esc_url( site_url( 'wp-login.php' ) ); ?>"><?php _e( 'Log In' ); ?></a></p>

<?php

	}

}

2431