[resolved] Add Widget from within classed plugin (2 posts)

  1. mattyrob
    Posted 5 years ago #

    I have a plugin (Subscribe2) that is written as a PHP class. Until now I have used the old (pre WordPress 2.8) API to add a widget but I'm trying to get up to date.

    I've managed to pull the widget code out into a stand alone file but I'd like to try and keep the activation option that I currently have in the main plugin class.

    How would I go about enabling (registering) the widget from within my current class? I've tried all sorts of code but the registration seems to fail.

    I've tried a require_once to the new widget file and then a register_widget, I've put both of this on a function within my class. Anyone any ideas?

  2. mattyrob
    Posted 5 years ago #

    Daft error on my part - I had forgotten to require the widget file before trying to register it! :-)

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.