[wp-trac] [WordPress Trac] #44293: Discrepancy between documentation and implementation of wp_new_user_notification()
WordPress Trac
noreply at wordpress.org
Mon Jul 2 13:17:27 UTC 2018
#44293: Discrepancy between documentation and implementation of
wp_new_user_notification()
-------------------------------------------------+-------------------------
Reporter: 360zen | Owner: (none)
Type: defect (bug) | Status: new
Priority: normal | Milestone: Future
| Release
Component: Users | Version: 4.3
Severity: minor | Resolution:
Keywords: good-first-bug has-patch dev- | Focuses:
feedback needs-unit-tests needs-refresh |
-------------------------------------------------+-------------------------
Comment (by cthreelabs):
Replying to [comment:10 swissspidy]:
Thanks for the useful feedback, I have modified the patch and used wpcs
linters to avoid wp coding standard issues. I have also updated the test
to check the wp_new_user_notificaion function. Hope this is helpful.
> Few notes on the patch:
>
> * The patch doesn't follow the core coding standards (esp. missing
spacing), see https://make.wordpress.org/core/handbook/best-practices
/coding-standards/php/
> * A simple `if ( ! in_array( $notify, array( 'user', 'admin', 'both', ''
), true ) ) { return; }` would do the trick. No other check is needed.
> * The unit test doesn't really test the `wp_new_user_notification`
function. It basically tests whether `in_array` works.
> * We already have tests for `wp_new_user_notification` using a data
provider (see `tests/phpunit/tests/user.php`). This could be extended with
a test using `jibrish` as an input.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/44293#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list