You’re doing something like this tutorial on categorizing wordpress users, correct?
I think you should do your filtering in your theme files, not on a hook. Just add an if statement to your template file (probably author.php
) that tests if your custom fields aren’t empty strings, and then do whatever (404, redirect elsewhere, throw a notice…)
Unless you need to specifically have a parameter that says whether an author is public or not (e.g. you’re planning to write a back-end user management GUI or something like that), hiding users through theme files should be the easiest way to this.
Related Posts:
- Show author archive pages for authors with no posts
- Creating distinct pages for author profiles and lists of posts by author
- Showing author’s page with no posts
- Show woocommerce products in author archive
- How to add child page to author.php
- Post list based on the page author
- Is author.php a core file?
- Most recent post is missing from Author page
- Can I Include author login in post class?
- Get 404 when try open author page
- Author Page Create Link to Page That Lists All Author’s Posts?
- Display all authors in a theme template
- How to have certain WordPress settings set by default on a per author basis
- List of all authors avatars
- can’t see information on author page that don’t have posts
- How to fix a specific page (author archive) loading speed?
- How to create many author’s page?
- Author page link in comments is different than in posts?
- if else for custom $curauth-> field
- Show the most recent post for an author on the author page
- author.php get current id of author for advance custom field
- the_author function is displaying wrong name and url
- How to check if a user (not current user) is logged in?
- Woocommerce: assign an “author” to a product
- Programatically change post author
- Restrict one post per author
- Author page: Comments and Ratings?
- Display Authors Comments on Profile Page
- Display all comments or recent comments per user on author page
- Add rewrite endpoint to author page + pagination
- Meta query interfering with orderby relevance
- filter search result with custom post type meta key
- How we can get the author ID by its Name
- How to hide posts count and posts of other users from edit.php for contributors and authors
- Can’t sort order of wp_query with 2 meta keys
- Author profile visitors in last 7 days in front end without plugins
- Using meta_query and custom fields within pre_get_posts to return posts within a numerical range
- How To Remove The Author(s) From Certain Posts
- Remove /author/ from the author profile url
- Google Authorship on a multi-author blog?
- Change author base slug to user role
- Display Author role in archive or author page
- How to Add Author Editing Capability to Existing Post by Admin
- Hide Author.php template from specific user role
- Author list ‘special’ author first then ‘normal’ author
- hide something in single page if current author has only one post
- How to set back query var author_name after unset it?
- get_the_author_meta( $field, 0 ) returns the administrator $field
- Single meta_query query using OR instead of AND in request’s WHERE statement
- How to link to the current User/Author Profile page?
- Author website URL
- How can I get the author description’s excerpt?
- How to use Buddypress xProfile field as WordPress Bio
- Using meta_query with multiple keys and compare values
- What do you put in child themes author tag?
- Make user as Default contributor for all Blog Posts
- How to list the authors of all revisions?
- Link Author’s Website in Author Bio
- Order ascending is ignored in meta query?
- How to set post author to custom post field via front-end form?
- Show Author information on post page on dashboard
- Display emails of users who already posted at least once
- Get author’s first name
- Display only author posts in dashboard all posts panel
- Get avatar of the logged-in user in WordPress
- Breadcrumbs – get the author?
- Display author name, outside the loop, if they haven’t published a custom post
- Allow Google crawler to crawl specific Author pages
- Clean links in: the_author_meta(‘description’)
- Add Date and Author to Posts
- How to restrict an author scheduling their post date to a maximum X days ahead from the current date
- Different posttypes for different authors
- Create an Author Page on Registration
- Author template help. How to check if field exists in the profile?
- Disable WordPress Comment Author Name
- Sorting search results with custom dropdown
- Condition within single.php to send an email to the post author
- Can I use pre_get_posts to add up values from two different meta_keys?
- Display Recent Posts in BuddyPress Profile
- Possible to switch between admin view and author view?
- How to show author page link
- Add Post Author body class to WordPress
- Improving Co-Authors Plus Plugin [closed]
- Show Published and Draft posts from Logged in Author
- Create condition for Author bio Social Links
- Best way to set up “reviewed by” in WordPress?
- WHen I click on post author (on frontend) it doesn’t go to author page
- wp query to use both author id and meta_query
- Custom author url and page for another role
- Show text only to the author of the article
- Display Random Post in Author Page
- Trouble with calling an imploded variable in an array
- Show author image at home page latestest posts plugin
- Sort posts in dashboard using custom field; also include posts where field isn’t set
- How do you display a comment into a mail?
- Author Link Not Displaying
- Profile Field In Admin Bar
- How to force the Author Dropdown to display in Quick/Bulk edit?
- Change get_author_posts_url / Author URL via filter
- Custom taxonomy with custom meta value is not sorting correctly (query returns the same value for orderby regardless of sort column click)