Support » Plugins » Hacks » Object Oriented Plugin Posting/Linking to a class.

  • If I want to post to one of my classes or link to it, I am currently using the following logic. Is there a better way to do this? Thanks in advance.

    //instantiate the object
    $path1 = ABS_CONTROLS_PATH . '';
    require_once $path1;
    $myclassObj = new myclass();
    //Create a hidden page,
    //that basically just points to the function and class.
    add_submenu_page( "", "Do Something", "", "manage_options", 'admin-myclass-dosomething', array($myclassObj, 'dosomething') );
    //Then create a constant for the link
    define("CATEGORY_ACTION_DISPLAY", '?page=admin-myclass-dosomething', true);	
    //Then the link looks like this
  • The topic ‘Object Oriented Plugin Posting/Linking to a class.’ is closed to new replies.