[wp-trac] [WordPress Trac] #60366: add call_for_blog for easy to switch blog and restore in multisite
WordPress Trac
noreply at wordpress.org
Wed Feb 19 07:10:09 UTC 2025
#60366: add call_for_blog for easy to switch blog and restore in multisite
-------------------------+------------------------------
Reporter: denishua | Owner: (none)
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version:
Severity: normal | Resolution:
Keywords: | Focuses:
-------------------------+------------------------------
Comment (by oshodev):
Usage Example 2: Closure-based call
{{{
call_for_blog($shop_blog_id, function($id, $title) {
$result = some_function();
if (is_wp_error($result)) {
return $result;
}
$result = some_other_function();
if (is_wp_error($result)) {
return $result;
}
return wp_update_post(['ID' => $id, 'post_title' => $title]);
}, $id, $title);
}}}
--
Ticket URL: <https://core.trac.wordpress.org/ticket/60366#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list