Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[starter] [symlink] Symlink SDK relative path "calculation" enhancement. #785

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions start.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*
* @var string
*/
$this_sdk_version = '2.11.0';
$this_sdk_version = '2.11.0.1';

#region SDK Selection Logic --------------------------------------------------------------------

Expand Down Expand Up @@ -128,12 +128,16 @@ function_exists( 'wp_is_json_request' ) &&
* The check of `fs_find_direct_caller_plugin_file` determines that this file was indeed included by a different plugin than the main plugin.
*/
if ( DIRECTORY_SEPARATOR . $this_sdk_relative_path === $fs_root_path && function_exists( 'fs_find_direct_caller_plugin_file' ) ) {
$original_plugin_dir_name = dirname( fs_find_direct_caller_plugin_file( $file_path ) );
$direct_caller_plugin_file = fs_find_direct_caller_plugin_file( $file_path );

// Remove everything before the original plugin directory name.
$this_sdk_relative_path = substr( $this_sdk_relative_path, strpos( $this_sdk_relative_path, $original_plugin_dir_name ) );
if ( ! empty( $direct_caller_plugin_file ) ) {
$original_plugin_dir_name = dirname( $direct_caller_plugin_file );

unset( $original_plugin_dir_name );
// Remove everything before the original plugin directory name.
$this_sdk_relative_path = substr( $this_sdk_relative_path, strpos( $this_sdk_relative_path, $original_plugin_dir_name ) );

unset( $original_plugin_dir_name );
}
}
}

Expand Down