[wp-trac] [WordPress Trac] #40364: Improve site creation in multisite
WordPress Trac
noreply at wordpress.org
Mon Jul 9 20:28:03 UTC 2018
#40364: Improve site creation in multisite
-------------------------------------------------+------------------------
Reporter: jeremyfelt | Owner: flixos90
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.0
Component: Networks and Sites | Version:
Severity: normal | Resolution:
Keywords: ms-roadmap has-patch has-unit-tests | Focuses: multisite
-------------------------------------------------+------------------------
Comment (by spacedmonkey):
So I spent the evening on this patch and I the following feedback.
- Change this action to a filter `do_action( 'wp_validate_site_data',
$validity, $data, null );` to a filter. It the conversion in WordPress, if
you are going change a value, developers use filters. They wouldn't think
to use an action. I think developers will find it weird.
- If you pass an id into `wp_insert_site`, it should pass to
`wp_update_site` to bring it into line with other crud functions. If it
doesn't do this, at least handle this as error.
- The following lines need to be changed as they are filter not actions.
`add_action( 'wp_normalize_site_data', 'wp_normalize_site_data', 10, 1 );`
-> `apply_filters( 'wp_normalize_site_data', 'wp_normalize_site_data', 10,
1 );`
`add_action( 'wp_validate_site_data', 'wp_validate_site_data', 10, 3 );`
-> `apply_filters( 'wp_validate_site_data', 'wp_validate_site_data',
10, 3 );`
- Should the actions `do_action( 'delete_blog', $blog_id, $drop );` and
`do_action( 'deleted_blog', $blog_id, $drop );` be moved to the
`wp_delete_site`? I know that the drop tables param doesn't really map,
but I am wondering if they will be breakage without these actions.
Otherwise, this patch is extremely solid. We are nearly there
--
Ticket URL: <https://core.trac.wordpress.org/ticket/40364#comment:50>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list