// remove the delete link for the specific category
function category_row_actions( $actions, $tag ) {
if ( $tag->term_id == PROTECTED_TERM_ID ) unset( $actions['delete'] );
return $actions;
}
// create the category if not excists (in case it's removed again in another theme)
if (file_exists (ABSPATH.'/wp-admin/includes/taxonomy.php')) {
require_once (ABSPATH.'/wp-admin/includes/taxonomy.php');
if ( ! get_cat_ID( 'One page' ) ) {
$onepage_cat_id = wp_create_category( 'One page' );
define( 'PROTECTED_TERM_ID', $onepage_cat_id );
}
}
// make sure PROTECTED_TERM_ID is defined for the filter
if (!defined('PROTECTED_TERM_ID')) {
$idObj = get_category_by_slug('one-page');
$onepage_cat_id = $idObj->term_id;
define( 'PROTECTED_TERM_ID', $onepage_cat_id );
}
if ( is_admin() ) {
add_filter( 'category_row_actions', 'category_row_actions', 10, 2 );
}
Related Posts:
- List all subcategories from category
- Get category ID from category slug (not working)
- How do I remove “Uncategorized” from posts with more than 1 category?
- Remove parent category from permalink? Basically only have the child category?
- Control term order on a per-post basis
- Filter by post category in Media Library
- Changing Top Level Items into Radio Buttons in the Categories Meta Box?
- Custom post types with their own permalink structure
- Display all posts in category, with specific tag posts at top
- Send an email when custom post type category is changed
- How to Set an Individual Homepage for Each User?
- Display the deepest child category from Category X (in loop)
- When using get_categories or similar, is it possible to filter results that contain certain Tags as well?
- Exclude subcategories from the url
- Why adding Categories does not auto refresh in Backend while using my custom theme?
- Select category in custom query
- Removed slug from CPT, now How/where do I hook the filter to the taxonomy term archive pages link?
- Remove specific category from a post
- Search by word, category, tag, author
- How to hide certain categories in wordpress dashboard?
- How to filter archives both by category and tag?
- How to retain the values from dropdown category lists after wrong form submission?
- How i can let users add notes to my posts
- Woocommerce – Get product category 2nd level category
- Hide post meta data on a specific category
- How can I get an tag to wrap each ancestor that gets outputted in this condition?
- How to prevent empty category to list content of sub categories?
- Single_cat_title() print the title before text
- Sort posts by post_type in category.php template
- Why would in_category only return one post in a specific category?
- Is it possible to have WordPress not recognize category URLs?
- Disallow categories from this MySQL query
- Use a wordpress page to display a certain category
- getting content from main domain to sub-domain using category and WP_Query
- Force a user’s posts category
- How to list child categories?
- Checking for two categories in query_posts
- get_the_categories filter returns an empty array
- Creating gallery with taxonomy images plugin?
- Full text articles in the rss feed (i.e. without the more tag)
- Solution for ascending order in a category
- Restoring default article pagination on archives – Removing custom limits
- Show category to visitors in different name or different language without changing basic category
- how to get child category title and image
- How to get latest posts from each category in regular order
- How many categories can WordPress handle before performance suffers?
- Show Posts from Single Category Not Working
- How to pull a list of posts in a category while exluding posts in subcategories of the category
- Exclude category from query
- Functions.php: Exclude Category from “Blog”
- Use premade array as categories in wp_query?
- How to loop custom post_type from (a) specific category(ies)?
- Category images are not displaying in WordPress
- Display posts of certain categories to specific user roles
- How to restrict category creation to admins only while allowing editors to still pick category
- Show child taxonomies (that have posts) of the current parent taxonomy
- Query (built in) Categories and Advanced Custom Fields?
- Get next post in same category not working WP 4.7.4
- How do you use the featured image of the most recent post in a category as the background image
- Filter By Category Dropdown List With Custom Taxonomies
- query_posts by category_name and custom taxonomy
- Add code to header based on category for specific posts?
- How to only show parent categories in sidebar
- Change RSS format for specific categories
- Can I prioritize post categories for choice for breadcrumb trail?
- Displaying a custom field in Category Archives
- Custom Portfolio Page
- Custom Fields Value As Taxonomy
- create function to call category name and slug
- Redirect Problems with Archive Page and GET variables
- Different size video display for category page (smaller) & detail page (larger)
- Adding tinymce to Custom Field boxes on Category edit page
- Disable Category Taxonomy
- How do you get sticky posts to work with categories?
- A different permalink structure for different categories
- How to make product image inherit from category image
- Is it possible to set up blog categories without changing permalink structure
- How to display categories image in loop homepage WordPress
- Display the articles of a category by role
- Remove “Category:” from Post meta
- How to “remove” WordPress categories UL and make the list loop in a horizontal line?
- How do I rewrite a single category link to point to a custom page?
- Add subcategories posts to the counts column at the admin’s categories list
- Default category isn’t saved in database
- Dynamically creating content on custom URL without getting 404
- Display related posts with same category or same tag return blank
- Get posts from 2 or more categories
- Category foreach Paging
- date.php shows all posts. how to fix it?
- Help with Wp + Mixitup code
- One category not displaying template updates
- How to display only category of blog without custom code?
- Matching usermeta at registration to categories of content
- How do I hide posts in a category from all listings but still allow the posts to be viewed?
- Form Value of drop down category + Translation of ‘show option none’
- show posts from some category and sort by advance custom field
- How to show monthly archive posts?
- How to display posts by author in a separate page, other than author.php?
- One color to category link depending on category ID
- Images as Categories