Skip to content

Instantly share code, notes, and snippets.

@DrewAPicture
Last active December 11, 2015 18:48
Show Gist options
  • Save DrewAPicture/4643880 to your computer and use it in GitHub Desktop.
Save DrewAPicture/4643880 to your computer and use it in GitHub Desktop.
Generally speaking, help tabs in core commonly follow one of the following three formats. Which should we use in a patch-making tutorial for the docs team?
<?php
/**
* Example format #1
*/
$example_string = '<p>' . __( 'This is some help text' ) . '</p>' .
'<p>' . __( 'This is some more help text' ) . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'example',
'title' => __( 'Example' ),
'content' => $example_string
) );
/**
* Example format #2
*/
$example_string = '<p>' . __( 'This is some help text' ) . '</p>';
$example_string .= '<p>' . __( 'This is some more help text' ) . '</p>';
get_current_screen()->add_help_tab( array(
'id' => 'example',
'title' => __( 'Example' ),
'content' => $example_string
) );
/**
* Example format #3
*/
get_current_screen()->add_help_tab( array(
'id' => 'example',
'title' => __( 'Example' ),
'content' => '<p>' . __( 'This is some help text' ) . '</p>' .
'<p>' . __( 'This is some more help text.' ) . '</p>'
) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment