Skip to content

Commit

Permalink
INT-2694 Change the variable name from hide_admin_bar to si_preview
Browse files Browse the repository at this point in the history
  • Loading branch information
fsvalmeida committed Feb 27, 2023
1 parent 0726c9e commit dca565f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<exclude name="Squiz.Commenting.FileComment.SpacingAfterComment"/>
</rule>

<!--For Windows users that may have problems with EOL. If you are not using windows please coment the code bellow-->
<!-- For Windows users that may have problems with EOL. If you are not using Windows please comment out the code below -->
<rule ref="Generic.Files.LineEndings">
<exclude name="Generic.Files.LineEndings.InvalidEOLChar"/>
</rule>
Expand Down
2 changes: 1 addition & 1 deletion siteimprove/admin/js/siteimprove.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
const newDiv = document.createElement("div");
newDiv.setAttribute("id","div_iframe");
document.body.appendChild(newDiv);
let string_test = "<iframe id='domIframe' src="+ url.concat("&hide_admin_bar=1") +" style='height:100vh; width:100%'></iframe>";
let string_test = "<iframe id='domIframe' src="+ url.concat("&si_preview=1") +" style='height:100vh; width:100%'></iframe>";
document.getElementById("div_iframe").innerHTML = string_test.replace(/&amp;/g , "&");

var promise = new Promise(function (resolve, reject) {
Expand Down
2 changes: 1 addition & 1 deletion siteimprove/includes/class-siteimprove.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private function define_admin_hooks() {
$this->loader->add_action( 'siteimprove_before_settings_form', $plugin_admin, 'siteimprove_before_settings_form' );

// Siteimprove Actions.
if ( ! isset( $_GET['hide_admin_bar'] ) || '0' === $_GET['hide_admin_bar'] ) {
if ( ! isset( $_GET['si_preview'] ) || '0' === $_GET['si_preview'] ) {
$this->loader->add_action( 'admin_init', $plugin_admin, 'siteimprove_init' );
$this->loader->add_action( 'publish_page', $plugin_admin, 'siteimprove_save_session_url_post' );
$this->loader->add_action( 'publish_post', $plugin_admin, 'siteimprove_save_session_url_post' );
Expand Down
8 changes: 4 additions & 4 deletions siteimprove/siteimprove.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@
die;
}

/** Hide the WordPress admin bar when the `hide_admin_bar` parameter is present. */
function custom_preview_hide_admin_bar() {
if ( isset( $_GET['hide_admin_bar'] ) && '1' === $_GET['hide_admin_bar'] ) {
/** Hide the WordPress admin bar when the `si_preview` parameter is present. */
function custom_preview_si_preview() {
if ( isset( $_GET['si_preview'] ) && '1' === $_GET['si_preview'] ) {
add_filter( 'show_admin_bar', '__return_false' );
}
}
add_action( 'parse_query', 'custom_preview_hide_admin_bar' );
add_action( 'parse_query', 'custom_preview_si_preview' );

/**
* Include SiteimproveUtils class.
Expand Down

0 comments on commit dca565f

Please sign in to comment.