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?
- How to add defer=”defer” tag in plugin javascripts?
- How do filters and hooks really work in PHP
- Trouble understanding apply_filters()
- How would one modify the filtering Gutenberg applies to pasted content?
- Gutenberg: Is there a way to know if current block is inside InnerBlocks?
- How to reorder billing fields in WooCommerce Checkout template? [closed]
- How to wrap oEmbed-embedded video in DIV tags inside the_content?
- How to add filter with 2 args?
- WordPress Internal @ Mentions
- Filter translations (gettext strings) on specific admin pages
- Is it possible to use object in add_action?
- Filter hook before create order WooCommerce
- Add Class to Specific Paragraph of the_content()
- apply_filters() slices away needed arguments
- Search content for shortcodes and get parameters
- How to override the email function by using filters? [closed]
- Remove WPML’s home_url filter
- Apply the_title filter to post titles AND backend auto social-sharing plugin, but not nav menu
- How to add attributes to tag when template cannot be directly modified
- Edit pagination text in the get_the_posts_pagination function
- How does WordPress call functions attached to a certain action hook before calling functions attached to other hooks
- How to get current action?
- How to check if “media_send_to_editor” is audio?
- Changing Order of Filters
- how to change appearence of the content of default post list columns?
- Use safety filters even if after applied intval?
- Modify site URL via functions.php of a theme
- Passing variable from child theme to parent theme
- When adding buttons to the tinyMCE editor, how do I make them wrap to the next line and/or display in the “Kitchen Sink” area?
- How to change the order (priority) of registered filters (or actions) (e.g. for the_content)?
- How to change the order of HTML output of a core block?
- How to add ‘total’ value to custom column title on the posts list page
- Create Page Template by hook programatically in Functions.php in WP 5.8.1
- Remove Content Filter
- views_edit-post filter not working (custom post type)
- Building a request processor for multi-page forms, etc using $_GET requests
- How to know what filter to use and how to use it?
- Replace audio links with jplayer using the_content filter
- Sorting a specific taxonomy by archive date using URL
- Give “Read More” precedence over excerpt() word count
- Modify Redux Framework Options in Child Theme
- Adding a filter to comments_template
- How to customize category_description()?
- Add Bootstrap Classes to Recent Posts Widget
- Add filter to get_posts
- Is it possible to override the default Gallery Settings form?
- Filtering a list of objects with ‘OR’ on the same field
- Excerpt is being added above the content, but it should be after it
- WordPress add script with custom type (x-jquery-tmpl)
- How to filter bbPress replies (content)?
- Change login CSS
- How to redirect non-logged in users to login with post_password_required()
- How to add a filter to the get_body_class function?
- How to add nonce tag to inline script for CSP
- Change user nicename without sanitize
- How to override include_once pointed file using add_filter?
- Register new user, assign custom role then send email
- Adding html banner to posts
- How can I get the default content of WordPress post?
- How do I hide tinymce within the edit screen of a particular page
- What would cause the gettext filter to not work for a given text domain?
- pre_get_posts to hide everywhere posts from “Archive” category
- Strip $before & $after strings from a page title
- How to remove shortcode(s) from WYSIWYG Page editor for Non Admins
- What is the action or filter for adding information under the Permalink in Edit Post/Page?
- How does wordpress add ‘style’ attribute to element
- How do I safely force get_theme_mod() to use a defined get_option(“stylesheet”) value?
- Shortcode / plugin with custom (flexible) output
- Adding a filter to related posts not working
- Is it better to use a constant or apply_filter?
- Hooked into wp_get_attachment_caption to add content to the default description; not working for jetpack slideshow. Why?
- add_action with associative array
- Remove image of srcset
- Add option to query string before get_posts() is called on archive.php
- Modify wp headers on specific page
- Set post featured image to author image
- How to make the show as a button?
- Why this remove empty paragraphs from the_content does not works?
- Take filter from multiple functions
- Read More in the actual excerpt
- WP REST API v2. filters doesn’t work
- Is it possible to include the add_filter() function within a shortcode function
- filter on the_content stopped working when I updated to WP 3.6.1
- Replace Paid Shipping Method With Free Shipping Method WooCommerce [duplicate]
- Custom excerpt_more filter not working when tag is present
- Clean/filter HTML inserted to post content by XML RPC
- Taxonomy search filters
- Is it possible to make get variable out of filter in Class?
- NextGEN Gallery: Adding drop-down menu widget to gallery view without modifying plugin code [closed]