{"id":30725,"date":"2014-07-22T03:03:23","date_gmt":"2014-07-22T03:03:23","guid":{"rendered":"https:\/\/wordpress.org\/plugins-wp\/wp-contextual-help\/"},"modified":"2015-01-05T18:47:44","modified_gmt":"2015-01-05T18:47:44","slug":"wp-contextual-help","status":"publish","type":"plugin","link":"https:\/\/wordpress.org\/plugins\/wp-contextual-help\/","author":8436840,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.2","stable_tag":"1.0.2","tested":"4.1.42","requires":"3.3","requires_php":"","requires_plugins":"","header_name":"WP Contextual Help","header_author":"kevinlangleyjr","header_description":"","assets_banners_color":"d94965","last_updated":"2015-01-05 18:47:44","external_support_url":"","external_repository_url":"","donate_link":"http:\/\/voceplatforms.com\/","header_plugin_uri":"http:\/\/voceplatforms.com","header_author_uri":"","rating":0,"author_block_rating":0,"active_installs":0,"downloads":1200,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","changelog"],"tags":[],"upgrade_notice":[],"ratings":{"1":0,"2":0,"3":0,"4":0,"5":0},"assets_icons":[],"assets_banners":{"banner-1154x500.png":{"filename":"banner-1154x500.png","revision":"952541","resolution":"1154x500","location":"assets","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":"952541","resolution":"772x250","location":"assets","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["0.0.1","0.0.2","0.0.3","1.0.0","1.0.1","1.0.2"],"block_files":[],"assets_screenshots":[],"screenshots":{"1":"Example display of a custom help tab"}},"plugin_section":[],"plugin_tags":[2639,3066],"plugin_category":[],"plugin_contributors":[],"plugin_business_model":[],"class_list":["post-30725","plugin","type-plugin","status-publish","hentry","plugin_tags-contextual","plugin_tags-help","plugin_committers-kevinlangleyjr"],"banners":{"banner":"https:\/\/ps.w.org\/wp-contextual-help\/assets\/banner-772x250.png?rev=952541","banner_2x":false,"banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/s.w.org\/plugins\/geopattern-icon\/wp-contextual-help_d94965.svg","icon_2x":false,"generated":true},"screenshots":[],"raw_content":"<!--section=description-->\n<p>Adds helper functionality to easily add to the WP Contextual Help throughout the admin of a WordPress site.<\/p>\n <h4>Usage<\/h4>\n <p>When you register a tab you have a few different options as far as what content is displayed there.<\/p>\n <p>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.<\/p>\n <p>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.<\/p>\n <p>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 <code>post-management<\/code> it would look for <code>post-management.html<\/code> within the help docs directory.<\/p>\n <h4>HTML Help Docs<\/h4>\n <p>All help docs should either reside within the <code>get_template_directory() . '\/includes\/help-docs\/';<\/code> directory and all images within the <code>get_template_directory() . '\/includes\/help-docs\/img\/';<\/code><\/p>\n <p>You can use the <code>wp_contextual_help_docs_dir<\/code> filter to change the directory for the HTML files and the <code>wp_contextual_help_docs_url<\/code> filter to change the base URL for the images. Within your help documentation we use the variable <code>{WP_HELP_IMG_URL}<\/code> 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.<\/p>\n <h4>Registering a tab<\/h4>\n <p>Help tabs are registered using the <code>WP_Contextual_Help::register_tab()<\/code> method.<\/p>\n <p><strong>Parameters<\/strong><\/p>\n <ul>\n<li><code>$id<\/code> (string) - String to be used as the ID for the help tab<\/li>\n<li><code>$title<\/code> (string) - Title to display to the user within the tab<\/li>\n<li><code>$args<\/code> (array) - An array of options for the help tab  <ul>\n<li><code>page<\/code> (string, array) - Page(s) to enable the help tab<\/li>\n<li><code>post_type<\/code> (string, array) - Limit the tab to only display on these specific post types<\/li>\n<li><code>file<\/code> (string) - HTML file to read and output within the tab<\/li>\n<li><code>wpautop<\/code> (boolean) - Default: False - Apply wpautop to the loaded HTML file<\/li>\n<li><code>callback<\/code> - If a user would rather a custom callback instead of the autoloading of a HTML file, this is where that would be applied<\/li>\n<\/ul><\/li>\n<\/ul>\n <h4>Example<\/h4>\n <pre><code>&lt;?php  add_action( 'init', function(){      if( !class_exists( 'WP_Contextual_Help' ) )         return;      \/\/ Only display on the pages - post.php and post-new.php, but only on the post post_type     \/\/ This would automatically look for a file called post-management.html within get_template_directory() . '\/includes\/help-docs\/';     WP_Contextual_Help::register_tab( 'post-management', 'Post Management', array(         'page' =&gt; array( 'post.php', 'post-new.php' ),         'post_type' =&gt; 'post',         'wpautop' =&gt; true     ) );      \/\/ Add to a custom admin page     WP_Contextual_Help::register_tab( 'custom-settings', 'Custom Settings', array(         'page' =&gt; 'settings_page_custom-settings-page',         'wpautop' =&gt; true     ) );      \/\/ Add help tab with custom callback     WP_Contextual_Help::register_tab( 'custom-callback', 'Custom Callback Example', array(         'page' =&gt; array( 'post.php', 'post-new.php' ),         'post_type' =&gt; 'post',         'callback' =&gt; function( $screen, $tab ) {             echo '&lt;p&gt;It is super easy to add new help tabs!&lt;\/p&gt;';         }     ) ); } ); ?&gt; <\/code><\/pre>\n\n<!--section=installation-->\n<h4>As standard plugin:<\/h4>\n <blockquote>\n  <p>See <a href=\"http:\/\/codex.wordpress.org\/Managing_Plugins#Installing_Plugins\">Installing Plugins<\/a>.<\/p>\n<\/blockquote>\n <h4>As theme or plugin dependency:<\/h4>\n <blockquote>\n  <p>After dropping the plugin into the containing theme or plugin, add the following:<\/p>\n<\/blockquote>\n <pre><code>if( ! class_exists( 'WP_Contextual_Help' ) ) {     require_once( $path_to_help . '\/wp-contextual-help.php' ); } <\/code><\/pre>\n <h4>As a composer dependency<\/h4>\n <p>Add the following to your composer.json required dependencies<\/p>\n <pre><code>{     \/\/ ...     \"require\": {         \"voceconnect\/wp-contextual-help\": \"~0.0.1\"  \/\/ Most recent tagged version     },     \/\/ ... } <\/code><\/pre>\n\n<!--section=changelog-->\n<p>Please refer to full changelog at https:\/\/github.com\/voceconnect\/wp-contextual-help\/releases.<\/p>","raw_excerpt":"Allows a developer to easily extend the contextual help dropdown content area in WordPress.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/30725","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=30725"}],"author":[{"embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/kevinlangleyjr"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=30725"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=30725"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=30725"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=30725"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=30725"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=30725"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}