Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 726441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:27:09+00:00 2026-05-14T06:27:09+00:00

Let us say that I have a form to search by multiple tags in

  • 0

Let us say that I have a form to search by multiple tags in wordpress.

<input type="checkbox" name="my_tags[]" value="tag1" />
<input type="checkbox" name="my_tags[]" value="tag2" />

I want to make it so that when my plugin sees that my_tags[] is set, it rewrites the request to say

mysite.com/?tag=tag1+tag2

I know to use add_query_arg to put in the tag, and to use the query_vars filters to allow my arguments to be sent, but what do i hook into to get the arguments that were sent after the request, but before wp parses the request?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T06:27:09+00:00Added an answer on May 14, 2026 at 6:27 am

    My understanding is that you wouldn’t really be ‘replacing’ the query in the current request, but rather forming a new request URI and redirecting the client with wp_redirect() with the default 302 Found status code. Something like:

    wp_redirect( add_query_arg( array( 'tag' => implode( ' ', $_REQUEST['my tags'] ) ), bloginfo('url') ), 302);
    

    This sort of housecleaning has to happen before headers are sent, obviously. A logical place to hook it in through the Plugin API would be the parse_request or send_headers actions. I mean, all you’re doing here is parsing a request and sending headers. 😛

    I know nearly nothing about doing this with a server rewrite in the .htaccess file, though, so maybe you might explore that as well.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let say that I have the form below: <form action=sendMessage.php method=post> <label>Subject</label><input type=text></input> <label>Message</label><input
Let's say I have a checkbox search form like this: Check all that interests
Let's say I have a form that collects a first name and a last
Let's say we have this code: <form action='' method='POST' enctype='multipart/form-data'> <input type='file' name='userFile'><br> <input
Let's say that I have something like this in my web.xml file. <filter name=foo>
Let's say that I have 3 fieldsets, each with 2 inputs: NAME and AGE.
Let's say that I have a file (file1.php) with a simple form with the
Let's say that I have two arrays in the form a = [0, 0,
Let's say that I have a html form (actually I have an editor -
Let's say that I have a form which runs a stored procedure. This stored

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.