Adding Contextual Links to Ctools Custom Content Type Plugin Ctools custom content type called Custom Panes shows contextual links when you have access permission and you hover over the pane (much like a block shows the contextual links) which allows you to easily configure the content of the pane.  After creating my own plugin that is similar to Custom Panes content type (with a few custom fields), I noticed that I do not have contextual links when I hover over my custom panes. I'm wondering if I can set that in the $plugin definition to show contextual links or what the work around would be.  I found the template function the panels uses to template_preprocess_panels_pane(&amp;$vars) which actually looks for $vars['content']-&gt;content['#contextual_links'].  I'm wondering if there is a way to add contextual links to custom ctools content type plugins?

Any advice would be great!
You don't need to do that, what you can do is you can implement a hook_menu_alter and do this. 

function YOUR-MODULE_menu_alter(&amp;$items) {
  $items['YOUR-PLUGIN-PATH/%ctools_export_ui/edit']['context'] = MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE;
}


and then add your contextual link to your object. If it a block you can add below code in to your hook_block_view.

$block['content']['#contextual_links'] = array(
  'YOUR-CUSTOM-PLUGIN' =&gt; array('YOUR-PLUGIN-PATH', array($delta, 'edit'))
);