Hot answers tagged

2

It is the correct hook. I often also add a bit of javascript, to active the checkboxes inside the form. In your case it would not be necessary to use the $accepted_args parameter – 3 – of the add_filter() hook, because you're not using any parameters, and simply work with a return value as integer, in seconds. if ( ! function_exists( '...


2

Try using wp_doing_ajax() like so: function unset_filter_session() { if ( ! wp_doing_ajax() ) { //Reset sessions on refresh page unset( $_SESSION['expenditure_filter'] ); } } UPDATE You can check the answer's revision for this update part.. UPDATE #2 Sorry, I didn't realize that you're loading a page fragment (#content-area) ...


1

Here is also another solution for all kind of PHP versions what you can find inside CF Geo Plugin: if (version_compare(PHP_VERSION, '7.0.0') >= 0) { if(function_exists('session_status') && session_status() == PHP_SESSION_NONE) { session_start(array( 'cache_limiter' => 'private_no_expire', 'read_and_close' => ...


1

I went for the solution as suggested by @Rup in the comments. Replacing the two nonce functions, wp_create_nonce() and wp_verify_nonce() to prefix a nonce with a 1 or a 0 for logged-in and logged-out users respectively. The logged out nonces work by IP rather than User ID and session Token. Thus, allowing for nonces to carry over after a login. As far as I ...


1

Have you started here in the Codex (always a good place to go): https://codex.wordpress.org/Customizing_the_Login_Form . Lots of help there (and in links therein) on how to customize the login form. And, lots of tutorials found via the googles. Your code is assuming a lot of things that aren't true. Forms in WP are different than forms in PHP/HTML. The ...


1

Nonces are not the way to solve your problem. You're using it correctly. I would look at the $wpdb->insert array you're probably using, and implement a check for data to exist that matches the proposed "new" entry. I actually set up a Twilio SMS to fire off when weird validation errors are encountered. I have it text me a message and the database row id. ...


Only top voted, non community-wiki answers of a minimum length are eligible