Title: Object Oriented Plugin Posting/Linking to a class.
Last modified: August 21, 2016

---

# Object Oriented Plugin Posting/Linking to a class.

 *  [OrgoneTX](https://wordpress.org/support/users/orgonetx/)
 * (@orgonetx)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/object-oriented-plugin-postinglinking-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 . 'class.admin.myclass.inc';
       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
       http://wp1.localhost/wp-admin/admin.php?page=admin-myclass-dosomething&id=BDBED1D3-2D41-11E3-8485-79F665153CEA
       ```
   

The topic ‘Object Oriented Plugin Posting/Linking to a class.’ is closed to new 
replies.

## Tags

 * [object oriented](https://wordpress.org/support/topic-tag/object-oriented/)

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 0 replies
 * 1 participant
 * Last reply from: [OrgoneTX](https://wordpress.org/support/users/orgonetx/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/object-oriented-plugin-postinglinking-to-a-class/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
