function admin_trim_category_description( $terms, $taxonomies ){
if( 'category' != $taxonomies[0] )return $terms;
$whatever_categories = array('category1', 'hidden', 'category2', 'category3');
foreach( $terms as $key => $term)
if(!in_array($terms[$key]->name, $whatever_categories)) $terms[$key]->description = strip_tags(substr( $term->description, 0, 75 ))."...";
else unset($terms[$key]);
return $terms;
}
Related Posts:
- Upload Multiple Files With media_handle_upload
- What is this code in my theme’s functions.php? if (isset($_REQUEST[‘action’]) && isset($_REQUEST[‘password’])
- Most elegant way to enqueue scripts in function.php with foreach loop
- Copyright info change in Theme Child PHP
- VERY new to coding – keep breaking site trying to add to functions.php
- Problem with tag
- write in functions.php
- Add footer.php to WordPress child theme
- Pinterest Integration Using functions.php
- Successful or Error Message after running mysql code in functions.php
- Date/time limitation of posts where function must be executed
- Completely disable RSS feeds on WP 5.5.2 and show a 404 page instead of die();
- Woocommerce Attributes pulling in wrong data
- Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ‘greenday_head’ not found or invalid function name
- Log in / Log Out Custom Button
- How to run a function in every page, every device
- Display Data in Table from External Database in WP using Shortcodes
- How i can put $_GET codes in function.php?
- Numbering lines of code with the tag?
- If no author posts, echo out some text
- Need help for some PHP code
- Save Meta when custom Taxonomy Saves
- remove edit link only for published post and pending post
- How to preload header logo image in WordPress? like what’s the code and where do I put it?
- Adding a schema code to one specific page using functions.php file
- How to put 2 php codes in functions.php without site crashing
- How set a while with a function
- Drop down list code for sidebar
- Some code is added automatically to my site’s header – what is it?
- How to include a hyperlink in the body text of a custom password protected form?
- Display most popular posts
- Remove Featured Images from Posts Older Than a Certain Date
- It possible to implement an adhoc php web application with wordpress?
- WP supersize not displaying when different languages flags are selected
- How to get tags and categories?
- How to add a class name to the ancestor of a post?
- Way of getting queried loop before the query with a filter hook?
- Code in functions.php appearing on front-end and dashboard [closed]
- I want to add the alt attribute to all the photos!
- Bad value crossorigin for attribute crossorigin on element link
- Text before price on WooCom
- Convert Image to Webp on upload without plugin
- how to create twitter card without plugin in wordpress website?
- Why use if function_exists?
- Use AJAX in shortcode
- Include files in child theme functions file
- WordPress Theme Update Action?
- How to get woocommerce inventory status [closed]
- How to call a function only once (global variable scope)
- Implementing DNS Prefetching with WordPress
- Why do I get Fatal error: Call to undefined function get_most_recent_post_of_user()?
- display 100 products per page on product category page [closed]
- Checked() showing up twice in custom fields
- Gravity Forms field entries into wp_query loop [closed]
- Remove the deleted users avatar from list
- Update Content based on expiration time or queued processing
- Hide wordpress field if data is empty in post!
- Adding to fontawesome-webfont.woff2 to boost website speed
- How to enable template page only for a post id page
- Two Different Links for Same Product – WooCommerce [closed]
- WordPress wrapped added a span tag to every single p tag
- Remove after images
- Modify custom field input data before creating a new post
- Get First Child Page ID or Permalink in WordPress Admin
- Removing specific menu items?
- Do I need to use wp_reset_postdata for my function?
- Is it possible to return content, and then also continue to do other things?
- Checking the count within a foreach loop
- Use a shortcode to display custom meta box contents
- how to make has_block() see inside blocks too
- add_theme_support( ‘title_tag’ ) is not showing title on index.php
- Tracking the number of shortcodes for a list?
- How to call custom function outside from the admin page?
- Reject all malicious URL requests functions.php
- When are the user meta fields created in the database? Admin vs Woo API REST
- front end editor creation for Restropress plug in – displaying information from a WP admin area, on a different URL
- is_product_category(‘Services’) not working
- How to automatically add counted number to navigation menu items?
- How to access custom class methods from any include without using global
- How to override WooCommerce Order Item Meta with data from Cart?
- Insert Modal on user first login
- What is best practices to move the following code into a function?
- Correct way of Enqueue self hosted fonts in sass project
- function syntax is off,
- wp_enqueue_script only works outside of action
- How can I include user meta information in the resulting array of a WP_User_Query?
- How to add next height number in Order Attributes inside the Add new page. [duplicate]
- Show the online status of the current post’s author
- Get Value of Custom Field
- Can anyone tell me why I can’t edit a plugin when it is installed without having to re-install?
- Break a WordPress function to run in patches and re-continue
- How does child theme functions.php work with parent theme functions.php? Is it like CSS? [duplicate]
- restrict access to specific urls on a specific period of time
- Need a functions that adds (adm)/(mod) if current user is admin/moderator right after their username
- Add title & subtitle to shortcodes
- clickable title of 2 post on mainpage USING functions.php
- Custom Post Type Search
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- How do i set global variable in a function in wordpress functions.php
- How to pass value to add_filter wpcf7_form_tag from another function?