Not able to post data through wp-admin

I recommend to try by debugging the code, might be there is an issue because of a New version of PHP. Try by writing this code into the wp-config.php file and see what if any error: // Enable WP_DEBUG mode define( ‘WP_DEBUG’, true ); // Enable Debug logging to the /wp-content/debug.log file define( ‘WP_DEBUG_LOG’, true … Read more

Disabling user capability to edit_posts or delete_posts in the front-end

By using this functionality we can able to remove the delete option of the page or post. function wp_restrict_page_deletion( $caps, $cap, $user_id, $args ) { $post_id = $args[0]; if ( $cap === ‘delete_post’ && $post_id === your post id* ) { $caps[] = ‘do_not_allow’; } return $caps; } add_filter( ‘map_meta_cap’, ‘wp_restrict_page_deletion’, 10, 4 ); I … Read more

Buddy Press restrict the capability to edit users

Ok I got an solution for my case. Maybe a bit confusing but I did’nt saw anothere possibility to do this. If you know a better way let me know. First I hide the Edit Item in the Admin Menu: add_action( ‘admin_bar_menu’, array($this,’sa_classbook_remove_admin_bar_items’), 999 ); function sa_classbook_remove_admin_bar_items(){ global $wp_admin_bar; $wp_admin_bar->remove_node(‘user-admin’); } Then I check the … Read more

Enable plugins for a specific user role

You can try something like this if ( is_myrole() ) { add_action( ‘some_menu’, ‘my_plugin_menu’ ); } function my_plugin_menu() { add_options_page(‘My Plugin Settings’, ‘My Plugin’, ‘manage_options’, ‘my-plugin-settings’, ‘my_plugin_admin_page’); }

Remove dashboard links from wordpress

you should follow the below code and also see the wordpress docs <?php function remove_menus(){ remove_menu_page( ‘index.php’ ); //Dashboard //remove_menu_page( ‘jetpack’ ); //Jetpack* //remove_menu_page( ‘edit.php’ ); //Posts //remove_menu_page( ‘upload.php’ ); //Media //remove_menu_page( ‘edit.php?post_type=page’ ); //Pages //remove_menu_page( ‘edit-comments.php’ ); //Comments //remove_menu_page( ‘themes.php’ ); //Appearance //remove_menu_page( ‘plugins.php’ ); //Plugins //remove_menu_page( ‘users.php’ ); //Users //remove_menu_page( ‘tools.php’ ); //Tools … Read more