{"id":23499,"date":"2013-05-23T20:29:07","date_gmt":"2013-05-23T20:29:07","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/authors-autocomplete-meta-box\/"},"modified":"2013-12-02T17:10:38","modified_gmt":"2013-12-02T17:10:38","slug":"authors-autocomplete-meta-box","status":"closed","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/authors-autocomplete-meta-box\/","author":5949465,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.2","stable_tag":"1.2","tested":"3.6.1","requires":"3.3","requires_php":"","requires_plugins":"","header_name":"Authors Autocomplete Meta Box","header_author":"Rachel Carden","header_description":"","assets_banners_color":"b1b3ac","last_updated":"2013-12-02 17:10:38","external_support_url":"","external_repository_url":"","donate_link":"https:\/\/www.paypal.com\/cgi-bin\/webscr?cmd=_donations&business=bamadesigner%40gmail%2ecom&lc=US&item_name=Rachel%20Carden%20%28Authors%20Autocomplete%20Meta%20Box%29&currency_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted","header_plugin_uri":"http:\/\/wordpress.org\/plugins\/authors-autocomplete-meta-box","header_author_uri":"http:\/\/www.wpdreamer.com","rating":5,"author_block_rating":0,"active_installs":100,"downloads":4813,"num_ratings":5,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":{"1.2":"<ul>\n<li>Added ability to run custom user search via filter.<\/li>\n<li>Added support for Internationalization.<\/li>\n<li>Added Spanish translation with help from Andrew Kurtis from WebHostingHub Support.<\/li>\n<li>Added support for custom post type author capability testing.<\/li>\n<li>Renamed the CSS and Javascript file.<\/li>\n<\/ul>","1.1":"<ul>\n<li>Updated author capability testing from user level to user capabilities.<\/li>\n<li>Added ability to change author capability via filter.<\/li>\n<li>Added ability to remove users from autocomplete results according to user id.<\/li>\n<li>Added ability to remove users from autocomplete results according to user role.<\/li>\n<\/ul>"},"ratings":{"1":0,"2":0,"3":0,"4":0,"5":4},"assets_icons":[],"assets_banners":{"banner-772x250.png":{"filename":"banner-772x250.png","revision":"717558","resolution":"772x250","location":"assets"}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1","1.2"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":"723712","resolution":"1","location":"assets"}},"screenshots":{"1":"The Authors Autocomplete shows the author's display name, login and email address to help you select the correct author. Once selected, the author's gravatar is displayed to the left."},"jetpack_post_was_ever_published":false},"plugin_section":[],"plugin_tags":[132,4956,754,3226,3007],"plugin_category":[],"plugin_contributors":[80611],"plugin_business_model":[],"class_list":["post-23499","plugin","type-plugin","status-closed","hentry","plugin_tags-author","plugin_tags-authors","plugin_tags-auto","plugin_tags-autocomplete","plugin_tags-complete","plugin_contributors-bamadesigner","plugin_committers-bamadesigner"],"banners":[],"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/authors-autocomplete-meta-box_b1b3ac.svg","icon_2x":false,"generated":true},"screenshots":[{"src":"https:\/\/ps.w.org\/authors-autocomplete-meta-box\/assets\/screenshot-1.png?rev=723712","caption":"The Authors Autocomplete shows the author's display name, login and email address to help you select the correct author. Once selected, the author's gravatar is displayed to the left."}],"raw_content":"<!--section=description-->\n<p>Replaces the default WordPress Author meta box (that has an author dropdown) with a meta box that allows you to select the post's, or page's, author via Autocomplete.<\/p>\n\n<p>Can really come in handy if you have a lot of authors and are tired of scrolling through that long author dropdown.<\/p>\n\n<h3>Credits<\/h3>\n\n<p>Big shoutout to <a href=\"http:\/\/www.ereleases.com\">ereleases.com<\/a> for commissioning this plugin and letting me share it with the community. Thanks, guys. You rock!<\/p>\n\n<p>Lots of thanks to Andrew Kurtis from WebHostingHub Support for providing the Spanish translation.<\/p>\n\n<h3>Filters<\/h3>\n\n<p>Filters can really come in handy to nail down specific customizations on a site by site basis. I am what you would consider a power user so I'm a big fan of actions and filters and try to incorporate them into my plugins as much as possible. Here are some pretty helpful filters to get your authors autocomplete meta box working just the way you like.<\/p>\n\n<h4>authors_autocomplete_mb_allow_user_id<\/h4>\n\n<p>This filter allows you to block users from the autocomplete results according to user id. Return <em>true<\/em> to allow and <em>false<\/em> to deny.<\/p>\n\n<p>It passes the user id, along with the post ID and post type. <strong>Don't forget:<\/strong> when using a filter, you <strong>MUST<\/strong> return something. Here's an example to help you get started:<\/p>\n\n<pre><code>&lt;?php\n\n\/\/ return *true* to allow the user and *false* to deny the user from autocomplete results\nadd_filter( 'authors_autocomplete_mb_allow_user_id', 'filter_authors_autocomplete_mb_allow_user_id', 1, 4 );\nfunction filter_authors_autocomplete_mb_allow_user_id( $allow_user_id, $user_id, $post_id, $post_type ) {\n    if ( $user_id == 4 )\n        return false;\n    return $allow_user_id;\n}\n?&gt;\n<\/code><\/pre>\n\n<h4>authors_autocomplete_mb_allow_user_role<\/h4>\n\n<p>This filter allows you to block users from the autocomplete results according to user role. Return <em>true<\/em> to allow and <em>false<\/em> to deny.<\/p>\n\n<p>It passes the user role, along with the post ID and post type. <strong>Don't forget:<\/strong> when using a filter, you <strong>MUST<\/strong> return something. Here's an example to help you get started:<\/p>\n\n<pre><code>&lt;?php\n\n\/\/ return *true* to allow the user and *false* to deny the user from autocomplete results\nadd_filter( 'authors_autocomplete_mb_allow_user_role', 'filter_authors_autocomplete_mb_allow_user_role', 1, 4 );\nfunction filter_authors_autocomplete_mb_allow_user_role( $allow_user_role, $user_role, $post_id, $post_type ) {\n    if ( $user_role == 'administrator' )\n        return false;\n    return $allow_user_role;\n}\n?&gt;\n<\/code><\/pre>\n\n<h4>authors_autocomplete_mb_author_capability<\/h4>\n\n<p>When checking to see if a user has author privileges, and should therefore be included in the autocomplete results, the plugin checks the user's capabilities. If the user is editing a page, then the user is added if they have the capability to <em>edit_pages<\/em>, otherwise the user is added if they have the capability to <em>edit_posts<\/em>.<\/p>\n\n<p>If you would like to change the author privilege capability, then this filter is for you. It passes the default capability, along with the post ID and post type. <strong>Don't forget:<\/strong> when using a filter, you <strong>MUST<\/strong> return something. Here's an example to help you get started:<\/p>\n\n<pre><code>&lt;?php\n\/\/ changing the author capability according to post type\nadd_filter( 'authors_autocomplete_mb_author_capability', 'filter_authors_autocomplete_mb_author_capability', 1, 3 );\nfunction filter_authors_autocomplete_mb_author_capability( $author_capability, $post_id, $post_type ) {\n    if ( $post_type == 'movies' )\n        return 'edit_movies';\n    return $author_capability;\n}\n?&gt;\n<\/code><\/pre>\n\n<h4>authors_autocomplete_mb_custom_user_search_user_ids<\/h4>\n\n<p>Want the autocomplete box to search information besides the default user_login, display_name and user_email? This is the filter for you.<\/p>\n\n<p>Use this filter to run whatever search you like and simply return the user IDs from your results.<\/p>\n\n<p>It passes a blank array to get you started, the search term, post ID and post type. <strong>Don't forget:<\/strong> when using a filter, you <strong>MUST<\/strong> return something.<\/p>\n\n<p>Here's an example from me helping a user search their <a href=\"http:\/\/wordpress.org\/plugins\/cimy-user-extra-fields\/\">CIMY User Extra Fields<\/a>:<\/p>\n\n<pre><code>&lt;?php\n\/\/ search CIMY User Extra Fields with search term and return user IDs\nadd_filter( 'authors_autocomplete_mb_custom_user_search_user_ids', 'authors_autocomplete_custom_user_search', 1, 4 );\nfunction authors_autocomplete_custom_user_search( $user_ids, $search_term, $post_id, $post_type ) {\n   global $wpdb;\n   return $wpdb-&gt;get_col( \"SELECT users.ID, cimy_uef_data.VALUE FROM $wpdb-&gt;users users LEFT JOIN {$wpdb-&gt;prefix}cimy_uef_data cimy_uef_data ON cimy_uef_data.USER_ID = users.ID WHERE ( cimy_uef_data.VALUE LIKE '%$search_term%' OR users.user_login LIKE '%$search_term%' OR users.display_name LIKE '%$search_term%' OR users.user_email LIKE '%$search_term%' ) ORDER BY users.ID ASC\" );\n}\n?&gt;\n<\/code><\/pre>\n\n<!--section=installation-->\n<ol>\n<li>Upload 'authors-autocomplete-meta-box' to the '\/wp-content\/plugins\/' directory.<\/li>\n<li>Activate the plugin through the 'Plugins' menu in WordPress.<\/li>\n<li>Start finding and selecting a post or page's author like a boss.<\/li>\n<\/ol>\n\n<!--section=changelog-->\n<h4>1.2<\/h4>\n\n<ul>\n<li>Added ability to run custom user search via filter.<\/li>\n<li>Added support for Internationalization.<\/li>\n<li>Added Spanish translation with help from Andrew Kurtis from WebHostingHub Support.<\/li>\n<li>Added support for custom post type author capability testing.<\/li>\n<li>Renamed the CSS and Javascript file.<\/li>\n<\/ul>\n\n<h4>1.1<\/h4>\n\n<ul>\n<li>Updated author capability testing from user level to user capabilities.<\/li>\n<li>Added ability to change author capability via filter.<\/li>\n<li>Added ability to remove users from autocomplete results according to user id.<\/li>\n<li>Added ability to remove users from autocomplete results according to user role.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>Plugin launch!<\/li>\n<\/ul>","raw_excerpt":"Replaces the default WordPress Author dropdown with a meta box that allows you to select the author via Autocomplete.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/23499","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=23499"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/bamadesigner"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=23499"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=23499"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=23499"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=23499"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=23499"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=23499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}