Forums

add_options_page() passing class (3 posts)

  1. DanDaBeginner
    Member
    Posted 3 years ago #

    add_options_page('My Plugin', 'Plugin', 10, basename(__FILE__), array('Class', 'method') );

    - add_options_page is not instantiating the class (the code above), it callings it as a static method... now my problem is how can I make the method call to be an instance of a Class and not as static method...

    I guess the solution for this is to pass a variable instantiated by Class as reference... is there another option or none?

    thanks....

  2. tunamaxx
    Member
    Posted 2 years ago #

    I'm just swinging away in the dark her, but shouldn't:

    add_options_page('My Plugin', 'Plugin', 10, basename(__FILE__), array('Class', 'method') );

    ...actually be this:

    add_options_page('My Plugin', 'Plugin', 10, basename(__FILE__), array(&$this, 'method') );

  3. tunamaxx
    Member
    Posted 2 years ago #

    Oh crap... for some reason I thought this said 1 hour old. Sorry!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.