Small compatibility fix | WordPress.org

[ad_1]

Hi, couldn’t find your plugin in Github, so I’ll suggest a small compatibility fix here.

Please change current_user_can() call in admin/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.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer