Overwrite Author Name

Are you currently giving multiple users the same login details? If ‘yes’ then read on…

I came across the need to create a consistent author name across a site, very much like how wordpress.tv seems to be, looking from the public front end.  If you see any of the posts that wordpress.tv make its always the same author name even though all the content is obviously being provided by many different users/authors.

So in comes ‘Overwrite Author Name‘ to do a similar job for any of your sites which has multiple authors providing content but you want to have a clean authorship used across the site.  The obvious workround for this would be to give all the users (for example office staff) the same username and password details, but this is very inflexible and weakens site security.  It would be much better to allow all users to login to the site with their own access rights and capabilities and automatically change the name of the author at the time of post save and this is the reason I created the ‘Overwrite Author Name‘ plugin.

Off-course to to re-edit the post/page users will need the ‘edit_others_posts‘ or ‘edit_others_pages‘ wordpress capability respectively and likewise for any custom post types used.

You could always put something like the following code into your functions.php file..

add_action('save_post', 'overwrite_author_name');

function overwrite_author_name($post_id) {
    //this is the user name ID to be enforced.
    $enforced_author = 7797;
    //this is the post types to have an enforced user name.
    $author_post_types = array('post', 'page');
    if ($parent_id = wp_is_post_revision($post_id))
        $post_id = $parent_id;
    $post = get_post( $post_id );
    if (( $post->post_author != $enforced_author ) && (in_array($post->post_type, $author_post_types))) {
        // unhook this function so it doesn't loop infinitely due to the use of save_post within overwrite_author_name
        remove_action('save_post', 'overwrite_author_name');
        // update the post, which calls save_post again
        wp_update_post(array('ID' => $post_id, 'post_author' => $enforced_author));
        // re-hook this function
        add_action('save_post', 'overwrite_author_name');

..but that ties you into the theme, having the plugin allows you to swap themes and not loose the functionality.

I’ll be releasing to the wordpress plugin repository in the next day or so.

GitHub page.


Role Based Help Notes

"Taking Notes" - By Krissy.Venosdale
“Taking Notes” – By Krissy.Venosdale

I have published my ‘Role Based Help Notes’ wordpress plugin to the wordpress community to help groups work together in activities and content where logged in users of a wordpress site are already allocated role(s). The plugin basically allows you to quickly create helpful guides/content for any defined user role and opens up the Content Management Site (CMS) capability for your site.  This lends itself to help you talor the helpful guides/content to each separate role and allows the group to update and maintain the content.

As all people in history benefit from standing on the shoulders of giants in their field so this plugin is no different it has been given an “Extension” section to provide a quick and easy route to installing plugins that compliment Help Notes just choose those you want if not already installed on your site.  All this is possible with TGM-Plugin-Activation (by Thomas Griffin and Gary Jones.) an amazingly useful way to bundle plugins into your themes, or as I have here a plugin!

The plugin uses custom post types for user roles. This allows users, with a specific role, the ability to create and edit their own ‘help notes’ providing a private set of notes for use. It can be used for anything else that fits with that role (e.g. creating minutes-of-meetings notes etc…).
To add new roles to the basic wordpress roles (Administrator, Editor, Subscriber ..etc) you will need to use another plugin refer to Roles_and_Capabilities and Resources.. Plugins. You can then use one of these plugins (e.g. User Role Editor) to allocate users to multiple roles.

So if you want to quickly give a group a private area to share and post ideas/notes ..

  1. Create a new role.
  2. Add users to the role.
  3. Enable the Help Notes from the settings.

A global ‘General Help Notes’ type is also available which is not tided to a specific role, this has the same access/capabilities as the standard wordpress ‘post’ type for read/write access.



Helpful references used along the way..