Title: PHP code in Post Author Box
Last modified: August 20, 2016

---

# PHP code in Post Author Box

 *  [raynevandunem](https://wordpress.org/support/users/raynevandunem/)
 * (@raynevandunem)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/php-code-in-post-author-box/)
 * Hi, I’m using a plugin entitled “Co-Authors Plus”, which allows for multiple 
   authors to be attached to the credits of a single post when necessary. I want
   the multiple authors to be attached through the Post Author Box as well, but 
   I’m not sure if this plugin will take PHP code alongside tokens and HTML code.
 * Here are the PHP shortcodes in question: [http://wordpress.org/extend/plugins/co-authors-plus/other_notes/](http://wordpress.org/extend/plugins/co-authors-plus/other_notes/)
 * Thanks for any answer or, if possible, solution.

Viewing 1 replies (of 1 total)

 *  Plugin Author [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * (@danielbachhuber)
 * [14 years, 9 months ago](https://wordpress.org/support/topic/php-code-in-post-author-box/#post-2274197)
 * Post Author Box is extendable, so it’s totally possible. Add this to the functions.
   php file in your theme:
 *     ```
       /**
        * Register token search values with Post Author Box
        */
       function db_add_pab_search_values( $tokens ) {
       	$tokens[] = '%coauthors%';
       	$tokens[] = '%coauthors_posts_links%';
        	$tokens[] = '%coauthors_firstnames%';
       	return $tokens;
       }
       add_filter( 'pab_search_values', 'db_add_pab_search_values' );
       /**
        * Set replacement values for specific tokens with Post Author Box
        */
       function db_add_pab_replace_values( $tokens ) {
       	if ( !function_exists( 'coauthors' ) )
       		return $tokens;
       	$tokens['%coauthors%'] = coauthors( null, null, null, null, false );
       	$tokens['%coauthors_posts_links%'] = coauthors_posts_links( null, null, null, null, false );
       	$tokens['%coauthors_firstnames%'] = coauthors_firstnames( null, null, null, null, false );
       	return $tokens;
       }
       add_filter( 'pab_replace_values', 'db_add_pab_replace_values' );
       ```
   
 * This will give you the ability to use these tokens in your Post Author Box:
 *     ```
       %coauthors%
       %coauthors_posts_links%
       %coauthors_firstnames%
       ```
   
 * Hope this helps!

Viewing 1 replies (of 1 total)

The topic ‘PHP code in Post Author Box’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/post-author-box.svg)
 * [Post Author Box](https://wordpress.org/plugins/post-author-box/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/post-author-box/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/post-author-box/)
 * [Active Topics](https://wordpress.org/support/plugin/post-author-box/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/post-author-box/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/post-author-box/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Daniel Bachhuber](https://wordpress.org/support/users/danielbachhuber/)
 * Last activity: [14 years, 9 months ago](https://wordpress.org/support/topic/php-code-in-post-author-box/#post-2274197)
 * Status: not resolved