WordPress.org

Ready to get started?Download WordPress

Forums

Events Manager
[resolved] em_events() Call to a member function output() on a non-object (7 posts)

  1. Thomas
    Member
    Posted 1 year ago #

    Listing a couple of events using:
    em_events( array('limit'=>1,'orderby'=>'event_start_date') ); works fine.

    As soon as I add 'array'=>true to the arguments to get the output as an array I get the following error:
    Fatal error: Call to a member function output() on a non-object in [..]/wp-content/plugins/events-manager/classes/em-events.php on line 199

    I think this is a bug?

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

  2. agelonwl
    Member
    Posted 1 year ago #

  3. Thomas
    Member
    Posted 1 year ago #

    Thanks aglonwl!
    I actually fixed it by using EM_Events::get().

    Then I discovered EM_Events::get() isn't outputting the event's categories. Or am I missing something?

    Edit: already tried using $EM_Event->get_categories()->categories but that's giving me the error

    Notice: Undefined property: EM_Event::$id in /wp-content/themes/dir/file.php on line 81

    Fatal error: Call to a member function get_categories() on a non-object in /wp-content/themes/dir/file.php on line 30

  4. agelonwl
    Member
    Posted 1 year ago #

    additional useful links

    -http://wordpress.org/support/topic/plugin-events-manager-get-event-category-name-from-category-id?replies=3

    -http://codex.wordpress.org/Function_Reference/get_term

  5. Thomas
    Member
    Posted 1 year ago #

    The problem is that EM_Events::get() isn't outputting the event's term_id(s)

  6. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 1 year ago #

    you need to go trough the events and do

    $EM_Event->get_categories()->get_ids();

    we don't load them until you need them

  7. Thomas
    Member
    Posted 1 year ago #

    Thanks for your replies guys. I fixed it!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic