Automatically Assign Author to Category [closed]
Automatically Assign Author to Category [closed]
Automatically Assign Author to Category [closed]
Edit the author of custom post type
First of all, you don’t want unregistered users to be able to edit comments, because you have no way of knowing whether they are who they say they are. So, this can only be made to work for registered users. As you can see from roles and capabilities only editors and up can moderate comments. … Read more
This is the answer for my above Question add_action(‘pre_user_query’,’ap_pre_user_query’); function ap_pre_user_query($user_search) { $user = wp_get_current_user(); if ($user->ID!=1) { // Is not administrator, remove administrator (you can add any user-ID) global $wpdb; global $user_ID; //Fetch the custom field value added in user section $meta = get_user_meta( $user_ID ); $selected_author_id = unserialize($meta[‘select_md’][0]); $count = count($selected_author_id); //to the … Read more
You can achieve this by adding a new rewrite rule using ‘add_rewrite_rule`. If the category is the default WordPress category, you won’t have to register a query_var but if your category is a custom category, then you would have to register a query_var using the query_vars filter. If category is the default WordPress category: function … Read more
Custom avatar image link added to the profile page
ok,so I digged into wp-includes/query.php,and found this on line 3180: if ( is_user_logged_in() ) { // Add private states that are limited to viewing by the author of a post or someone who has caps to read private states. $private_states = get_post_stati( array(‘private’ => true) ); foreach ( (array) $private_states as $state ) $where .= … Read more
By adding another array $args = array( ‘post_type’ => ‘custom_post_type’, ‘meta_query’ => array( array( ‘key’ => ‘size’, ‘value’ => ‘big’, ‘compare’ => ‘LIKE’, ), array( ‘key’ => ‘gender’, ‘value’ => ‘male’, ), ) ); $query = new WP_Query( $args );
Restrict author to create subcategory in a selected category
A much more efficient way that doesn’t require editing the source code: install and activate wpfront User role editor, go to all roles, edit the author role, scroll down to the ‘other capabilities’ section, check the following capabilities: wpProQuiz_show, wpProQuiz_add_quiz, wpProQuiz_edit_quiz Save. The authors on your site should now be able to add and edit … Read more