Opened 11 years ago
Closed 10 years ago
#32907 closed defect (bug) (fixed)
We should pass the site ID to the 'wpmu_update_blog_options' action
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.4 | Priority: | normal |
| Severity: | normal | Version: | 3.0 |
| Component: | Options, Meta APIs | Keywords: | good-first-bug has-patch commit |
| Focuses: | multisite | Cc: |
Description
The wpmu_update_blog_options hook was added following the MU merge in 3.0 along with the wpmueditblogaction hook.
The suggestion is that we should match the style of the latter and pass the site ID even though it's easily accessible via get_current_blog_id() where the wpmu_update_blog_options hook fires.
Might as well also fix the docs alignment while we're in there too.
https://core.trac.wordpress.org/browser/trunk/src/wp-admin/network/site-settings.php#L61
Attachments (3)
Change History (16)
This ticket was mentioned in Slack in #core by swissspidy. View the logs.
11 years ago
#6
@
11 years ago
- Milestone changed from Awaiting Review to Future Release
Too late for 4.3 I guess.
#8
follow-ups:
↓ 9
↓ 10
@
11 years ago
I don't have strong feelings, though it would be nice to find another example of a hook in core where an ID was passed that was readily available through something like get_current_blog_id().
#9
in reply to:
↑ 8
@
11 years ago
Replying to jeremyfelt:
I don't have strong feelings, though it would be nice to find another example of a hook in core where an ID was passed that was readily available through something like
get_current_blog_id().
A quick search shows a few filters that pass easily-accessible values:
apply_filters( 'all_plugins', get_plugins() ); apply_filters( 'the_content', get_the_content() ); apply_filters( 'the_permalink_rss', get_permalink() ); apply_filters( 'the_excerpt', get_the_excerpt() ); apply_filters( 'core_version_check_locale', get_locale() );
And so on. No actions though that I'm seeing with my rudimentary RegEx.
#10
in reply to:
↑ 8
;
follow-up:
↓ 11
@
10 years ago
- Focuses docs added
Replying to jeremyfelt:
I don't have strong feelings, though it would be nice to find another example of a hook in core where an ID was passed that was readily available through something like
get_current_blog_id().
In the same file $id is passed to the wpmueditblogaction action. Since $id is already available, I don't really see a benefit of using get_current_blog_id() instead. But there's a patch for either scenario.
#11
in reply to:
↑ 10
@
10 years ago
- Keywords 4.4-early removed
- Milestone changed from Future Release to 4.4
- Owner changed from swissspidy to jeremyfelt
- Status changed from assigned to reviewing
Replying to swissspidy:
In the same file
$idis passed to thewpmueditblogactionaction. Since$idis already available, I don't really see a benefit of usingget_current_blog_id()instead. But there's a patch for either scenario.
Yeah, I was thinking more along the lines of whether passing the ID was necessary because you can use get_current_blog_id() in your hooked function because things are currently switched. We have to pass $id to wpmueditblogaction because things are back to the network's site context.
I do think the argument for clarity works as it would unify the two a bit. I'll take a look at getting this in.
Add
$blog_idparameter