???PK ! S S Diff/Engine/shell.phpnu [
* @package Text_Diff
* @since 0.3.0
*/
class Text_Diff_Engine_shell {
/**
* Path to the diff executable
*
* @var string
*/
var $_diffCommand = 'diff';
/**
* Returns the array of differences.
*
* @param array $from_lines lines of text from old file
* @param array $to_lines lines of text from new file
*
* @return array all changes made (array with Text_Diff_Op_* objects)
*/
function diff($from_lines, $to_lines)
{
array_walk($from_lines, array('Text_Diff', 'trimNewlines'));
array_walk($to_lines, array('Text_Diff', 'trimNewlines'));
$temp_dir = Text_Diff::_getTempDir();
// Execute gnu diff or similar to get a standard diff file.
$from_file = tempnam($temp_dir, 'Text_Diff');
$to_file = tempnam($temp_dir, 'Text_Diff');
$fp = fopen($from_file, 'w');
fwrite($fp, implode("\n", $from_lines));
fclose($fp);
$fp = fopen($to_file, 'w');
fwrite($fp, implode("\n", $to_lines));
fclose($fp);
$diff = shell_exec($this->_diffCommand . ' ' . $from_file . ' ' . $to_file);
unlink($from_file);
unlink($to_file);
if (is_null($diff)) {
// No changes were made
return array(new Text_Diff_Op_copy($from_lines));
}
$from_line_no = 1;
$to_line_no = 1;
$edits = array();
// Get changed lines by parsing something like:
// 0a1,2
// 1,2c4,6
// 1,5d6
preg_match_all('#^(\d+)(?:,(\d+))?([adc])(\d+)(?:,(\d+))?$#m', $diff,
$matches, PREG_SET_ORDER);
foreach ($matches as $match) {
if (!isset($match[5])) {
// This paren is not set every time (see regex).
$match[5] = false;
}
if ($match[3] == 'a') {
$from_line_no--;
}
if ($match[3] == 'd') {
$to_line_no--;
}
if ($from_line_no < $match[1] || $to_line_no < $match[4]) {
// copied lines
assert($match[1] - $from_line_no == $match[4] - $to_line_no);
array_push($edits,
new Text_Diff_Op_copy(
$this->_getLines($from_lines, $from_line_no, $match[1] - 1),
$this->_getLines($to_lines, $to_line_no, $match[4] - 1)));
}
switch ($match[3]) {
case 'd':
// deleted lines
array_push($edits,
new Text_Diff_Op_delete(
$this->_getLines($from_lines, $from_line_no, $match[2])));
$to_line_no++;
break;
case 'c':
// changed lines
array_push($edits,
new Text_Diff_Op_change(
$this->_getLines($from_lines, $from_line_no, $match[2]),
$this->_getLines($to_lines, $to_line_no, $match[5])));
break;
case 'a':
// added lines
array_push($edits,
new Text_Diff_Op_add(
$this->_getLines($to_lines, $to_line_no, $match[5])));
$from_line_no++;
break;
}
}
if (!empty($from_lines)) {
// Some lines might still be pending. Add them as copied
array_push($edits,
new Text_Diff_Op_copy(
$this->_getLines($from_lines, $from_line_no,
$from_line_no + count($from_lines) - 1),
$this->_getLines($to_lines, $to_line_no,
$to_line_no + count($to_lines) - 1)));
}
return $edits;
}
/**
* Get lines from either the old or new text
*
* @access private
*
* @param array $text_lines Either $from_lines or $to_lines (passed by reference).
* @param int $line_no Current line number (passed by reference).
* @param int $end Optional end line, when we want to chop more
* than one line.
*
* @return array The chopped lines
*/
function _getLines(&$text_lines, &$line_no, $end = false)
{
if (!empty($end)) {
$lines = array();
// We can shift even more
while ($line_no <= $end) {
array_push($lines, array_shift($text_lines));
$line_no++;
}
} else {
$lines = array(array_shift($text_lines));
$line_no++;
}
return $lines;
}
}
PK ! Eћ Diff/Engine/string.phpnu [
* $patch = file_get_contents('example.patch');
* $diff = new Text_Diff('string', array($patch));
* $renderer = new Text_Diff_Renderer_inline();
* echo $renderer->render($diff);
*
*
* Copyright 2005 Örjan Persson ';
/**
* Suffix for deleted text.
*
* @var string
*/
var $_del_suffix = '';
/**
* Header for each change block.
*
* @var string
*/
var $_block_header = '';
/**
* Whether to split down to character-level.
*
* @var boolean
*/
var $_split_characters = false;
/**
* What are we currently splitting on? Used to recurse to show word-level
* or character-level changes.
*
* @var string
*/
var $_split_level = 'lines';
function _blockHeader($xbeg, $xlen, $ybeg, $ylen)
{
return $this->_block_header;
}
function _startBlock($header)
{
return $header;
}
function _lines($lines, $prefix = ' ', $encode = true)
{
if ($encode) {
array_walk($lines, array(&$this, '_encode'));
}
if ($this->_split_level == 'lines') {
return implode("\n", $lines) . "\n";
} else {
return implode('', $lines);
}
}
function _added($lines)
{
array_walk($lines, array(&$this, '_encode'));
$lines[0] = $this->_ins_prefix . $lines[0];
$lines[count($lines) - 1] .= $this->_ins_suffix;
return $this->_lines($lines, ' ', false);
}
function _deleted($lines, $words = false)
{
array_walk($lines, array(&$this, '_encode'));
$lines[0] = $this->_del_prefix . $lines[0];
$lines[count($lines) - 1] .= $this->_del_suffix;
return $this->_lines($lines, ' ', false);
}
function _changed($orig, $final)
{
/* If we've already split on characters, just display. */
if ($this->_split_level == 'characters') {
return $this->_deleted($orig)
. $this->_added($final);
}
/* If we've already split on words, just display. */
if ($this->_split_level == 'words') {
$prefix = '';
while ($orig[0] !== false && $final[0] !== false &&
substr($orig[0], 0, 1) == ' ' &&
substr($final[0], 0, 1) == ' ') {
$prefix .= substr($orig[0], 0, 1);
$orig[0] = substr($orig[0], 1);
$final[0] = substr($final[0], 1);
}
return $prefix . $this->_deleted($orig) . $this->_added($final);
}
$text1 = implode("\n", $orig);
$text2 = implode("\n", $final);
/* Non-printing newline marker. */
$nl = "\0";
if ($this->_split_characters) {
$diff = new Text_Diff('native',
array(preg_split('//', $text1),
preg_split('//', $text2)));
} else {
/* We want to split on word boundaries, but we need to preserve
* whitespace as well. Therefore we split on words, but include
* all blocks of whitespace in the wordlist. */
$diff = new Text_Diff('native',
array($this->_splitOnWords($text1, $nl),
$this->_splitOnWords($text2, $nl)));
}
/* Get the diff in inline format. */
$renderer = new Text_Diff_Renderer_inline
(array_merge($this->getParams(),
array('split_level' => $this->_split_characters ? 'characters' : 'words')));
/* Run the diff and get the output. */
return str_replace($nl, "\n", $renderer->render($diff)) . "\n";
}
function _splitOnWords($string, $newlineEscape = "\n")
{
// Ignore \0; otherwise the while loop will never finish.
$string = str_replace("\0", '', $string);
$words = array();
$length = strlen($string);
$pos = 0;
while ($pos < $length) {
// Eat a word with any preceding whitespace.
$spaces = strspn(substr($string, $pos), " \n");
$nextpos = strcspn(substr($string, $pos + $spaces), " \n");
$words[] = str_replace("\n", $newlineEscape, substr($string, $pos, $spaces + $nextpos));
$pos += $spaces + $nextpos;
}
return $words;
}
function _encode(&$string)
{
$string = htmlspecialchars($string);
}
}
PK ! A. . Diff.phpnu ȯ , and is used/adapted with his permission.
*
* Copyright 2004 Geoffrey T. Dairiki
* $diff = new Text_Diff($lines1, $lines2);
* $rev = $diff->reverse();
*
*
* @return Text_Diff A Diff object representing the inverse of the
* original diff. Note that we purposely don't return a
* reference here, since this essentially is a clone()
* method.
*/
function reverse()
{
if (version_compare(zend_version(), '2', '>')) {
$rev = clone($this);
} else {
$rev = $this;
}
$rev->_edits = array();
foreach ($this->_edits as $edit) {
$rev->_edits[] = $edit->reverse();
}
return $rev;
}
/**
* Checks for an empty diff.
*
* @return bool True if two sequences were identical.
*/
function isEmpty()
{
foreach ($this->_edits as $edit) {
if (!is_a($edit, 'Text_Diff_Op_copy')) {
return false;
}
}
return true;
}
/**
* Computes the length of the Longest Common Subsequence (LCS).
*
* This is mostly for diagnostic purposes.
*
* @return int The length of the LCS.
*/
function lcs()
{
$lcs = 0;
foreach ($this->_edits as $edit) {
if (is_a($edit, 'Text_Diff_Op_copy')) {
$lcs += count($edit->orig);
}
}
return $lcs;
}
/**
* Gets the original set of lines.
*
* This reconstructs the $from_lines parameter passed to the constructor.
*
* @return array The original sequence of strings.
*/
function getOriginal()
{
$lines = array();
foreach ($this->_edits as $edit) {
if ($edit->orig) {
array_splice($lines, count($lines), 0, $edit->orig);
}
}
return $lines;
}
/**
* Gets the final set of lines.
*
* This reconstructs the $to_lines parameter passed to the constructor.
*
* @return array The sequence of strings.
*/
function getFinal()
{
$lines = array();
foreach ($this->_edits as $edit) {
if ($edit->final) {
array_splice($lines, count($lines), 0, $edit->final);
}
}
return $lines;
}
/**
* Removes trailing newlines from a line of text. This is meant to be used
* with array_walk().
*
* @param string $line The line to trim.
* @param int $key The index of the line in the array. Not used.
*/
static function trimNewlines(&$line, $key)
{
$line = str_replace(array("\n", "\r"), '', $line);
}
/**
* Determines the location of the system temporary directory.
*
* @access protected
*
* @return string A directory name which can be used for temp files.
*/
static function _getTempDir()
{
return get_temp_dir();
}
/**
* Checks a diff for validity.
*
* This is here only for debugging purposes.
*/
function _check($from_lines, $to_lines)
{
if (serialize($from_lines) != serialize($this->getOriginal())) {
throw new Text_Exception("Reconstructed original does not match");
}
if (serialize($to_lines) != serialize($this->getFinal())) {
throw new Text_Exception("Reconstructed final does not match");
}
$rev = $this->reverse();
if (serialize($to_lines) != serialize($rev->getOriginal())) {
throw new Text_Exception("Reversed original does not match");
}
if (serialize($from_lines) != serialize($rev->getFinal())) {
throw new Text_Exception("Reversed final does not match");
}
$prevtype = null;
foreach ($this->_edits as $edit) {
if ($prevtype !== null && $edit instanceof $prevtype) {
throw new Text_Exception("Edit sequence is non-optimal");
}
$prevtype = get_class($edit);
}
return true;
}
}
/**
* @package Text_Diff
* @author Geoffrey T. Dairiki
' . __( 'The Dashboard is the first place you will come to every time you log into your site. It is where you will find all your WordPress tools. If you need help, just click the “Help” tab above the screen title.' ) . '
'; $screen = get_current_screen(); $screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); // Help tabs. $help = '' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '
'; $help .= '' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-navigation', 'title' => __( 'Navigation' ), 'content' => $help, ) ); $help = '' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '
'; $help .= '' . __( 'Screen Options — Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '
'; $help .= '' . __( 'Drag and Drop — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '
'; $help .= '' . __( 'Box Controls — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-layout', 'title' => __( 'Layout' ), 'content' => $help, ) ); $help = '' . __( 'The boxes on your Dashboard screen are:' ) . '
'; if ( current_user_can( 'edit_theme_options' ) ) { $help .= '' . __( 'Welcome — Shows links for some of the most common tasks when setting up a new site.' ) . '
'; } if ( current_user_can( 'view_site_health_checks' ) ) { $help .= '' . __( 'Site Health Status — Informs you of any potential issues that should be addressed to improve the performance or security of your website.' ) . '
'; } if ( current_user_can( 'edit_posts' ) ) { $help .= '' . __( 'At a Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '
'; } $help .= '' . __( 'Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '
'; if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { $help .= '' . __( "Quick Draft — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '
'; } $help .= '' . sprintf( /* translators: %s: WordPress Planet URL. */ __( 'WordPress Events and News — Upcoming events near you as well as the latest news from the official WordPress project and the WordPress Planet.' ), __( 'https://planet.wordpress.org/' ) ) . '
'; $screen->add_help_tab( array( 'id' => 'help-content', 'title' => __( 'Content' ), 'content' => $help, ) ); unset( $help ); $wp_version = get_bloginfo( 'version', 'display' ); /* translators: %s: WordPress version. */ $wp_version_text = sprintf( __( 'Version %s' ), $wp_version ); $is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version ); if ( ! $is_dev_version ) { $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $wp_version_text = sprintf( '%2$s', $version_url, $wp_version_text ); } $screen->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Dashboard' ) . '
' . '' . __( 'Support forums' ) . '
' . '' . $wp_version_text . '
' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>' . __( 'The Dashboard is the first place you will come to every time you log into your site. It is where you will find all your WordPress tools. If you need help, just click the “Help” tab above the screen title.' ) . '
'; $screen = get_current_screen(); $screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); // Help tabs. $help = '' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '
'; $help .= '' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-navigation', 'title' => __( 'Navigation' ), 'content' => $help, ) ); $help = '' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '
'; $help .= '' . __( 'Screen Options — Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '
'; $help .= '' . __( 'Drag and Drop — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '
'; $help .= '' . __( 'Box Controls — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-layout', 'title' => __( 'Layout' ), 'content' => $help, ) ); $help = '' . __( 'The boxes on your Dashboard screen are:' ) . '
'; if ( current_user_can( 'edit_theme_options' ) ) { $help .= '' . __( 'Welcome — Shows links for some of the most common tasks when setting up a new site.' ) . '
'; } if ( current_user_can( 'view_site_health_checks' ) ) { $help .= '' . __( 'Site Health Status — Informs you of any potential issues that should be addressed to improve the performance or security of your website.' ) . '
'; } if ( current_user_can( 'edit_posts' ) ) { $help .= '' . __( 'At a Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '
'; } $help .= '' . __( 'Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '
'; if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { $help .= '' . __( "Quick Draft — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '
'; } $help .= '' . sprintf( /* translators: %s: WordPress Planet URL. */ __( 'WordPress Events and News — Upcoming events near you as well as the latest news from the official WordPress project and the WordPress Planet.' ), __( 'https://planet.wordpress.org/' ) ) . '
'; $screen->add_help_tab( array( 'id' => 'help-content', 'title' => __( 'Content' ), 'content' => $help, ) ); unset( $help ); $wp_version = get_bloginfo( 'version', 'display' ); /* translators: %s: WordPress version. */ $wp_version_text = sprintf( __( 'Version %s' ), $wp_version ); $is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version ); if ( ! $is_dev_version ) { $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $wp_version_text = sprintf( '%2$s', $version_url, $wp_version_text ); } $screen->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Dashboard' ) . '
' . '' . __( 'Support forums' ) . '
' . '' . $wp_version_text . '
' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>' . __( 'The Dashboard is the first place you will come to every time you log into your site. It is where you will find all your WordPress tools. If you need help, just click the “Help” tab above the screen title.' ) . '
'; $screen = get_current_screen(); $screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); // Help tabs. $help = '' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '
'; $help .= '' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-navigation', 'title' => __( 'Navigation' ), 'content' => $help, ) ); $help = '' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '
'; $help .= '' . __( 'Screen Options — Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '
'; $help .= '' . __( 'Drag and Drop — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '
'; $help .= '' . __( 'Box Controls — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-layout', 'title' => __( 'Layout' ), 'content' => $help, ) ); $help = '' . __( 'The boxes on your Dashboard screen are:' ) . '
'; if ( current_user_can( 'edit_theme_options' ) ) { $help .= '' . __( 'Welcome — Shows links for some of the most common tasks when setting up a new site.' ) . '
'; } if ( current_user_can( 'view_site_health_checks' ) ) { $help .= '' . __( 'Site Health Status — Informs you of any potential issues that should be addressed to improve the performance or security of your website.' ) . '
'; } if ( current_user_can( 'edit_posts' ) ) { $help .= '' . __( 'At a Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '
'; } $help .= '' . __( 'Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '
'; if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { $help .= '' . __( "Quick Draft — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '
'; } $help .= '' . sprintf( /* translators: %s: WordPress Planet URL. */ __( 'WordPress Events and News — Upcoming events near you as well as the latest news from the official WordPress project and the WordPress Planet.' ), __( 'https://planet.wordpress.org/' ) ) . '
'; $screen->add_help_tab( array( 'id' => 'help-content', 'title' => __( 'Content' ), 'content' => $help, ) ); unset( $help ); $wp_version = get_bloginfo( 'version', 'display' ); /* translators: %s: WordPress version. */ $wp_version_text = sprintf( __( 'Version %s' ), $wp_version ); $is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version ); if ( ! $is_dev_version ) { $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $wp_version_text = sprintf( '%2$s', $version_url, $wp_version_text ); } $screen->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Dashboard' ) . '
' . '' . __( 'Support forums' ) . '
' . '' . $wp_version_text . '
' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>' . __( 'The Dashboard is the first place you will come to every time you log into your site. It is where you will find all your WordPress tools. If you need help, just click the “Help” tab above the screen title.' ) . '
'; $screen = get_current_screen(); $screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); // Help tabs. $help = '' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '
'; $help .= '' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-navigation', 'title' => __( 'Navigation' ), 'content' => $help, ) ); $help = '' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '
'; $help .= '' . __( 'Screen Options — Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '
'; $help .= '' . __( 'Drag and Drop — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '
'; $help .= '' . __( 'Box Controls — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-layout', 'title' => __( 'Layout' ), 'content' => $help, ) ); $help = '' . __( 'The boxes on your Dashboard screen are:' ) . '
'; if ( current_user_can( 'edit_theme_options' ) ) { $help .= '' . __( 'Welcome — Shows links for some of the most common tasks when setting up a new site.' ) . '
'; } if ( current_user_can( 'view_site_health_checks' ) ) { $help .= '' . __( 'Site Health Status — Informs you of any potential issues that should be addressed to improve the performance or security of your website.' ) . '
'; } if ( current_user_can( 'edit_posts' ) ) { $help .= '' . __( 'At a Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '
'; } $help .= '' . __( 'Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '
'; if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { $help .= '' . __( "Quick Draft — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '
'; } $help .= '' . sprintf( /* translators: %s: WordPress Planet URL. */ __( 'WordPress Events and News — Upcoming events near you as well as the latest news from the official WordPress project and the WordPress Planet.' ), __( 'https://planet.wordpress.org/' ) ) . '
'; $screen->add_help_tab( array( 'id' => 'help-content', 'title' => __( 'Content' ), 'content' => $help, ) ); unset( $help ); $wp_version = get_bloginfo( 'version', 'display' ); /* translators: %s: WordPress version. */ $wp_version_text = sprintf( __( 'Version %s' ), $wp_version ); $is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version ); if ( ! $is_dev_version ) { $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $wp_version_text = sprintf( '%2$s', $version_url, $wp_version_text ); } $screen->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Dashboard' ) . '
' . '' . __( 'Support forums' ) . '
' . '' . $wp_version_text . '
' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>' . __( 'The Dashboard is the first place you will come to every time you log into your site. It is where you will find all your WordPress tools. If you need help, just click the “Help” tab above the screen title.' ) . '
'; $screen = get_current_screen(); $screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); // Help tabs. $help = '' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '
'; $help .= '' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-navigation', 'title' => __( 'Navigation' ), 'content' => $help, ) ); $help = '' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '
'; $help .= '' . __( 'Screen Options — Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '
'; $help .= '' . __( 'Drag and Drop — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '
'; $help .= '' . __( 'Box Controls — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-layout', 'title' => __( 'Layout' ), 'content' => $help, ) ); $help = '' . __( 'The boxes on your Dashboard screen are:' ) . '
'; if ( current_user_can( 'edit_theme_options' ) ) { $help .= '' . __( 'Welcome — Shows links for some of the most common tasks when setting up a new site.' ) . '
'; } if ( current_user_can( 'view_site_health_checks' ) ) { $help .= '' . __( 'Site Health Status — Informs you of any potential issues that should be addressed to improve the performance or security of your website.' ) . '
'; } if ( current_user_can( 'edit_posts' ) ) { $help .= '' . __( 'At a Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '
'; } $help .= '' . __( 'Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '
'; if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { $help .= '' . __( "Quick Draft — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '
'; } $help .= '' . sprintf( /* translators: %s: WordPress Planet URL. */ __( 'WordPress Events and News — Upcoming events near you as well as the latest news from the official WordPress project and the WordPress Planet.' ), __( 'https://planet.wordpress.org/' ) ) . '
'; $screen->add_help_tab( array( 'id' => 'help-content', 'title' => __( 'Content' ), 'content' => $help, ) ); unset( $help ); $wp_version = get_bloginfo( 'version', 'display' ); /* translators: %s: WordPress version. */ $wp_version_text = sprintf( __( 'Version %s' ), $wp_version ); $is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version ); if ( ! $is_dev_version ) { $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $wp_version_text = sprintf( '%2$s', $version_url, $wp_version_text ); } $screen->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Dashboard' ) . '
' . '' . __( 'Support forums' ) . '
' . '' . $wp_version_text . '
' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>' . __( 'The Dashboard is the first place you will come to every time you log into your site. It is where you will find all your WordPress tools. If you need help, just click the “Help” tab above the screen title.' ) . '
'; $screen = get_current_screen(); $screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); // Help tabs. $help = '' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '
'; $help .= '' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-navigation', 'title' => __( 'Navigation' ), 'content' => $help, ) ); $help = '' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '
'; $help .= '' . __( 'Screen Options — Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '
'; $help .= '' . __( 'Drag and Drop — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '
'; $help .= '' . __( 'Box Controls — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-layout', 'title' => __( 'Layout' ), 'content' => $help, ) ); $help = '' . __( 'The boxes on your Dashboard screen are:' ) . '
'; if ( current_user_can( 'edit_theme_options' ) ) { $help .= '' . __( 'Welcome — Shows links for some of the most common tasks when setting up a new site.' ) . '
'; } if ( current_user_can( 'view_site_health_checks' ) ) { $help .= '' . __( 'Site Health Status — Informs you of any potential issues that should be addressed to improve the performance or security of your website.' ) . '
'; } if ( current_user_can( 'edit_posts' ) ) { $help .= '' . __( 'At a Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '
'; } $help .= '' . __( 'Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '
'; if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { $help .= '' . __( "Quick Draft — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '
'; } $help .= '' . sprintf( /* translators: %s: WordPress Planet URL. */ __( 'WordPress Events and News — Upcoming events near you as well as the latest news from the official WordPress project and the WordPress Planet.' ), __( 'https://planet.wordpress.org/' ) ) . '
'; $screen->add_help_tab( array( 'id' => 'help-content', 'title' => __( 'Content' ), 'content' => $help, ) ); unset( $help ); $wp_version = get_bloginfo( 'version', 'display' ); /* translators: %s: WordPress version. */ $wp_version_text = sprintf( __( 'Version %s' ), $wp_version ); $is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version ); if ( ! $is_dev_version ) { $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $wp_version_text = sprintf( '%2$s', $version_url, $wp_version_text ); } $screen->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Dashboard' ) . '
' . '' . __( 'Support forums' ) . '
' . '' . $wp_version_text . '
' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>' . __( 'The Dashboard is the first place you will come to every time you log into your site. It is where you will find all your WordPress tools. If you need help, just click the “Help” tab above the screen title.' ) . '
'; $screen = get_current_screen(); $screen->add_help_tab( array( 'id' => 'overview', 'title' => __( 'Overview' ), 'content' => $help, ) ); // Help tabs. $help = '' . __( 'The left-hand navigation menu provides links to all of the WordPress administration screens, with submenu items displayed on hover. You can minimize this menu to a narrow icon strip by clicking on the Collapse Menu arrow at the bottom.' ) . '
'; $help .= '' . __( 'Links in the Toolbar at the top of the screen connect your dashboard and the front end of your site, and provide access to your profile and helpful WordPress information.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-navigation', 'title' => __( 'Navigation' ), 'content' => $help, ) ); $help = '' . __( 'You can use the following controls to arrange your Dashboard screen to suit your workflow. This is true on most other administration screens as well.' ) . '
'; $help .= '' . __( 'Screen Options — Use the Screen Options tab to choose which Dashboard boxes to show.' ) . '
'; $help .= '' . __( 'Drag and Drop — To rearrange the boxes, drag and drop by clicking on the title bar of the selected box and releasing when you see a gray dotted-line rectangle appear in the location you want to place the box.' ) . '
'; $help .= '' . __( 'Box Controls — Click the title bar of the box to expand or collapse it. Some boxes added by plugins may have configurable content, and will show a “Configure” link in the title bar if you hover over it.' ) . '
'; $screen->add_help_tab( array( 'id' => 'help-layout', 'title' => __( 'Layout' ), 'content' => $help, ) ); $help = '' . __( 'The boxes on your Dashboard screen are:' ) . '
'; if ( current_user_can( 'edit_theme_options' ) ) { $help .= '' . __( 'Welcome — Shows links for some of the most common tasks when setting up a new site.' ) . '
'; } if ( current_user_can( 'view_site_health_checks' ) ) { $help .= '' . __( 'Site Health Status — Informs you of any potential issues that should be addressed to improve the performance or security of your website.' ) . '
'; } if ( current_user_can( 'edit_posts' ) ) { $help .= '' . __( 'At a Glance — Displays a summary of the content on your site and identifies which theme and version of WordPress you are using.' ) . '
'; } $help .= '' . __( 'Activity — Shows the upcoming scheduled posts, recently published posts, and the most recent comments on your posts and allows you to moderate them.' ) . '
'; if ( is_blog_admin() && current_user_can( 'edit_posts' ) ) { $help .= '' . __( "Quick Draft — Allows you to create a new post and save it as a draft. Also displays links to the 3 most recent draft posts you've started." ) . '
'; } $help .= '' . sprintf( /* translators: %s: WordPress Planet URL. */ __( 'WordPress Events and News — Upcoming events near you as well as the latest news from the official WordPress project and the WordPress Planet.' ), __( 'https://planet.wordpress.org/' ) ) . '
'; $screen->add_help_tab( array( 'id' => 'help-content', 'title' => __( 'Content' ), 'content' => $help, ) ); unset( $help ); $wp_version = get_bloginfo( 'version', 'display' ); /* translators: %s: WordPress version. */ $wp_version_text = sprintf( __( 'Version %s' ), $wp_version ); $is_dev_version = preg_match( '/alpha|beta|RC/', $wp_version ); if ( ! $is_dev_version ) { $version_url = sprintf( /* translators: %s: WordPress version. */ esc_url( __( 'https://wordpress.org/documentation/wordpress-version/version-%s/' ) ), sanitize_title( $wp_version ) ); $wp_version_text = sprintf( '%2$s', $version_url, $wp_version_text ); } $screen->set_help_sidebar( '' . __( 'For more information:' ) . '
' . '' . __( 'Documentation on Dashboard' ) . '
' . '' . __( 'Support forums' ) . '
' . '' . $wp_version_text . '
' ); require_once ABSPATH . 'wp-admin/admin-header.php'; ?>