Tag Info

New answers tagged

0

This turned out to be a pretty straightforward bug with my own code. The problem was my first form was checking for submission with a simple: if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) { so it was being triggered even when the other form was submitted, and my wp_verify_nonce() check would fail and then it would call wp_nonce_ays. To fix, I added this ...


1

WordPress provides wp-admin/admin-post.php endpoint to work with form submissions. You should likely point your form to it, add an identifying action, and use hooks in the file to process submission.


0

You can achieve what you want using ajax, which, in WordPress, is handled by admin-ajax.php. It's all in here.


1

To be honest I think this question is off topic, because its topic is so a general concept that can apply to any language capable to handle web development. So is even broader than a general PHP question. By the way, what I want to suggest is too much for a comment. When you need to check data coming from trusted users (assuming you already have a way to ...


0

I managed to figure out how to ensure the fields can be updated via edit-account by adding the following action; add_action( 'woocommerce_save_account_details', 'wooc_save_extra_register_fields' ); Now my next challenge, is to add a select field using data from an json file as values. Is this easy to do?


0

If you are not using a child theme, this mod requires one. Here's how. The answer to your question is on the page you linked, specifically in the last line of code: add_action( 'woocommerce_created_customer', 'some_unique_function_name' ); This runs the function some_unique_function_name() whenever a new user is registered through the woocommerce ...


0

The submit_button() function is a wrapper for get_submit_button(). Now that function has multiple arguments, but the most interesting for your actual problem is the 3rd argument name. It sets the HTML name attribute. <form action=""> <input ... etc. <button type="submit" name="choice-a"> </form> Now everytime you process your ...


1

The * appears under the field because the field is inside the label. There doesn't appear to be any useful filters for this, but you could use one of the hooks to inject some JS on the page that adds the *: required = jQuery( "<span>*</span>" ); required.css("color", "red"); jQuery('label br').before( required ); Note: if you're going to use a ...


0

First, you should change your input field names to something unique. category is a WordPress query var, so submitting a form with that field name may have unexpected results. That said, post_category is only for the category taxonomy, custom taxonomies should use the tax_input parameter. however... if this form is being submitted by users who are not ...


0

To execute a task after a option has been updated, you can use updated_option action hook: add_action( 'updated_option', 'updated_option_callback', 10, 3 ); function updated_option_callback( $option, $old_value, $value ) { //Do something } Also, you can use update_option_{option-name} specifically for each option. For example: add_action( ...


1

You should be able to paste the HTML of the Google Docs iframe directly into the page by using the TEXT mode of the edit form (instead of the VISUAL) mode. That mode allows you to enter the HTML directly, while the WYSIWYG editor will either ignore it or treat it as text.



Top 50 recent answers are included