WordPress contains built in functions for quickly returning values.
They are intended to be used as a quick built in function that returns a common value to a filter hook such as true, false, or an empty array.
__return_false
— Returns the Boolean value offalse
.__return_true
— Returns the Boolean value oftrue
.__return_empty_array
— Returns an empty PHParray
.__return_zero
— Returns the integer0
.__return_null
— ReturnsNULL
.__return_empty_string
— Returns''
.
Related Posts:
- How to add some custom HTML into wordpress admin bar?
- Where is this inline CSS code [closed]
- Modify Contextual Help
- How to filter users on admin users page by custom meta field?
- How can I add an Author filter to the Media Library?
- Modify WordPress Rest Api Request/Response
- What params are available with the_content filter?
- Add wrapper to only youtube videos via embed_oembed_html filter function
- Hook into admin post list page
- Add post/page ID to inserted links within the_content
- How to exclude/filter a tag from get_the_tag_list()
- Ajax, filters and shortcodes
- Filter the blog’s title without using global variables
- wp_link_pages output appears twice
- Multiple Ajax Data Action
- user_has_cap filter allows edit but will not allow save
- Hook different functions to the same filter conditionally OR Pass additional arguments to existing filter?
- Changing a WordPress core function without hacking core
- Change WordPress RSS link with filter?
- How to remove get_post_metadata using remove_filter inside a class?
- where to apply “apply filters” and other Sanitization Functions
- Add guid filter to attachment in media library grid mode
- Sorting and limitation with pre_get_posts
- Warning: Missing argument 2 for widget_title filter
- Change term name only on front
- How do I hide the current page’s title?
- Change name of existing post status type
- add_filter(‘the_content’, ‘…’) stops pagination from working
- How can I exclude tags from category_rss function?
- Header image automatically changes depending on season
- How to remove SKU’s from ALL products in Quick View – already remove from each product page
- How do I use remove_action on an add_action that uses an array?
- How to hide Ads in between posts on AMP? [closed]
- What is the downside of using a filter as a “poor man’s” dependency injection?
- Change the default 10-day expiration for the password protected pages cookie
- BBPress changing default group activity
- How can I change the language of automated Mails?
- How can I replace an oEmbed URL in post with actual embed HTML
- Filter the_content to add something before each element?
- Replacing a deprecated filter ‘woocommerce_get_price’ with ‘woocommerce_product_get_price’
- How do you get specific tags from the_content?
- Add a filter inside an action init
- Is it possible to apply_filter on a wp_ajax_ action?
- Apply filters with multiple filters
- Filter by category and city for doctors and hospitals in wordpress
- Using add_filter to prepend content, result is out of order
- Why is overwriting $GLOBALS killing the_content()?
- Sorting products by price ( regular + sale price )
- get_posts() interrupt because of filter
- Create new custom field that calculates age
- Remove comments validation (remove filter?)
- How to query if meta_key does exist or not?
- Disable sanitize_file_name on upload without modifying functions.php
- Remove Site Name from wp_title WITHOUT removing from attribute
- Plugin default settings hook
- add_filter to the_content after apply_filters
- How to filter with dropdown in backend for custom data
- Is there any reason for the nested filters to be applied on the first case and not in the second one?
- Best practice: Custom Post Type / Filter / Load more
- How to Edit Ecommerce filters URL, h1, h2 , Title
- Redirect an archive page to its relevant URL-friendly filtered page
- How to modify image caption in posts?
- Extend Nonce Lifetime for Specific Nonce Creation
- Show uploaded pdf files dynamically and filter by month name
- how to use substr with get_the_content()
- AJAX Post Filter
- Mystery line break
- Consult array data in REST API Filter
- How to add markup to the wp-custom-header div
- How to take shortcode and content separately from a page?
- Display post after choice two taxonomy terms
- How to stop echoing gallery inside content?
- Having issue with dynamic data within restrict_manage_posts function
- how to filter datalist table of wordpress
- Ajax Filtering Pagination
- Custom permalink for attachment
- Overriding Generated Attachment Post URL
- Pagination while keeping the filters
- Is there a function to edit Blogs contents in Blogs page?
- Filter on the day of the week from timestamp
- using filters on the function from class
- Can’t set properly WordPress add_filter function
- Hook inside a hook
- Filter WordPress Archive Widget to exclude posts with specific custom taxonomy term id
- Password protected Page add_filter to change the text doesn’t work
- apply_filters to $GLOBALS
- How to filter content in Dashboard?
- Removing a line from a WP core function (comment_template.php) – filter or other technique?
- How to remove a filter that is an anonymous object?
- add_filter not adding the filter
- Add class to all parent elements inside the_content
- Is this correct usage of filters in WordPress [closed]
- get_the_excerpt on mobile still displays continue reading
- Date filter for post query not filtering results when variable outside the function
- Passing variable from filter
- Filter and Search
- Filter posts by multiple checkbox categories
- Can you call a filter hook by “add_action”?
- Why isn’t this add_filter function working as expected?
- Adding filter to the Contact Form 7 response