WordPress.org

Plugin Directory

Changeset 887852


Ignore:
Timestamp:
04/05/14 05:31:56 (4 years ago)
Author:
aniketpant
Message:

Add contextual help

File:
1 edited

Legend:

Unmodified
Added
Removed
  • instamojo/trunk/option.php

    r887419 r887852  
    1616    add_action('admin_init', array($this, 'page_init')); 
    1717    add_action('admin_notices', array($this, 'plugin_notices')); 
     18    add_action('load-settings_page_instamojo', array($this, 'add_contextual_help')); 
    1819  } 
    1920 
     
    3940  } 
    4041 
     42  // Add contextual help to the plugin page 
     43  public function add_contextual_help() 
     44  { 
     45    $screen = get_current_screen(); 
     46 
     47    $screen->add_help_tab(array( 
     48      'id' => 'getting-started', 
     49      'title' => __('Getting Started'), 
     50      'content' => '<p>'.__('To use this plugin, you require an <a href="https://www.instamojo.com/accounts/register/" target="_new">Instamojo account</a>.').'</p><p>'.__('If you already have an account with Instamojo and have created offers there, then you can authenticate you account by filling up the credentials. Enter your Instamojo Username and Password, and then click the <b>Authenticate</b> button.').'</p>' 
     51    )); 
     52    $screen->add_help_tab(array( 
     53      'id' => 'usage', 
     54      'title' => __('Usage'), 
     55      'content' => '<p>'.__('After authenticating your account, you can now use the Instamojo Widget which is available from <b>Appearance > Widgets</b>.').'</p><p>You can also use the shortcode generator available in the options page. This shortcode can be used to embed buttons into posts and pages.</p>' 
     56    )); 
     57    $screen->add_help_tab(array( 
     58      'id' => 'revoke', 
     59      'title' => __('Revoking your token'), 
     60      'content' => '<p>'.__('If you do not wish to use the plugin anymore and wish to revoke your token associated with this application, you can click the <b>Revoke Token</b> button.').'</p>' 
     61    )); 
     62 
     63    $screen->set_help_sidebar('<ul><li><a href="https://www.instamojo.com" target="_new">Instamojo Website</a><li><li><a href="https://www.instamojo.com/developers" target="_new">Instamojo API</a><li></ul>'); 
     64  } 
     65 
     66  // Notices generated to help the user 
    4167  public function plugin_notices() 
    4268  { 
Note: See TracChangeset for help on using the changeset viewer.