register_post WordPress Action Hook

The register_post hook is one of the most important hooks in WordPress. It is used to register new posts and custom post types. This hook is also used to set up the permalinks for new posts and custom post types.

do_action( 'register_post', string $sanitized_user_login, string $user_email, WP_Error $errors ) #

Fires when submitting registration form data, before the user is created.


Parameters

$sanitized_user_login

(string)The submitted username after being sanitized.

$user_email

(string)The submitted email.

$errors

(WP_Error)Contains any errors with submitted username and email, e.g., an empty field, an invalid username or email, or an existing username or email.


Top ↑

More Information

This action hook can be used to handle post data from a user registration before the registration_errors filter is called or errors are returned.

Please note that this hook should never be used for custom validation. Any custom validation rules should be performed using the registration_errors filter.


Top ↑

Source

File: wp-includes/user.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.1.0Introduced.

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