New answers tagged

0

I figured out what I was missing. May have been simple to some but it's worth posting in case someone else has a similar question. I set the post information from the form to variables and then assigned them in wp_remote_post. I first re-did my form to add specific names to it: <form name="getUserInfo" action="' . esc_url( $_SERVER['REQUEST_URI'] ) . '...


1

You could make the form action be the current page's URL. When the user submits the form the page gets reloaded with the POST parameters. Then in your widget's code you check if those parameters exist. If so, you check them and then process them with your wp_remote_post. Personally I use Gravity Forms for stuff like this. I create the form in Gravity and ...


4

Since you are already getting the ID of the newly created post ($post_id), you just need to get the URL and redirect after the submission. Using get_permalink( $post_id ) you can get post's URL. Also, you can get rid of the header() function to send a new HTTP header, and use WordPress' own function for redirect - wp_redirect(). wp_redirect( ...


0

Searching around and not being able to implement the action through init hook I've found this workaround which for sure isn't the best but does the job nicely. echo "<script type='text/javascript'> window.location=document.location.href; </script>"; at the end of $_POST instructions. If somebody has a better solution, welcome ...


0

It's because your function archive_action is executed when the loop was already made. Try hooking your function into the init action, so it would be executed before the loop. Another prettier approach would be using ajax. So you send the request through Ajax to archive and just use javascript to remove the post from the DOM.


0

Like Ash was saying, something like this using $_REQUEST or $_POST will do it. <?php $args['exclude'] = "12,20"; // omit these two categories $categories = get_categories($args); ?> <select class="selectpicker btn-block" name="coupon_cat" id="category"> <option value="">Категори Сонгох</option> <!-- if nothing else is ...


0

You can check with $_REQUEST['coupon_cat'], Which gives value of selected category then compare it with your loop value so, you can make it selected. $_REQUEST['coupon_cat'] will help you.



Top 50 recent answers are included