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?
- Add custom css to specific user
- change the url paths in the stylesheet dynamically
- What WordPress function to use to get meta value by using meta keys?
- Use third party Library in wordpress
- When sale price is 0.00 show only regular price
- Custom shortcode outputs plain text instead of HTML at top of post
- how can i use $_COOKIE[] + PostID to execute the below code?
- Return a numerical function value in Customizer controls
- 404 redirect to previous category
- getting logged in user info (wp-load.php) from parent directory
- Nested shortcode functions accessing variable
- Remove the product category module block from the Woocommerce product page
- Force to use STRONG users password and implement rule to prevent REUSE [closed]
- How can I get the values of my WordPress $wpdb query in Jquery?
- Function wont fire after custom post type is updated
- Removing custom meta data
- show first 3 thumbnails of posts in different sizes [closed]
- What’s the uses of wp_cache_set() or wp_cache_add()?
- Where to start learning more about wordpress templates [closed]
- How to call WordPress function other files
- What did I do wrong in my functions code, that will not change the “Get New Password” text to “Send It”?
- Custom Post excerpt not working correctly
- how can I edit flexslider in woocommerce. [Urgent]
- Get users that likes the post
- How do I create a function that simulate the click on Update button for all posts?
- Sections and tabs DRY – WordPress settings API
- Blog posts repeat
- Remove after images
- wordpress search word, “hello world” ===> ‘hello+world’ ===> ‘hello’, ‘world’
- Login Redirect if Logged in from Specific Page
- Ajax load more button for comments wordpress
- Custom Nav Walker sub-menu
- Unable to login using username
- Is there an alternative to get_template_directory_uri()?
- How to fetch the name of the active menu?
- Word Press – Dynamic Content [closed]
- Function to capture a value and store it in a variable
- How to abort saving data in save_extra_profile_fields function WordPress?
- How to change the order of Jquery in the footer of my theme?
- get_next_posts_link not working without parameter max_num_pages
- How can I make a widget shortcode to control all the widgets?
- Pass php dynamic variable to shortcode
- create filter in functions.php
- admin-ajax.php + load-scripts.php hanging for minutes
- Including a specific Javascript Script in a template. Is my code correct?
- Change label for registration Fields
- Logout Shortcode URL
- Warning: : DOMDocument::loadHTML(): Empty string supplied as input in functions.php when adding classes to post images
- Unique icons next to each WordPress menu item
- 3 Slashes appear after Apostrophe in custom fields after updating product-site
- All sites themes functions.php have been changed
- How to create a php variable using WordPress the_title() function
- Remove stylesheets from Campaign Monitor plugin
- Add Custom Background Properties to Customizer
- Limit length of first excerpt in the loop
- Custom shortcodes not inserting into visual composer columns
- Keyword checking in Gravity Forms