Processing URL variable and processing result into post body

enter image description here

In functions.php, I’ve added

function add_custom_query_var( $vars ) {
  $vars[] = "registration";
  return $vars;
}
add_filter( 'query_vars', 'add_custom_query_var' );

I’ve created a page template named template_registration and added

if ( get_query_var('registration') ) {
    echo get_query_var('registration');
}

within while ( have_posts() ) : the_post(); loop.

After creating a page with that template, everything works. What I’m not sure how to do, is pass that into the actual post body.

The end result will be to capture the passed value, sanitize, perform a lookup in a db, and return the results.

It’s currently sitting outside (e.g. http://.../page/?registration=L67B1997)

Read more here:: Processing URL variable and processing result into post body

Leave a Reply

Your email address will not be published. Required fields are marked *