urlencode query string in gravity forms confirmation redirect

After digging a little deeper, I found that there is an action hook in Gravity Forms called gform_pre_submission. This allows me to modify a posted value before creating an entry or running the confirmation (see documentation). After that it was pretty basic: add_action( ‘gform_pre_submission_11’, ‘pre_submission_handler’ ); function pre_submission_handler( $form ) { $_POST[‘input_7’] = urlencode(rgpost( ‘input_7’ … Read more

Check if page is embeded

The server doesn’t know what the client is doing with the output and as such, you’re limited in what you can assume. You may or may not have params sent in the request, referer, current uri and headers. $_REQUEST[’embed_act’] $_SERVER[‘HTTP_REFERER’] $_SERVER[‘REQUEST_URI’] get_headers() On the JS side, it might be possible. if(self==top) { //… } if( … Read more

Remove query string specific key value

[EDIT] This should work the way you wanted it to: $marca = get_query_var(‘marca’); $marca_arg = isset($marca) && is_array($marca) ? $marca : []; $url_base = remove_query_arg( ‘marca’ ); $n = count( $marca_arg ); foreach ($marcas_terms as $marca_term) { $selected = in_array( $marca_term->slug, $marca_arg ); if ( $selected ) { $marca_arg2 = array_diff( $marca_arg, [ $marca_term->slug ] … Read more

Can’t add external rewrites

First off, don’t ever do this: add_action(‘init’, ‘flush_rewrite_rules’); Every time WordPress loads, you are going to flush the rewrite rules. You only need to do this once to make sure your rewrite shows up. Second, add_rewrite_tag only takes two arguments, the tag and the regex. If you want to specify a query variable directly, you’ll … Read more

How do you Query posts with nothing in common?

Maybe you’re looking for the post__in parameter in WP_Query. $query = new WP_Query(array( ‘post__in’ => array(23,18,2,199,6,8) ); And then: while ( $query->have_posts() ) { $query->the_post(); /* post loop */ } Take a look at the docs. =D For public queries: post__in is not public queryable by default, so you can just validate and copy $_GET[‘post__in’] … Read more

Change gravity forms confirmation redirect query string to include entry id [closed]

I figured it out. I did have some syntax errors in my code. Should have been add_filter instead of add_action. Also, $confirmation is an array and was never returned. I think my brain was just tired from looking at this for so long. Anyways, here’s what I did to fix it. add_filter(“gform_confirmation”, “confirm_change”, 10, 4); … Read more