how to upload a image from frontend with wp_insert_post and also update_post_meta?
how to upload a image from frontend with wp_insert_post and also update_post_meta?
how to upload a image from frontend with wp_insert_post and also update_post_meta?
Meta_query with multiple keys and multiple values
It looks like the category name. Really, I don’t understand what you mean? For Vietnamese: Hỏi trên này để có câu trả lời là lâu lắm. Tham gia nhóm WordPress Việt Nam mà hỏi, có khi còn nhanh có đáp án hơn ở trên này. Link group: WordPress Việt Nam
Problem querying Custom post type by custom fields
Welcome to WPSE. A few problems to note: $user_id is not defined so your call to wp_get_current_user() is passing a null value as a parameter. $current_user = wp_get_current_user($user_id);. // $user_id is not defined wp_get_current_user() does not accept parameters. See the documentation here: https://developer.wordpress.org/reference/functions/wp_get_current_user/ This line $current_user->ID; does nothing. There is no ID method in the … Read more
It seems you have one error in your code… if($id == $author_id){ $selected = ‘ selected=”selected”‘; } It should be $building_id instead of $author_id. I tested the rest of the code and the saving is working fine. If you had printed/echoed out the value of this line … $building_id = get_post_meta($post->ID, ‘p2p2_building’, true); like print_r($building_id);, … Read more
Excluding Specific Fields from Profile Builder Registration Form
I had to add this code from Stephen Mullen on StackOverflow to get it to work: add_action( “rest_insert_user_question”, function ( \WP_Post $post, $request, $creating ) { $metas = $request->get_param( “meta” ); if( is_array( $metas ) ) { foreach( $metas as $name => $value ) { // update_post_meta( $post->ID, $name, $value ); update_field( $name, $value, $post->ID … Read more
function common_cats($att){ $args = array( ‘category__and’ => $att[‘category’], //must use category id ‘tag__in’ => $att[‘tag’], //must use tag id for this field ‘posts_per_page’ => $att[‘posts_per_page’]); //get all posts $posts = get_posts($args); $output = “<ul>”; foreach ($posts as $post) : $output .= “<li>”.get_the_title(). “</li>”; endforeach; $output .= “</ul>”; return $output; } add_shortcode(‘commoncats’, ‘common_cats’); use [commoncats] where … Read more
Woocommerce – Convert Delivery method into a custom field