WordPress.org

Forums

Events Manager
[resolved] Option to search by GET instead of POST (5 posts)

  1. Daedalon
    Member
    Posted 2 years ago #

    I suggest adding an option to search by GET instead of the POST method. I want users to find relevant lists of content through the search and then link that search result to their friends. With GET it is possible, with POST it is not.

    As an example a user would post on a WP forum, where people are discussing their coming get-together:

    I found a listing of things we can do while in town. Check it out at http://example.com/events/?town=Helsinki

    http://wordpress.org/extend/plugins/events-manager/

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    You'd have to implement that one yourself, not something I'd want to change anytime soon.

    you could probably do this by editing the search form and events-list.php template.

  3. Daedalon
    Member
    Posted 2 years ago #

    Thanks for the tip, it's now done. All that was required was to copy plugins/events-manager/templates/templates/events-search.php to themes/mytheme/plugins/events-manager/templates/events-search.php and change line 22 from <form action="<?php echo EM_URI; ?>" method="post" class="em-events-search-form"> to <form action="<?php echo EM_URI; ?>" method="get" class="em-events-search-form">.

    Still to do is to find a way to hide the last part of the now-generated URL, "&action=search_events", as redundant. Removing from events-search.php the line 136, `
    <input type="hidden" name="action" value="search_events" />`, and changing events-list.php line 22 from
    if(!empty($_REQUEST['action']) && $_REQUEST['action'] == 'search_events'){
    to eg.
    if(!empty($_REQUEST['town'])){
    wasn't enough, and only resulted in displaying the usual events list instead of what was chosen in the search form.

    After doing a similar change to em-events.php and em-actions.php, it works as intended. However, neither of those are under the templates folder, making them not safe for updates.

    What's the most update-safe way to override the behavior in em-events.php and em-actions.php?

  4. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    You should be using hooks to override anything in those files.

  5. Daedalon
    Member
    Posted 2 years ago #

    Thanks, will do!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.