• I have a plugin which allows users to register via Twitter’s OAuth into the system as contributors. We now have quite a list of users in the system and are having a bit of an issue identifying them. The site was a port of Drupal, so initial users who had postings are no longer attributed to their content. When they register, we go back and set them to their content so they can manage it as they wish.

    What I am trying to figure out is if there is a filter I can set so that instead of showing {firstname} {lastname} in the author dropdown on the post edit page, if I can show the {username} instead.

    Anyone have any ideas if this is possible and the best approach? If it takes a quick and dirty plugin, I’m open to it – just need a good starting point.

Viewing 1 replies (of 1 total)
  • Thread Starter tsm4781

    (@tsm4781)

    I did make a hard coded change into the core of WordPress, but obviously that won’t retain as newer versions come up.

    inside /wp-admin/includes/meta-boxes.php, below this function:

    function post_author_meta_box($post) { }

    I changed

    <?php
    	wp_dropdown_users( array(
    		'who' => 'authors',
    		'name' => 'post_author_override',
    		'selected' => empty($post->ID) ? $user_ID : $post->post_author,
    		'include_selected' => true
    	) );
    }

    to

    <?php
    	wp_dropdown_users( array(
    		'who' => 'authors',
    		'name' => 'post_author_override',
    		'selected' => empty($post->ID) ? $user_ID : $post->post_author,
    		'show' => 'user_login',
    		'include_selected' => true
    	) );
    }

    Can anyone think of a way to define this outside of the core, perhaps in functions.php?

Viewing 1 replies (of 1 total)
  • The topic ‘Changing Author Output on Post Add/Edit’ is closed to new replies.