Forums Forums Search & Filter Pro Additional Search field to hide post meta

Tagged: , ,

Viewing 10 posts - 1 through 10 (of 11 total)
  • Anonymous
    #135044

    Hi, i have been working with you on this plugin and the integration with Event Espresso, i have a lot of events that are showing as sold out, what i would like to do is add an additional field so that, i have give the user the ability to hide all sold out events.

    any pointers would be great. thanks

    Trevor
    #135073

    How does Event Espresso know an event is sold out?

    Anonymous
    #135440

    Hi Trevor,

    this is the reply i got back from Event Espresso

    That’s actually in the wp_posts table which has the post_status field. When an event is sold out its post_status changes to sold_out.

    I added a post meta option and looked though but dont seem to be able to conenct to it.

    any suggestions?

    thanks

    Ryan

    Trevor
    #135445
    This reply has been marked as private.
    Anonymous
    #135449
    This reply has been marked as private.
    Trevor
    #135453

    I do not think that this is going to be possible, at least not directly. The reason is two-fold. The first is that we index/filter meta data stored in the post_meta table, but this value is not stored in that table. As you say, this data is stored in the posts table, and it is stored as a WordPress array in that field.

    It is accessed by the WordPress get_post_status() function:

    https://codex.wordpress.org/Function_Reference/get_post_status

    To allow front end (user) access to this would be dangerous, as it would allow spoofing of the search query to show private posts. As such, it is not the most sensible of places to place such data. A custom meta field would have been a much better choice for the Event Espresso plugin authors. I would have thought that this would not be a difficult bit of coding for them to do, with a settings choice for the user to select which option they want to use.

    Anonymous
    #136406

    Hi trevor

    This is the reply i got from event espresso

    Hi Ryan,
    I’m afraid their suggestion to store post statuses outside of the post_status field isn’t something that Event Espresso can do, and adding an option to toggle where post_statuses are stored isn’t a viable option.
    If the developer of the search plugin wants to discuss this further with the Event Espresso developer team, they’re welcome to open an issue on github:
    https://github.com/eventespresso/event-espresso-core/issues

    thanks

    Trevor
    #136418

    The issue is that you want to give the user a switch. In V3 we may well be offering such an option, or at least one you could then use programmatically using our Edit Query Arguments.

    That function can be used to add the post status to the query, but you need some means to decide if the user wants to do that.

    Anonymous
    #136709

    is there a way we can use a simple check box, what im thinking is to have the check box already selected in the search and filter bar, which will automatically hide the sold out events and if they wish to show then they could uncheck the box, not sure if something like this is possible.

    what you think

    regards

    Ryan

    Trevor
    #136713
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 11 total)