show custom value from frontend form in a post (custom post type)

Refer to the parameters section in the documentation for wp_insert_post. Custom fields (meta data) must be passed in the form of a key/value array with the parameter name ‘meta_input’. Change ‘post_custom_field’ => $add to ‘meta_input’ => array( ‘post_custom_field’ => $add ) To show the value, use the get_post_meta function. get_post_field is only for the native … Read more

nonce in custom form is not verifying

Not sure if this answers the question, but you should call wp_nonce_field() with the fourth parameter ($echo) set to false: // You are concatenating or not directly echoing the output, so: . wp_nonce_field( ‘register’, ‘registration_nonce’, true, false ) . And I said “not sure” because you said the posted data ($_POST) did include the nonce … Read more

Is it possible to update the total price on the checkout page in woocommerce from a custom field

Well, you can use a WooCommerce hook( woocommerce_before_calculate_totals ) I will give an example so that it may be easier to understand what you believe. As far as you know , I think you problem will be fixed function calculate_embossing_fee( $cart_object ) { if( !WC()->session->__isset( “reload_checkout” )) { /* Gift wrap price */ $additionalPrice = … Read more

Creating short code for search form

You are returning the shortcode content as a big string, your function get_job_listing_categories is not properly being called. Also i would recommend use PHP output buffering which is great for WordPress shortcodes. Try below code: function jobsform_function($atts) { ob_start(); ?> <form class=”home-job-search” method=”GET” action=”https://website.com/jobs/jobs/”> <div class=”home-keywords”> <input type=”text” id=”search_keywords” name=”search_keywords” placeholder=”Enter Keywords” /> </div> <div … Read more

Is There Any Built In WP Functionality For Combining Form Fields To Return Specific Data

You can do this with basic input fields and the URL. This is because example.com/?s=test is a search URL for “test”, but example.com/category/foo/?s=test also works, and searches the foo category. Likewise, most of the other parameters WP_Query takes also work, e.g. post_type. If we dig a bit deeper, all the pretty permalinks, and WP rewrite … Read more

Use an HTML Element To Filter Taxonomies In WP Search

If you mean a single-selection dropdown menu, then you can add the <select> element using wp_dropdown_categories(). Here’s an example with salary_bands being the taxonomy name/slug, and I’m placing the dropdown above or before the submit button, but you can just place it somewhere else in your form: <?php wp_dropdown_categories( array( ‘taxonomy’ => ‘salary_bands’, // taxonomy … Read more

Search WordPress using static html page

If you want to submit a form you need a <form> element to contain the input. (You can get away without one but you’d need script to fake the submit.) The action is the homepage with the search text in an input named ‘s’, e.g. <form method=”get” action=”https://example.com/”> <input type=”search” name=”s” /> <input type=”submit” value=”Search” … Read more

User register hook is not working in woocomerce register form

user_register action hook is performed without any output, therefore you can’t echo anything from it. If you’re looking to debug the output from this function, dump it to the error log. function send_coupon_to_freshly_registered_user($user_id) { $user = get_user_by(‘id’,$user_id); //new line $user_email = stripslashes($user->user_email); //changed line error_log( print_r( $user_email, true ) ); // print_r the variable to … Read more

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