Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Reply To: [Assigned] How can my view access a URL parameter in a query string?

$
0
0

Dear Ned,

There was an error in my code, I dont know how I didn't see it. Here is the working version:

add_shortcode( 'wpv-post-param', 'wpv_post_param_shortcode' );
function wpv_post_param_shortcode( $atts ) {
  if ( !empty( $atts['var'] ) ) {
    $var = (array)$_GET[$atts['var']];
    return esc_html( implode( ', ', $var ) );
  }
}

Please let me know if you are satisfied with my answer and if I can help you with any other questions you might have.

Regards,
Caridad


Viewing all articles
Browse latest Browse all 20145

Trending Articles