Quantcast
Channel: Topic Tag: plugin | WordPress.org
Viewing all articles
Browse latest Browse all 26892

vanleurth on "[Plugin] Where Can I Find An Example OOP PHP to add settings to plugin"

$
0
0

Hi everybody,

I have a plugin that I want to add a settings links to pointing to the settings page of the plugin.

Do you know where can I see a object oriented example of where do I call the function add_filter?

Right now I have the following but I think I placed this code in the wrong place;

class wpy_meta
{
  function __construct()
  {
    add_action('add_meta_boxes', array($this, 'add_meta_box'));
    add_action('save_post', array($this, 'save'));

    // This is my line of code. Might be in the wrong place. Is this in the right function?
    add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'mypluginnotrealname_action_links');
  }
}

$wpy_meta = new wpy_meta();

Any links or help is appreciated.

Thank you,

V.


Viewing all articles
Browse latest Browse all 26892

Trending Articles