The default category is stored in the options table under option named default_category
, so you can do something like this:
add_action('admin_init','set_user_default_cat_wpa89057');
function set_user_default_cat_wpa89057(){
global $current_user;
if ( isset($current_user) ) {
update_option( 'default_category', $current_user->user_login);
}
}
Related Posts:
- Setting Custom Sort Order of Posts within a Category
- How to change the layout and styling of posts according to their category in WordPress?
- Add default content to post (for specific category)
- Show One Category on Post
- Add custom field to category of custom post type
- Do I use custom post type or something else?
- Custom Theme Want To Remove One Category From All Displays
- Edit custom post type admin menu link
- Deleted category by mistake, all posts now have categorized category. Can i revert that?
- How can i limit the number of posts created per category?
- WordPress custom Query for Posts in Category display posts multiple times
- WordPress Multisite – Create Default Post and New Category On New Site Install
- Redirect to another page using contact form 7? [closed]
- if in category but only with post meta
- How to call posts under a specific category on static front page?
- Static pages not working
- How to display only one category in a custom post type?
- Can I style single post that are in multiple catergories?
- Custom post styling per category?
- Show custom post category for single post
- Add Categories To Custom Post
- Static text above category page
- Show a Category Specific Info Box
- Add default content to post (for specific category)
- Display ONLY Latest Post From Several Categories
- Taxonomy Category category.php not working
- Post’s arent displaying
- Only show posts belonging to multiple cateogries at same time
- I have a website issue I am trying to resolve
- How to add category to: ‘wp-admin/post-new.php’?
- How to show list of posts by author and category?
- Exclude drafts in all() view of edit.php
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Display all search results
- How to control which category will be picked for the slug of a post?
- adding a custom css class to post
- Prevent duplicate posts in wp_insert_post using custom fields
- Display most recent post in category instead of archive?
- get_post_type_archive_link(‘post’) returns current category archive
- display order of connections
- same template for multiple custom post type single
- Get user’s most published categories
- Conditional that checks if a current category has any subcategory with posts
- How to set post expiration date and time and move the page to archive after expiration [closed]
- .current-menu-item class on custom post type children pages – again?
- Display page content AFTER a loop of posts
- How to activate Markdown in a local installation of WordPress 4.3?
- Run a function when post is deleted?
- how to replace embedded “full” sized images within a post with the “large” ones
- Downgrade user from role that allows post creation
- Articles are text-only in any “Category” instead of HTML
- How To Remove Certain category Posts From the Blog Page
- Add icon/badge next to posttitle of specific category
- Get current category id from post page wordpress
- Get posts of ONE taxonomy term of custom post type
- WordPress Custom Fields (Checkboxes with multiple values)
- Saving category to a post, before publishing the post
- Custom Post Archive Page not working
- Adding buttons to Add New Post and Add New Page
- Stop users posting into category while still seeing contents of the category
- Editing the default page to show all posts, rather than most recent ones
- Add a custom meta box in the post options that loads some html code in the header
- Static posts page with home.php
- How to make multiple sections in home pulling posts category wise?
- How to get subcategories from category slug?
- Format latest/newest post differently
- Loop doesn’t exclude the specified category in home page
- Post Image not displaying in category view
- WordPress Query Posts From Category Post on Static Page
- Parent category / child category posts
- How to allow multiple thumbnail upload for Posts?
- add external project to web site wordpress on production
- Change default post style to columns
- Custom Post Type, post-formats associated to custom post type > 404 archives
- Delete post from admin but not from database
- displaying the categories post
- What’s a theme that properly handles previews of different types of posts?
- What would causes search to return incorrect results?
- WordPress – When visiting a `single post/ single.php` my category menu item link becomes active
- Tag for custom post type
- Is there a way to save different data when USER interacts with the same POST?
- How to display particular categorie’s post which associated to specific user?
- Display Specific Categories posts on the home page
- Dev and prod on the same database- dev version active for IOS
- show only one category and filter by tag
- How to delete/customize imported demo content from a theme or add my own?
- Code to display random ordered posts in Categories across pages [duplicate]
- How can I exclude only a specific sub category post from category display?
- how to print total number of posts filtered by category?
- Add category information beneath post?
- How to list all names and descriptions of a custom taxonomy
- How can I have the posts from one word press blog show on the presentation page of another word press site
- Newly created category does not show category
- Make a custom URL and link to custom Template
- Special Query: Title, Terms, Content – %LIKE%
- How to show only the date, the title and a little “summary” of my WordPress post in my custom theme?
- wordpress show category link instead of post link [closed]
- CSS – Change height of Storefront / WooCommerce product categories, but not products
- How to display my categories in a list (to a post, not the sidebar)?
- WordPress Custom Post type csv exporter