• Resolved luhmanr

    (@luhmanr)


    I am not sure where to do for this question so I guess I will start here. My current scenario would be to create dozens of pages each with a shortcode that varies by one parameter. Is there a way to pass a shortcode from one page to another and have it executed on the second page. Thus, my dozens of pages goes down to two pages.

    I would envision one page with a dropdown list that includes.

    [shortcode1]
    [shortcode2]
    [shortcode3]
    etc.

    A user would select from the dropdown and that is passed to a second page in which the shortcode is executed.

    How can this be done.

Viewing 1 replies (of 1 total)
  • Plugin Author Vova

    (@gn_themes)

    Hi @luhmanr,

    this question isn’t related to Shortcodes Ultimate itself, so I mark it as resolved.

    You can try to do the following:

    At page-1:

    <form action="/page-2" method="get">
      <select name="my_action">
        <option value="action-1">Action 1</option>
        <option value="action-2">Action 1</option>
      </select>
    </form>

    At page-2, or within your custom shortcode, added to page-2:

    if ( isset( $_GET['my_action'] ) ) {
      $action = sanitize_key( $_GET['my_action'] );
      if ( 'action-1' === $action ) {
        do_stuff();
      }
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Create shortcodes’ is closed to new replies.