Skip to content

Commit

Permalink
Merge pull request #4 from marc-gade/master
Browse files Browse the repository at this point in the history
Fix v1.2
ArnaudBan authored Apr 9, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 2dc52b2 + d871ffb commit bc59c0a
Showing 3 changed files with 42 additions and 35 deletions.
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
@@ -15,10 +15,10 @@
],
"require": {
"erusev/parsedown": "^1.7",
"pagerange/metaparsedown": "^1.0"
}
,
"pagerange/metaparsedown": "^1.0",
"php": ">=7.3.0"
},
"require-dev": {
"roave/security-advisories": "dev-master"
}
}
}
58 changes: 32 additions & 26 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 6 additions & 5 deletions wp-doc-viewer.php
Original file line number Diff line number Diff line change
@@ -192,8 +192,9 @@ public function add_documentation_content_page(): void
private function toc()
{

$section = $_GET['page'];
$file = $_GET['file'];
$section = $_GET['page'] ?? null;
$file = $_GET['file'] ?? null;


if( $section === 'site-user-documentation' ){
$section = array_key_first( $this->order_sections );
@@ -257,7 +258,7 @@ public function add_single_page_contextual_help(): void

if ( $screen ){

$child_page_slug = array_keys( $this->child_page );
$child_page_slug = array_keys( $this->doc_pages );

$page_slug = false;

@@ -309,7 +310,7 @@ public function add_archive_page_contextual_help(): void

if( $screen ){

$child_page_slug = array_keys( $this->child_page );
$child_page_slug = array_keys( $this->doc_pages );

$page_slug = false;

@@ -344,7 +345,7 @@ private function add_contextual_help( WP_Screen $screen, string $page_slug ): vo

$screen->add_help_tab( array(
'id' => 'doc_viewer_' . $page_slug,
'title' => $this->child_page[ $page_slug ],
'title' => $this->doc_pages[ $page_slug ],
'content' => $parsedown->text( $doc_content ),
) );
}

0 comments on commit bc59c0a

Please sign in to comment.