Skip to content

Commit

Permalink
Merge branch 'trunk' into enhance/wordpress-branding
Browse files Browse the repository at this point in the history
  • Loading branch information
Yashita committed Apr 26, 2023
2 parents dc19b0f + 8f356fa commit 5b73bb4
Show file tree
Hide file tree
Showing 65 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function nfd_wp_module_onboarding_register() {

// Set Global Constants
if ( ! defined( 'NFD_ONBOARDING_VERSION' ) ) {
define( 'NFD_ONBOARDING_VERSION', '1.4.0' );
define( 'NFD_ONBOARDING_VERSION', '1.4.1' );
}
if ( ! defined( 'NFD_ONBOARDING_DIR' ) ) {
define( 'NFD_ONBOARDING_DIR', __DIR__ );
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion includes/Data/Patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public static function get_pattern_from_slug( $pattern_slug ) {
*/
private static function replace_header_menu_slug( $patterns, $header_menu_slug ) {
foreach ( $patterns as $slug => $slug_details ) {
if ( true === $slug_details['replace'] ) {
if ( isset( $slug_details['replace'] ) && true === $slug_details['replace'] ) {
unset( $patterns[ $slug ] );
$patterns = array_merge( array( $header_menu_slug => $slug_details ), $patterns );
}
Expand Down
7 changes: 6 additions & 1 deletion includes/RestApi/RestApiFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace NewfoldLabs\WP\Module\Onboarding\RestApi;

use NewfoldLabs\WP\Module\Onboarding\Data\Patterns;
use NewfoldLabs\WP\Module\Onboarding\WP_Admin;

/**
* Instantiate controllers and register routes.
Expand Down Expand Up @@ -131,7 +132,11 @@ public static function header_menu_rename_pages( $response, array $handler, \WP_
* @return boolean
*/
public static function is_request_from_onboarding_flow( \WP_REST_Request $request ) {
return false !== stripos( $request->get_header( 'referer' ), 'page=nfd-onboarding' );
$referrer = $request->get_header( 'referer' );
if ( ! $referrer ) {
return false;
}
return false !== stripos( $referrer, 'page=' . WP_Admin::$slug );
}

/**
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@newfold-labs/wp-module-onboarding",
"version": "1.4.0",
"version": "1.4.1",
"description": "Next-generation WordPress Onboarding for WordPress sites at Newfold Digital.",
"license": "GPL-2.0-or-later",
"private": true,
Expand Down

0 comments on commit 5b73bb4

Please sign in to comment.