Send a value to woocommerce with a button type submit

At the select tag you have 2 name attribute <select type=”number” step=”any” name=”actions” id=”actions-select” name=”wpneo_donate_amount_field” class=”input-text amount wpneo_donate_amount_field text”> Then, when you submit, it only collect the first defined name. (name=”actions”). You have to delete this attribute. and using name=”wpneo_donate_amount_field” only. It should like <select type=”number” step=”any” id=”actions-select” name=”wpneo_donate_amount_field” class=”input-text amount wpneo_donate_amount_field text”>

How to query custom post types posts filtered by multiple custom taxonomies through a form selection

Apparently the problem was in the “AND” relation. Code now seems to work: <?php if(isset($_REQUEST[‘submit’])) { $prodotto = $_POST[“prodotto”]; $livello = $_POST[“livello”]; $ruolo = $_POST[“ruolo”]; $stato = $_POST[“stato”]; $args = array( ‘post_type’ => ‘corsi’, ‘posts_per_page’ => -1, ‘orderby’ => ‘title’, ‘order’ => ‘ASC’, ‘tax_query’ => array( array( ‘taxonomy’ => ‘prodotto’, ‘field’ => ‘slug’, ‘terms’ => … Read more

CRUD front end for mySQL in WordPress

Tom, I appreciate that WP doesn’t provide a CRUD type setup … I’m just wondering, whether these nice form-plugins that do a brilliant job in displaying and editing MySQL records of their own making within the WP-plugin-database could not do the same thing to a MySQL database on the same server. Again, I have been … Read more

WordPress upload_mimes not working for front-end uploads of 3D files

Thanks to this thread here, I found this code function fix_wp_csv_mime_bug( $data, $file, $filename, $mimes ) { $wp_filetype = wp_check_filetype( $filename, $mimes ); $ext = $wp_filetype[‘ext’]; $type = $wp_filetype[‘type’]; $proper_filename = $data[‘proper_filename’]; return compact( ‘ext’, ‘type’, ‘proper_filename’ ); } add_filter( ‘wp_check_filetype_and_ext’, ‘fix_wp_csv_mime_bug’, 10, 4 ); which does allow the files to be uploaded through the … Read more

Custom form action to handle data inside a plugin

admin-post.php is perfect for that. You have to do three things: 1. Set action for your form to admin-post.php <form method=”post” action=”<?php echo admin_url(‘admin-post.php’); ?>”> 2. Add hidden input with name=action <input type=”hidden” name=”action” value=”my_plugin_action” /> 3. Register your callbacks for admin_post_{$action} and admin_post_nopriv_{$action}: add_action( ‘admin_post_my_plugin_action’, ‘my_form_processor’ ); add_action( ‘admin_post_nopriv_my_plugin_action’, ‘my_form_processor’ ); function my_form_processor() { … Read more

Ajax posts filter by date, comments, top views, top likes

I haven’t tested the code, but this should help. option elements do not have a name attribute: <option name=”top-views” value=”top-views”>Top Views</option> <option name=”top-likes” value=”top-likes”>Top Likes</option> And therefore $_POST[‘top-views’] for example, is not going to be set, or that the value is not the top-views in the above option. Use the proper option markup Based on … Read more

WooCommerce registration password field not displaying

To enable default Password field I just had to check checkbox (When creating an account, automatically generate an account password) under WooComemrce > Settings > Accounts and Privacy. After this default password field started to display on registration page. To add repeat password field I used this hook add_action( ‘woocommerce_register_form’, ‘wc_register_form_password_repeat’ ); function wc_register_form_password_repeat() { … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)