Allow comments only for custom post type

if you are using the code from the thread you linked to, to disable the comments on post and pages then when a new post/page is added it should have the comments automatically disabled. The existing posts/pages will have comments enabled unless you uncheck the “Allow comments” checkbox when editing a post. A quick and … Read more

current_user_can() causing critical error

The problem is that wp_get_current_user (which current_user_can relies upon) is pluggable, which means it isn’t loaded until after plugins are loaded (to give plugins a chance to override it). That means it’s not available to call from the top level of a plugin file. Instead, I’d make the role check inside the hook e.g. function … Read more

Give admin_menu permission to specific users

To grant access to the menu for users with Editor role, in place of manage_options use publish_pages as the capability. To be able to guide you in the future, use the breakdown of capabilities listed in this page below. Pick a capability that is present only in the roles you’re targeting. https://wordpress.org/support/article/roles-and-capabilities/

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)