CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • civicrm add new tab and wordpress
Pages: [1]

Author Topic: civicrm add new tab and wordpress  (Read 672 times)

Nilda

  • I’m new here
  • *
  • Posts: 12
  • Karma: 0
  • CiviCRM version: 4.5.8
  • CMS version: Wordpress 4.1
  • MySQL version: MySQL 6.2
  • PHP version: php 5.4
civicrm add new tab and wordpress
April 10, 2015, 07:29:01 am
I create a new plugin and I try to use hook for adding extra tab in the contents, my question is how to get $contactID?



add_action('civicrm_tabs', ' civitest_civicrm_tabs');

function civitest_civicrm_tabs( &$tabs, $contactID ) {
 
    // unset the contribition tab, i.e. remove it from the page
    unset( $tabs[1] );
 
    // let's add a new "contribution" tab with a different name and put it last
    // this is just a demo, in the real world, you would create a url which would
    // return an html snippet etc.
    $url = CRM_Utils_System::url( 'civicrm/contact/view/contribution',
                                  "reset=1&snippet=1&force=1&cid=$contactID" );
    $tabs[] = array( 'id'    => 'mySupercoolTab',
                     'url'   => $url,
                     'title' => 'Contribution Tab Renamed',
                     'weight' => 300 );
}

Thank you

Nilda

Coleman Watts

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 2346
  • Karma: 183
  • CiviCRM version: The Bleeding Edge
  • CMS version: Various
Re: civicrm add new tab and wordpress
April 10, 2015, 08:00:41 am
I think this question belongs on StackExchange
Try asking your question on the new CiviCRM help site.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Developer Discussion »
  • APIs and Hooks (Moderator: Donald Lobo) »
  • civicrm add new tab and wordpress

This forum was archived on 2017-11-26.