• Resolved Andrew Mead

    (@andrewmead)


    In class-frontend.php, the store_search method fires the wpsl_store_search action. I’m working on an integration for the WordPress plugin Independent Analytics and started using this hook to track form submissions.

    While this hook fires for manual searches, I also noticed that it fires for those automatic searches that trigger on page load.

    I was hoping to get a new argument added to the hook to allow us to differentiate between the two. Something like this works real well in testing:

    // Before
    do_action( 'wpsl_store_search' );

    // After
    $is_autoloaded = isset( $_GET['autoload'] ) && $_GET['autoload'];
    do_action( 'wpsl_store_search', $is_autoloaded );

    Another option could be firing different hooks based on what happened:

    // Before
    do_action( 'wpsl_store_search' );

    // After
    $is_autoloaded = isset( $_GET['autoload'] ) && $_GET['autoload'];
    do_action( $is_autoloaded ? 'wpsl_store_search_autoload' : 'wpsl_store_search' );

    Thanks for considering the request. Let me know what you think!

Viewing 2 replies - 1 through 2 (of 2 total)
  • farroyo

    (@farroyob)

    Hi there Andrew, thank you for writing.

    We are in the middle of a major release of our upcoming verision 3.0, so I cannot guarantee that we will look into this immediatly. However, I am going to forward it to the dev team so they keep it around, it is a good suggestion and if they believe so, it could make it into a future minor release.

    Best regards!

    Thread Starter Andrew Mead

    (@andrewmead)

    Thanks for passing it along! Good luck with the release.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.