Having Multiple authors for the same WordPress Plugin

Give this a try 1) First add new headers for the plugin meta: add_filter(‘extra_plugin_headers’, ‘add_extra_headers’); function add_extra_headers(){ return array(‘Author2’); } 2) Next filter the authors meta row on output: add_filter(‘plugin_row_meta’, ‘filter_authors_row_meta’, 1, 4); function filter_authors_row_meta($plugin_meta, $plugin_file, $plugin_data, $status ){ if(empty($plugin_data[‘Author’])){ return $plugin_meta; } if ( !empty( $plugin_data[‘Author2’] ) ) { $plugin_meta[1] = $plugin_meta[1] . ‘, … Read more

Restrict the Number of Posts an Author can Publish (over time)?

Closest thing out there seems to be: http://www.spaw.it/359/wordpress-plugin-limit-post-creation/, but it only sets a single, hard limit. I think your best bet is to utilize this WordPress thread with code to limit number of posts for registered users: http://wordpress.org/support/topic/limit-the-number-of-posts-a-user-can-make?replies=18 You would need to change the $count_posts var to only count posts made within your time-frame…

Set a User as Author of all ‘New Posts’ posted

function wp84782_replace_author( $post_ID ) { $my_post = array(); $my_post[‘ID’] = $post_ID; $my_post[‘post_author’] = 1 ; //This is the ID number of whatever author you want to assign // Update the post into the database wp_update_post( $my_post ); } add_action( ‘publish_post’, ‘wp84782_replace_author’ ); Update: This hook runs as the post is being published, not after, so … Read more

Custom loop for custom post type for current author

You can get the current user ID using $user_id = get_current_user_id(); and use the $user_id in your query. $user_id = get_current_user_id(); $loop = new WP_Query( array( ‘post_type’ => ‘html5-blank’, ‘category_name’ => ‘chapter’, ‘author’ => $user_id ) ); if ( $loop->have_posts() ) : while ( $loop->have_posts() ) : $loop->the_post(); ?> <div class=”pindex”> <div class=”ptitle”> <h2><?php echo … Read more

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