Small compatibility fix
-
Hi, couldn’t find your plugin in Github, so I’ll suggest a small compatibility fix here.
Please change
current_user_can()
call inadmin/views/nelio-content-overview-widget.php
row 188 to use post ID instead of WP_Post object.} elseif ( current_user_can( 'edit_post', $p ) ) {
??} elseif ( current_user_can( 'edit_post', $p->ID ) ) {
Without this fix the plugin is not fully compatible with eg. Polylang, which filters capabilities and expects param to be an ID instead of WP_Post.
Your code works, but it’s not “correct” as per WordPress
current_user_can()
documentation. See the examples and paramater documentation, which are using/suggesting of using ID.
- You must be logged in to reply to this topic.