Make WordPress Core

Opened 14 years ago

Closed 12 years ago

Last modified 11 years ago

#17950 closed enhancement (fixed)

Introduce wp_registration_url()

Reported by: scribu's profile scribu Owned by: nacin's profile nacin
Milestone: 3.6 Priority: low
Severity: normal Version:
Component: General Keywords: has-patch commit
Focuses: Cc:

Description (last modified by scribu)

It would be handy to have a wp_registration_url() template tag, to complete the wp_login_url() and wp_logout_url() triad.

Attachments (7)

17950.diff (1.3 KB) - added by scribu 14 years ago.
17950.2.diff (1.1 KB) - added by scribu 14 years ago.
$redirect param isn't useful
17950.3.diff (2.1 KB) - added by scribu 12 years ago.
17950.4.diff (2.1 KB) - added by scribu 12 years ago.
wp_registration_url()
17950.5.diff (2.2 KB) - added by JustinSainton 12 years ago.
17950.6.diff (2.9 KB) - added by JustinSainton 12 years ago.
17950.7.diff (4.2 KB) - added by SergeyBiryukov 12 years ago.
With phpdoc corrections

Download all attachments as: .zip

Change History (31)

@scribu
14 years ago

@scribu
14 years ago

$redirect param isn't useful

#1 @scribu
14 years ago

I noticed that wp-login.php itself never uses wp_login_url() so I didn't use wp_register_url() there either.

#2 @scribu
12 years ago

Related: #19898

#3 @meloniq
12 years ago

  • Cc meloniq@… added

#4 @kovshenin
12 years ago

In 17950.2.diff since wp_register_url is filterable, we should probably esc_url when printing the register link. Also, you might want to remove the $redirect variable since it's undefined and we're not going to be using it anyway :)

@scribu
12 years ago

#5 @scribu
12 years ago

Fixed in 17950.3.diff and also use it in wp-login.php.

#6 @MikeSchinkel
12 years ago

Something to consider, wp_register_url() could easily be confused to provide functionality to register a URL like register_taxonomy() registers a taxonomy.

Suggestion: Change from verb to noun and call it wp_registration_url().

Last edited 12 years ago by MikeSchinkel (previous) (diff)

@scribu
12 years ago

wp_registration_url()

#7 @scribu
12 years ago

  • Description modified (diff)
  • Summary changed from Introduce wp_register_url() to Introduce wp_registration_url()

Good idea!

#8 @scribu
12 years ago

  • Milestone changed from Future Release to 3.6
  • Priority changed from normal to low

#9 @TheAdityaJain
12 years ago

  • Cc mail@… added

#10 @SergeyBiryukov
12 years ago

We need a decision on the filter name.

17950.4.diff introduces register_url.

#14406 suggests reusing the same register filter we already have in wp_register():
http://core.trac.wordpress.org/browser/tags/3.5/wp-includes/general-template.php#L348

#11 @scribu
12 years ago

I think 'register_url' is fine, because the 'register' hook contains the whole <a> tag.

#12 follow-up: @cartpauj
12 years ago

I like wp_register_url() personally.

#13 in reply to: ↑ 12 @rmccue
12 years ago

Replying to cartpauj:

I like wp_register_url() personally.

We have wp_login_url() and wp_logout_url() which are both using the noun form ("login" is the noun, "log in" is the verb). Hence why this is using the noun form.

#14 @SergeyBiryukov
12 years ago

  • Keywords needs-refresh added

Needs refresh after [23558]. @since 3.3.0 also needs to be updated.

#15 @JustinSainton
12 years ago

  • Keywords needs-refresh removed

Refreshed.

#16 @SergeyBiryukov
12 years ago

There are 3 instances of site_url( 'wp-login.php?action=register', 'login' ) in wp-login.php (see [23558] for line numbers), I guess the third one needs to be replaced as well.

#17 @JustinSainton
12 years ago

Gotta catch 'em all, gotta catch 'em all.

#18 @SergeyBiryukov
12 years ago

  • Keywords commit added

@SergeyBiryukov
12 years ago

With phpdoc corrections

#19 @nacin
12 years ago

  • Owner set to nacin
  • Resolution set to fixed
  • Status changed from new to closed

In 24053:

Add wp_registration_url() and register_url filter.

props scribu, JustinSainton, SergeyBiryukov.
fixes #17950.

#20 @DrewAPicture
12 years ago

  • Keywords needs-codex added

#21 @swissspidy
12 years ago

#19097 was marked as a duplicate.

#22 @ramiy
12 years ago

Related: #10141

#23 @bcworkz
11 years ago

  • Keywords needs-codex removed

Function reference page fleshed out in Aug 13 by Gogger, Djkaz, Ramiy

#24 @ramiy
11 years ago

#10141 was marked as a duplicate.

Note: See TracTickets for help on using tickets.