newblogname WordPress Filter Hook

The newblogname hook is a great way to ensure that your blog's URL is always up-to-date. This hook runs during the WordPress initialization process, so it is available to all plugins and themes. newblogname is also a WordPress core function, so it is always available. The newblogname hook takes two parameters: the old blog URL and the new blog URL. If you are using a custom URL for your blog, you can update it using this hook. Simply add the following code to your theme's functions.php file: function my_new_blog_url( $old_url, $new_url ) { // do something with $old_url and $new_url } add_action( 'newblogname', 'my_new_blog_url', 10, 2 ); This hook is also useful for developers who are creating WordPress themes or plugins that need to generate a blog URL.

apply_filters( 'newblogname', string $blogname ) #

Filters the new site name during registration.


Description

The name is the site’s subdomain or the site’s subdirectory path depending on the network settings.


Top ↑

Parameters

$blogname

(string)Site name.


Top ↑

Source

File: wp-includes/ms-functions.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
MU (3.0.0)Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More
Show More