Make WordPress Core

Opened 10 years ago

Last modified 5 years ago

#28352 assigned enhancement

New filters in wp-activate.php

Reported by: umeshsingla's profile UmeshSingla Owned by: voldemortensen's profile voldemortensen
Milestone: Priority: normal
Severity: normal Version: 3.0
Component: Login and Registration Keywords: has-patch
Focuses: multisite Cc:

Description

Added two new filters to filter content being displayed on activation confirmation or error.

signup_activation_success and signup_activation_error, it allows to change the default activation message being displayed

Attachments (5)

wp-activate.patch (6.0 KB) - added by UmeshSingla 10 years ago.
Added filters to display a custom user or blog activation message
28352.diff (5.8 KB) - added by MikeHansenMe 9 years ago.
Updated based on previous patch but pass the original message into the filter
28352.2.diff (5.9 KB) - added by voldemortensen 8 years ago.
28352.3.diff (5.9 KB) - added by voldemortensen 8 years ago.
Conform to some doc block standards.
28352.4.diff (7.7 KB) - added by flixos90 8 years ago.

Download all attachments as: .zip

Change History (20)

@UmeshSingla
10 years ago

Added filters to display a custom user or blog activation message

#1 @SergeyBiryukov
10 years ago

  • Focuses multisite added

Related: #17948, #20075.

#2 @UmeshSingla
10 years ago

Any Chance to see this coming in 4.0 Major release?

#3 @nacin
10 years ago

  • Milestone changed from Awaiting Review to Future Release
  • Version changed from trunk to 3.0

@MikeHansenMe
9 years ago

Updated based on previous patch but pass the original message into the filter

#4 @MikeHansenMe
9 years ago

  • Keywords has-patch added

#5 @voldemortensen
8 years ago

  • Keywords needs-refresh added; has-patch removed

#6 @voldemortensen
8 years ago

  • Keywords has-patch added; needs-refresh removed
  • Milestone changed from Future Release to 4.6

This ticket was mentioned in Slack in #core by voldemortensen. View the logs.


8 years ago

@voldemortensen
8 years ago

Conform to some doc block standards.

#8 @boonebgorges
8 years ago

A couple questions about the patch:

  • Is there a way it can be restructured so we're not passing so much markup to the filters? The answer here may well be "no", but it would be nice to minimize it, since it makes the filter very difficult to use for any purpose but completely rebuilding the message.
  • The two different kinds of string being filtered through 'signup_activation_error' are not similar at all. Only the second one seems like an error at all. Given the multiple different ways these messages can be built, I would lean toward having a single 'signup_activation_message' filter that everything gets passed through; callbacks can determine whether it's an "error" by looking at the $result parameter.

This ticket was mentioned in Slack in #core by chriscct7. View the logs.


8 years ago

#10 @chriscct7
8 years ago

  • Owner set to voldemortensen
  • Status changed from new to assigned

This ticket was mentioned in Slack in #core-multisite by jeremyfelt. View the logs.


8 years ago

#12 @flixos90
8 years ago

An alternative approach would be short-circuiting the process of generating messages with a pre_signup_activation_error and pre_signup_activation_success. These could be passed a false (plus the other parameters) and if it returns anything other than that, do not continue.
Or we could be more specific and say if the filter returns a string, it is assumed to be a replacement message that we then print out before stopping.

#13 @ocean90
8 years ago

  • Keywords needs-refresh added

@flixos90
8 years ago

#14 @flixos90
8 years ago

  • Keywords needs-refresh removed

28352.4.diff is a new take on this ticket, aiming to simplify the process a bit.

  • the code to print the success-/error-related output has been moved to separate functions signup_activation_error() and signup_activation_process()
  • the filter pre_signup_activation_error can be used to short-circuit the process of generating the error output
  • the filter pre_signup_activation_success can be used to short-circuit the process of generating the success output
  • only $result is passed to those filters (in addition to empty string)
Last edited 8 years ago by flixos90 (previous) (diff)

#15 @jeremyfelt
8 years ago

  • Milestone changed from 4.6 to Future Release

Let's push this off for this release. We need some more discussion on approach—replace individual messaging, short circuit entire page, do something entirely different?

Note: See TracTickets for help on using tickets.