If you want to make the output filterable, you simply need to define a custom filter, and pass the output through it.
Your function outputs (echoes) this value:
<h1>test</h1>
If you want it to be filterable, you need to put that output in a PHP string. Instead of this:
?>
<h1>test</h1>
<?php
Do something like this:
$output="<h1>test</h1>";
Then echo it:
// Define
$output="<h1>test</h1>";
// Output
echo $output;
Now, you have something that you can pass through a custom filter, which you would define using apply_filters():
apply_filters( $filter_name, $value );
Let’s call this filter wpse140953_order_funct:
// Define
$output="<h1>test</h1>";
// Output
echo apply_filters( 'wpse140953_order_funct', $output );
…and that’s it. Now the output is filterable.
Related Posts:
- How can I edit post data before it is saved?
- How to only hook on Single.php after content?
- Change Page’s Tag Using functions.php File
- What characters are allowed as a shortcode tag and how should they be sanitized?
- Edit plugin without hooks in functions.php
- How to remove filter added by another plugin in a class
- Using add_filter inside another class
- Hide WordPress Plugin Deactivation Links
- Alter post slug by a filter that is fired just after a post is created
- Pass A Value From Outside To A Plugin Variable
- Does the ‘nav_menu_css_class’ filter accept 2 or 3 arguments?
- Very stubborn wp_register_script / add_action vs remove
- do_action and hook methods
- Remove action from a plugin class, forced to use global instance
- ElasticPress how to Include Meta to the mapping?
- remove filter which calls a public static function
- Determine plugin name from within plugin_action_links filter
- What is the purpose of $merged_filters?
- Changing image URLs in media library
- Reposition Woocommerce Message
- How to remove xmlns on language_attributes()?
- How to modify shortcode attributes with data from current post
- add_filter comment_edit_redirect not working
- Is there a filter for get_post_custom()?
- Can I hook into get_avatar to supply a hash instead of an email?
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- How to append to title via functions.php for auto-posting plugin [duplicate]
- Edit default comments page in WP Admin
- Creating a plugin to sanitize comment and the url field before display only
- How to find the origin of a file upload from within wp_handle_upload?
- Modifying the comments section through a plugin regardless of theme
- How to get the element ID from new menu list that added with add_filter()?
- Passing an array from shortcode-function to filter-function
- Get Time Taken By Each Action Hook in WordPress
- How to disable a plugin for certain page?
- WordPress user account activation
- External Script Using WP – Hooks / Actions Not Working?
- How to change the name of the “edit my profile” link in the WordPress admin backend
- add_filter doesn’t work
- Redirect to another page using contact form 7? [closed]
- Template filter for custom taxonomy terms
- Using add_action before add_filter on a plugin?
- What exactly happens to function argument availability when using a filter?
- Modify page title and subtitle with a plugin
- remove_action not removing add_action from constructor
- How to use the pre_option filter before a plugin loads?
- Override a Plugin Function
- Can I filter a function created by a theme or a plugin?
- Add a function call after content automatically?
- Hook for altering the content of all wp mails
- How to use add_action for multiple instances of the same class
- How to Use the Filter “sidebar_login_widget_form_args”
- is there a way to pass a parameter to a add_menu_page function?
- Looking for a filter to modify the months
- What’s the best way to echo out a filter variable?
- Edit post image attributes on fly?
- apply_filters(woocommerce_get_item_data, …) Causing errors when adding to cart
- Add hook after content without formatting
- How to convert Currency from USD to other IP Based currency in Php function
- post title not changing at post page
- Using OR Condition with facetwp facets
- How i remove specific script from header?
- Redirect to a page while maintaining search query parameters without causing an infinite loop
- Adding an item to an anonymous array inside a filter?
- How to use third-party SendGrid Email Validation API in Gravity Forms?
- taxonomy_template filter not working on pagination [duplicate]
- 500 Internal server error wp_handle_upload_prefilter
- Disable WC Bookings automatic order completion [closed]
- Modify function output in a plugin
- Using Filters to modify contect – DB query results alwats appear fist
- Override filter variable not working
- Customize plugin templates
- Help needed with woocommerce (wc stripe) filter
- What action or filter can I use to change all the html returned from server for a page?
- WordPress Add advertising ads befor and after content with periority [closed]
- Edit plugin filter
- trying to create simple plugin to filter categories from all authors
- How do i get all author posts on custom post type list
- How to filter a a variable in a plugin’s function?
- Retrive images from the_content()
- passing ‘&’ in return function of add_filter
- change output location of plugin function using a custom hook
- Filter for modifying image on upload
- Adding a Filter to Sidbar Login Plugin to Change Login Button Lable
- Strip shortcode from excerpt [duplicate]
- County Finder form/plugin?
- How to change response of admin-ajax request?
- add query string to all pages after user logged in
- WordPress plugin add_filter returning a link does not work. What is the correct way?
- Order shipped by which driver[hook for woocoomerce order staus changed and popup in admin panel ] [closed]
- Unable to pass arguments from plugin form to filter hook using ajax, the data is transferring via ajax but unable to pass as arguments in filter hooks
- How often should I execute add_filter and function declaration in Code Snippets?
- WordPress REST API filter on blank custom ACF
- Selectively override Easy Digital Downloads protection via filter
- Brands Filter Not Working For On Sale Products
- Removing filters with arguments set in a class
- is_singular() in mu-plugins not working
- Remove wpseo filter from polylang plugin
- How to display title, description etc in block images?
- How to customize WP_Error (REST JWT authentication plugin) [closed]