// 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 );
}