2017 © Pedro Peláez
 

library wp-contextual-help

WordPress plugin that allows a developer to easily extend the contextual help dropdown content area in WordPress

image

voceconnect/wp-contextual-help

WordPress plugin that allows a developer to easily extend the contextual help dropdown content area in WordPress

  • Wednesday, August 17, 2016
  • by voceconnect
  • Repository
  • 15 Watchers
  • 4 Stars
  • 590 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Please note: This plugin is no longer being actively maintained or supported.

WP Contextual Help

Contributors: kevinlangleyjr, voceplatforms, Mte90
Tags: contextual, help
Requires at least: 3.3
Tested up to: 4.1
Stable tag: 1.0.2
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html, (*1)

Allows a developer to easily extend the contextual help dropdown content area in WordPress., (*2)

Description

Adds helper functionality to easily add to the WP Contextual Help throughout the admin of a WordPress site., (*3)

Installation

As standard plugin:

See Installing Plugins., (*4)

As theme or plugin dependency:

After dropping the plugin into the containing theme or plugin, add the following:, (*5)

if( ! class_exists( 'WP_Contextual_Help' ) ) {
    require_once( $path_to_help . '/wp-contextual-help.php' );
}

As a composer dependency

Add the following to your composer.json required dependencies, (*6)

{
    // ...
    "require": {
        "voceconnect/wp-contextual-help": "~0.0.1"  // Most recent tagged version
    },
    // ...
}

Usage

When you register a tab you have a few different options as far as what content is displayed there., (*7)

If you provide a callback argument in the tab args, that will take precedence and the plugin will not look for any HTML files within the help-docs directory., (*8)

If you provide a file argument in the tab args, the plugin will look for that file specifically and if it does not exist will output a warning message in place of the content to notify the developer that the specified help document does not exist., (*9)

If no file or callback argument is passed into the tab args, by default the plugin will look for a file with the same name as the id of the tab. So for post-management it would look for post-management.html within the help docs directory., (*10)

HTML Help Docs

All help docs should either reside within the get_template_directory() . '/includes/help-docs/'; directory and all images within the get_template_directory() . '/includes/help-docs/img/';, (*11)

You can use the wp_contextual_help_docs_dir filter to change the directory for the HTML files and the wp_contextual_help_docs_url filter to change the base URL for the images. Within your help documentation we use the variable {WP_HELP_IMG_URL} as a placeholder for the image URL which is then replaced before rendering with the value provided from the filter or defaults to the default help docs image directory., (*12)

Registering a tab

Help tabs are registered using the WP_Contextual_Help::register_tab() method., (*13)

Parameters

  • $id (string) - String to be used as the ID for the help tab
  • $title (string) - Title to display to the user within the tab
  • $args (array) - An array of options for the help tab
    • page (string, array) - Page(s) to enable the help tab
    • post_type (string, array) - Limit the tab to only display on these specific post types
    • file (string) - HTML file to read and output within the tab
    • wpautop (boolean) - Default: False - Apply wpautop to the loaded HTML file
    • callback - If a user would rather a custom callback instead of the autoloading of a HTML file, this is where that would be applied

Example

 array( 'post.php', 'post-new.php' ),
        'post_type' => 'post',
        'wpautop' => true
    ) );

    // Add to a custom admin page
    WP_Contextual_Help::register_tab( 'custom-settings', 'Custom Settings', array(
        'page' => 'settings_page_custom-settings-page',
        'wpautop' => true
    ) );

    // Add help tab with custom callback
    WP_Contextual_Help::register_tab( 'custom-callback', 'Custom Callback Example', array(
        'page' => array( 'post.php', 'post-new.php' ),
        'post_type' => 'post',
        'callback' => function( $screen, $tab ) {
            echo '

It is super easy to add new help tabs!, (*14)

'; } ) ); } ); ?>

Changelog

Please refer to full changelog at https://github.com/voceconnect/wp-contextual-help/releases., (*15)

The Versions

17/08 2016

dev-master

9999999-dev

WordPress plugin that allows a developer to easily extend the contextual help dropdown content area in WordPress

  Sources   Download

GPLv2+

by Kevin Langley

05/01 2015

1.0.2

1.0.2.0

WordPress plugin that allows a developer to easily extend the contextual help dropdown content area in WordPress

  Sources   Download

GPLv2+

by Kevin Langley

21/11 2014

1.0.1

1.0.1.0

WordPress plugin that allows a developer to easily extend the contextual help dropdown content area in WordPress

  Sources   Download

GPLv2+

by Kevin Langley

07/10 2014

1.0.0

1.0.0.0

WordPress plugin that allows a developer to easily extend the contextual help dropdown content area in WordPress

  Sources   Download

GPLv2+

by Kevin Langley

22/07 2014

0.0.3

0.0.3.0

WordPress plugin that allows a developer to easily extend the contextual help dropdown content area in WordPress

  Sources   Download

GPLv2+

by Kevin Langley

22/07 2014

0.0.2

0.0.2.0

WordPress plugin that allows a developer to easily extend the contextual help dropdown content area in WordPress

  Sources   Download

GPLv2+

by Kevin Langley

22/07 2014

0.0.1

0.0.1.0

WordPress plugin that allows a developer to easily extend the contextual help dropdown content area in WordPress

  Sources   Download

GPLv2+

by Kevin Langley