Switch role on submit button

The exact solution depends on how you create a team. You will have to hook into that action. Supposing that creating a team is done by creating a post of the custom type “team” you would hook into save_post_team, leading to something like this: add_action (‘save_post_team’, ‘wpse314398_change_team_captain_role’, 10, 3); function wpse314398_change_team_captain_role ($post_id, $post, $update) { … 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

Create relationships between users or user roles

For functionality like this I think you’ll have to go with premium plugins or code it yourself. If you want to go with custom code Pods might be able to help you out with creating relationships between doctors and patients: https://wordpress.org/plugins/pods/

Ajax call not working anymore

I figured it out using this previous post: Issue with front-end ajax, getting a 302 redirect when accessing wp-admin/admin-ajax.php Basically, I had added an action to prevent subscribers from seeing certain wordpress pages. function limit_subscriber_access() { $redirect = home_url( “https://wordpress.stackexchange.com/” ); if ( ! ( current_user_can( ‘manage_options’ ) || current_user_can( ‘edit_posts’ ) )) exit( wp_redirect( … Read more

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