WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] How to fix the category complusory in the event add page (4 posts)

  1. Gwentrac
    Member
    Posted 1 year ago #

    Hello,

    I would like to put the category selection complusory in my "Add events page".

    Do you know how I can do it?

    I tried to add the following code in the em-event.php file but it doesn't work.

    if( empty($this->event_categories) ){
    $this->add_error( sprintf(__("%s is required.", "dbem"), __('Your categorie,'dbem')) );}

    How can I get the categories selected when the user try to save his event?

    Best regards,

    Gwen

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

  2. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    you'd need to use PHP for this, you'd have to hook into e.g. em_event_save_meta which is called in classes/em-event.php

    and then add categories to the event that way, as we do in classes/em-category.php function save()

  3. Gwentrac
    Member
    Posted 1 year ago #

    Hello Marcus,

    Thanks for your help but I had not succeed!!! I tried different staff but ....I spend all my sunday morning... grrhh!

    Could you give me additional information?
    Could you detail your proposition "add categories to the event that way".

    Best regards,

    Gwen

  4. agelonwl
    Member
    Posted 1 year ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic