You should be using add_filter( ... ), not apply_filters( ... ):
/**
* Filters the life span of the post password cookie.
*
* By default, the cookie expires 10 days from creation. To turn this
* into a session cookie, return 0.
*
* @since 3.7.0
*
* @param int $expires The expiry time, as passed to setcookie().
*/
add_filter( 'post_password_expires', 'wpse_custom_post_password_expires' );
function wpse_custom_post_password_expires( $expires ) {
return time() + 30; // Expire in 30 seconds
}
Related Posts:
- Editing ‘Password Reset’ E-mail
- How to apply the “retrieve_password_message” filter?
- How can I detect if a user changes their password?
- How to change/rewrite the lost password url?
- Change Password Strength Indicator names?
- How can I change the email that is inside the default email texts of wordpress?
- Prevent reset password specific user role
- What is the action hook to use if you want to capture the new password during password change?
- Which Filter Do I Use To Modify The Subject Of The Retrieve Password Notification Email?
- Better way to change the default password reset url with the woocommerce one?
- Change password reqts with NO plugin without breaking resetpass link?
- Insert HTML just after tag
- the_content and is_main_query
- How to Pass External Variables to Filters/Actions
- How to pass/get data to/from the WooCommerce data-product_variations object?
- Filter username field on registration for profanity and unwanted words
- At what priority does add_filter overwrite core functions?
- Add whitespace between Chinese and other letters
- How to add icons to post listing (edit.php) in admin
- Tiny MCE editor stripping xlink:href parameter from SVG USE tag
- Translating an error message
- Keep Users Logged In As Long As I Like
- Is it possible to remove the filter from 4.8 text widget?
- Display WooCommerce newest product reviews on top [closed]
- Overriding wp_get_archives() apply_filters()
- How to make post and comment count unclickable with dashboard_glance_items hook
- Call to undefined function error after adding add_filter to wp-config
- How to remove X-Frame-Options: SAMEORIGIN” from WordPress?
- Add Dropdown menu using “add_filter => wp_nav_menu_items”
- Filtering ‘the_title’ with option to return subhead?
- How to add a custom filter in functions.php
- Setting title using wp_title filter
- What functions are included in apply_filter(‘the_content’)
- Filtering admin entries for custom post type
- What hook/filter can I use to add/edit/show/hide the title under (on hover) links on the table view?
- option_active_plugins filter not working
- How do we check if the user is logging in or registering?
- Anonymous function is executed twice in wp_head while added from the_posts filter?
- add_filter return value
- Why my admin doesn’t work after adding rest_prepare_post filter?
- How to make a button?
- How do I filter title and alt attributes in the gallery shortcode?
- remove_action in plugin file
- Filter get_template_part() $args array
- Modify a Filters Second Parameter
- Filtering post-formats from the loop using new WP-Query();
- Insert term when page is published – avoid duplicates after edits
- Filter Media by Featured on Admin
- How to add a filter to get_the_author_meta?
- page_attributes_dropdown_pages_args filter does not work
- What different ways can a plugin add a filter to a WordPress site?
- Access get_the_title() from ‘excerpt_length’ filter
- Wrong post_status notice after wp_insert_post_data
- BBPress changing default group activity
- Comment search plugin
- add img class to native wordpress galleries
- Get Posts updated or published within the last x hours
- How to get a single hook from wp_head()?
- WP filter to alter admin CSS styles?
- preview_post_link for Custom Post Types
- Filter an array with a callback – for single & multidimensional arrays
- Detect when gutenberg editor title is available in Dom after editor load
- Why this filter hook is not working when passing parameters?
- Are href attributes of a elements filtered on output to add the current path?
- Add a filter to an action [closed]
- Change the template when the user is not logged in using page_template filter (it does not work)
- Regarding post text filtering
- Add Filter not working with get_posts
- How to Prevent WordPress to encode html in post?
- Why template_include filter does not work with WPML plugin?
- Filter posts by meta data using custom query
- Most performant/functional way to add actions/filters?
- Making an add_filter() call from within an add_filter() call
- Filter causing loss of _wp_attachment_metadata
- Action hook to control access to certain parts of my site
- Finding actual functions added to hooks and filters
- How to apply filter on get_the_post_thumbnail()
- How can I tranlslate post date in italian?
- Use alternative front page if cookie is set
- How do I check if I can use the allowed_block_types filter?
- Having wp-admin on different domain
- Use a functions in functions.php to remove a string for template theme
- Setting the page title in a plugin, but not outside my plugin
- how to output HTML tags in post_content and not as plain text
- Security question – Display a General Custom Login Error Message
- Add filter conditionally to a page
- How to apply a filter to everything?
- WP Job Manager – display search results from custom search form in taxonomy-job_listing_category page
- Conditionally (cpt) filter previous and next_post_link
- changing size image within the content
- Remove action added from class
- Identify admin/logout and more filters
- Sanitizing a custom query’s clauses
- How can I display wp_link_pages before a shortcode, if it is used, or display after content?
- How to create a list of terms who’s posts also have a predefined external term?
- Limit total tags in the_content
- Change or replace user_profile_picture_description filter, to stop stripping whitespace
- remove_function method removing next priority action too while removing current priority
- How to add custom field to top of WordPress Comment Form for both logged in and anon users
- Insert selection from filter everything pro into gravity forms field