I am not sure this a WordPress question. It is really more just bad PHP but since that is a filter, in the spirit of fostering good will…
Your function is return
ing a variable-name function that doesn’t exist, and none of your operations are saved at all. You are processing the string but you aren’t keeping the changes. You need to assign the results to a variable. And, you aren’t feeding the function any information to start with.
$text_excerpt = "test";
function vs_trim_excerpt($text_excerpt) {
$text_excerpt = trim($text_excerpt);
$text_excerpt = ucfirst($text_excerpt);
$text_excerpt = wordwrap($text_excerpt, 150);
return $text_excerpt;
}
echo vs_trim_excerpt($text_excerpt);
That should work better.
Related Posts:
- Allow HTML in excerpt
- Metabox repeating fields – radio buttons not saving correctly
- How to return the_excerpt (without echo)?
- Why is my custom meta box input not saving
- add_meta_boxes action with refresh on save
- Save selected item from dropdown menu in a meta box as a metadata value for a custom post type
- Limit the_excerpt with max of x characters
- Second select list values are not saved after clicking update
- Remove at the beginning of the_excerpt() with str_replace
- Automatic Excerpt Not Working
- Trim first 2 words of the exceprt
- Extremely slow pageload for long post when using the_content?
- Why does running get_the_excerpt() when generating JSON file take 28 seconds vs. 599 milliseconds without it?
- Excerpt unwanted text “”
- Word Count Function Preventing Permalink Editing
- wp_editor and WPAlchemy messes up tags when updating
- Custom excerpt function re-factoring
- How to Display a Single Post Excerpt
- How to remove the excerpt in the Dzonia Lite theme
- How do I Add HTML to the_excerpt() & the_content() Output?
- How to select the contents in the text view textrea in wp_editor?
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Image media upload metabox
- Mass update excerpt
- Linking text within textarea of custom meta box
- How to put “Read more” link in Custom Excerpt inside p tag?
- Error when adding excerpt to the content through functions.php
- Need Help Fixing My Iframes [closed]
- Remove metabox from WordPress menu editor page?
- MetaBox body is not showing (the callback function)
- Query Pages and post excerpts dynamically
- Trying to retrieve post meta
- can i fetch a custom metabox data in another page or post type?
- My custom get_the_excerpt() can’t get excerpt by ID
- Limit checklist by the current user
- Adding Meta Tags to a Post using its Tags, Excerpt and content
- How to convert select to HTML with PHP tags inside of it [closed]
- Sanitizing text fields in array
- Saving zero in meta box
- Show meta box only for default page template
- Illegal string offset in PHP function
- Find a way to retrive data updated through metabox plugin to web page
- Why does this update_post_meta function not delete the custom field itself?
- How to show an entire post content and not also the excerpt?
- stripping tags from excerpt in WordPress is not working
- meta box not display data input in the textarea
- Almost Done… Post Format Code
- Usage of call back function of add_meta_box()
- Automatic excerpt is not shown with the_excerpt() command
- How to store multiple custom meta box
- Show metabox only for homepage
- Add editor toolbar to Metabox
- Remove   from the_excerpt
- Shortcodes showing in excerpt despite using strip_shortcodes
- How to remove the space before the ellipsis in excerpt?
- Need help removing […] after excerpt
- Warning: call_user_func() expects parameter 1 to be a valid callback, function
- How do I make this Metabox show current DB value?
- Unable to Call More than One Meta Box Output
- Assign Custom classes to every Excerpt
- Post meta select input, if statement
- Display background color or image with custom meta box?
- Meta boxes only displayed when editing normal (default wp post_type) posts
- Problem in replacing the_content with the_excerpt()
- Add a Metabox checkbox to the Page Edit screen of wp-admin , which only certain roles can see and Makes only certain roles able to Edit said page
- Checkbox doesn’t save inside metabox
- Dropdown category field inside repeatable metabox
- Display metabox galleries on specific page template in admin editor
- Find and print first entry from WordPress post in custom excerpt?
- add ‘publish metabox’ to Gravity forms edit page/form area
- Trying to modify content.php
- Unable to update the meta boxes with multiple fields
- Meta Box clears saved field content
- Get value of submit button in custom post type
- Metabox – Displaying the Value of a Metabox
- How to trim content AND retain HTML?
- How to apply filter
- Custom fields changes the formatting of metabox input
- Inline Styling a div from a Custom Metabox
- Archive page if else not working for post_excerpt and post_content
- Custom meta box save values issues – Deprecated: Function ereg() and more
- custom field meta-box with dropdown/autocomplete
- Save data of select list after clicking save
- Repeatable field within repeatable group of fields
- Help with my first Metabox helper class
- Custom Meta Boxes and Fields Multicheck Issue
- If custom field doesn’t exist, or exists and it’s true show title?
- Hide sharing box and author box with a metabox on WordPress
- How to callback custom field text
- Where can I find the code for the menu page meta boxes?
- Custom Meta Box If Else Statement
- How can I add more code to this?
- PHP Puzzle: Unique Styles with PHP loop
- Merging two excerpt functions to work with conditions
- Display custom meta box in my template file
- send meta box input data without publish button
- Excerpt all post content Content Same Size without word cutting off
- REST API custom endpoints for metaboxes
- Save Edit button then disabled readonly metabox
- generate excerpt from the part of big text dump that contains keyword