Front-end only $_POST and $_POST requests handling in WordPress plugin

you can use something like this: add_action( ‘admin_post_add_foobar’, ‘prefix_admin_add_foobar’ ); //this next action version allows users not logged in to submit requests //if you want to have both logged in and not logged in users submitting, you have to add both actions! add_action( ‘admin_post_nopriv_add_foobar’, ‘prefix_admin_add_foobar’ ); function prefix_admin_add_foobar() { status_header(200); die(“Server received ‘{$_REQUEST[‘data’]}’ from your … Read more

trying to get product category image in woo-coomerce

$prod_categories = get_terms( ‘product_cat’, array( ‘orderby’ => ‘name’, ‘order’ => ‘ASC’, ‘hide_empty’ => true )); foreach( $prod_categories as $prod_cat ) : $cat_thumb_id = get_woocommerce_term_meta( $prod_cat->term_id, ‘thumbnail_id’, true ); $shop_catalog_img = wp_get_attachment_image_src( $cat_thumb_id, ‘shop_catalog’ ); $term_link = get_term_link( $prod_cat, ‘product_cat’ );?> <a href=”https://wordpress.stackexchange.com/questions/283944/<?php echo $term_link; ?>”><img src=”<?php echo $shop_catalog_img[0]; ?>” alt=”<?php echo $prod_cat->name; ?>” /></a> <?php … Read more