How can i add validation to this login form with out it redirecting to the wp-login.php page
Why not just use wp_login_form()? (Codex ref)
Why not just use wp_login_form()? (Codex ref)
The problem is with your jQuery selector: var usr = $(“#site-addres-input”).attr(‘value’); Will get the default value of the input element. Typically this will be blank, because you’re not setting it ahead of time. You need to use: var usr = $(“#site-addres-input”).val(); I’m also noticing that you’re using #site-addres-input, but “address” has two s at the … Read more
Personally I’d do it the same way, since it seems to be the only point where you can examine user input and validate it. Also, heavily borrowing from code sample in this excellent article: function wpPartValidate_settings( $input ) { if ( check_admin_referer( ‘wpPart_nonce_field’, ‘wpPart_nonce_verify_adm’ ) ) { // Create our array for storing the validated … Read more
Create a /js subfolder in your theme directory, if such does not exist already. Save your script to a file in said folder. Then, in functions.php: if ( is_admin() ) { global $pagenow; if ( ‘customize.php’ === $pagenow ) { add_action( ‘admin_enqueue_scripts’, ‘wpse107236_enqueue_customizer_script’ ); } } function wpse107236_enqueue_customizer_script() { wp_enqueue_script( ‘your-script-handle’, get_template_directory_uri . ‘/js/your-script.js’, array( … Read more
Like Ash was saying, something like this using $_REQUEST or $_POST will do it. <?php $args[‘exclude’] = “12,20”; // omit these two categories $categories = get_categories($args); ?> <select class=”selectpicker btn-block” name=”coupon_cat” id=”category”> <option value=””>Категори Сонгох</option> <!– if nothing else is selected, this will be selected automatically –> <?php foreach($categories as $category): ?> <?php $selected = … Read more
A WordPress Nonce, while not a true nonce, functions similarly in that it exists to secure a form or page from unauthorized access and abuse. By default, the WordPress Comment Form only displays a nonce field if the current user has the unfiltered_html capability. So, if the form is implemented with standard procedures, all you … Read more
This a really good question – my suggestion is to use transients. For instance, in your validation callback: wpse51669_validation_cb($settings){ //Perform validation checks if( $valid ){ //If settings validate return $validate_settings; } //Otherwise add settings error add_settings_error(‘my-plug-in-settings’,’error-with-xyz’, ‘I fell over’,’error’); //And add the failed settings to a transient set_transient( ‘my-plug-in-settings-invalid’, $settings, 60); return false; } Then … Read more
Per the jQuery noConflict Wrappers section of the wp_enqueue_script() Codex page, the $ variable is not available in WordPress. You can replace $ with jQuery in your jQuery code, or do something like this: jQuery(document).ready(function($) { // your code here . . . });
According to the documentation, is_email() is used to validate an email and either returns the email if it is valid or false if it isn’t. So are using it correctly. The only thing I can see in your code is that if the email is not valid, you are settings the data to a boolean … Read more
I did have the same issue. And I wasted enough time for the answer. At first be sure that: The ajax request isn’t failed and happens. So, check: Is acf_form_head() before get_header() and run before any html is output? Does your theme contain call to wp_head()? Does your theme contain call to wp_foot()? Are your … Read more