Tag Info

Hot answers tagged

4

For non-admin users to be able to use an ajax function, you need to also include a second hook using wp_ajax_nopriv So right after this: add_action('wp_ajax_add_category_bookly', 'add_category_bookly_callback'); you should include this: add_action('wp_ajax_nopriv_add_category_bookly', 'add_category_bookly_callback');


3

Here's a great codex article on the topic of creating administration theme: http://codex.wordpress.org/Creating_Admin_Themes And back to your question, you will want to load different stylesheets for different user roles, so you have to check who the current user is. Pay attention, the check is done using current_user_can() function and checking for ...


1

Yes we can achieve it by following . add_filter( 'user_row_actions', 'custom_action_function', 1, 2 ); function custom_action_function($actions, $user_object) { if ( 1 >= count( $user_object->roles ) && 'subscriber' !== $user_object->roles[0] ) { unset( $actions['delete'] ); } return $actions; }


1

You can attach code to change role when post status is changing from "pending" to "published" see documentation: http://codex.wordpress.org/Post_Status_Transitions Then, if user has role "contributor" you can change this to "author": add_action( 'pending_to_publish'. 'my_function', 10, 1 ); function my_function( $post ) { $wp_user_object ...


1

Add the following code to your functions.php: function allow_contributor_uploads() { $contributor = get_role('contributor'); $contributor->add_cap('upload_files'); } if ( current_user_can('contributor') && !current_user_can('upload_files') ) { add_action('admin_init', 'allow_contributor_uploads'); } This will add the upload_files ...



Only top voted, non community-wiki answers of a minimum length are eligible