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.
Parameters
- $blogname
(string)Site name.
Source
Changelog
Version | Description |
---|---|
MU (3.0.0) | Introduced. |