Creating custom widget based on AdvancedListWidget

Home Forums Calendar Products Events Calendar PRO Creating custom widget based on AdvancedListWidget

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #48482
    Nate
    Participant

    I am trying to create a new custom widget based off of the AdvancedListWidget so that I can edit “View All Events” without needing to edit core but having some issues.

    I have the following:
    http://pastebin.com/vRFZ4V9f

    This code/widget works if I do this in a page template:
    the_widget(‘CustomTribeEventsAdvancedListWidget’, array( ‘limit’ => ‘3’));

    However, it does not work properly as a “real widget” in the WP admin. It shows up in the list of widgets and if I drag it to the sidebar change some options (like limit) and hit save it doesn’t “save/remember” what I just changed and “resets” (blank or default values); however, if I try it again it then saves it and remembers it but if I refresh the admin page I see that it somehow changed to use the normal Events list widget instead of the one I created (the name of the widget in the sidebar changes to “Events List Advanced Widget”).

    I am fairly new to WP so it could be something really easy.

    #48497
    Jonah
    Participant

    Hi Nate,

    I think the only thing wrong here is on lines 17, 18 the code should be:

    /* Widget control settings. */
    $control_ops = array( 'id_base' => 'custom-events-list-widget' );

    Let me know whether or not that works.

    – Jonah

    #48560
    Nate
    Participant

    That did it. Thanks!

    #48666
    Jonah
    Participant

    Excellent to hear Nate, let us know if there’s anything else you need help with.

    Regards,
    Jonah

    #979080
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Creating custom widget based on AdvancedListWidget’ is closed to new replies.