diff --git src/wp-includes/link-template.php src/wp-includes/link-template.php
index dfd80f4..31373dc 100644
|
|
function content_url($path = '') { |
3158 | 3158 | */ |
3159 | 3159 | function plugins_url( $path = '', $plugin = '' ) { |
3160 | 3160 | |
| 3161 | $plugin = wp_get_plugin_realpath( $plugin ); |
| 3162 | |
3161 | 3163 | $path = wp_normalize_path( $path ); |
3162 | 3164 | $plugin = wp_normalize_path( $plugin ); |
3163 | 3165 | $mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR ); |
diff --git src/wp-includes/plugin.php src/wp-includes/plugin.php
index 1ec2497..815d582 100644
|
|
function remove_all_actions($tag, $priority = false) { |
667 | 667 | * |
668 | 668 | * @since 1.5.0 |
669 | 669 | * |
670 | | * @global array $wp_plugin_paths |
671 | | * |
672 | 670 | * @param string $file The filename of plugin. |
673 | 671 | * @return string The name of a plugin. |
674 | 672 | */ |
675 | 673 | function plugin_basename( $file ) { |
676 | | global $wp_plugin_paths; |
677 | | |
678 | | foreach ( $wp_plugin_paths as $dir => $realdir ) { |
679 | | if ( strpos( $file, $realdir ) === 0 ) { |
680 | | $file = $dir . substr( $file, strlen( $realdir ) ); |
681 | | } |
682 | | } |
683 | 674 | |
| 675 | $file = wp_get_plugin_realpath( $file ); |
684 | 676 | $file = wp_normalize_path( $file ); |
685 | 677 | $plugin_dir = wp_normalize_path( WP_PLUGIN_DIR ); |
686 | 678 | $mu_plugin_dir = wp_normalize_path( WPMU_PLUGIN_DIR ); |
… |
… |
function plugin_basename( $file ) { |
690 | 682 | return $file; |
691 | 683 | } |
692 | 684 | |
| 685 | |
693 | 686 | /** |
694 | 687 | * Register a plugin's real path. |
695 | 688 | * |
… |
… |
function wp_register_plugin_realpath( $file ) { |
732 | 725 | } |
733 | 726 | |
734 | 727 | /** |
| 728 | * Get the path of a symlinked plugin. |
| 729 | * |
| 730 | * This is used to return the target of a symlinked plugin that has been registered using wp_register_plugin_realpath. |
| 731 | * |
| 732 | * @since 4.3.1 |
| 733 | * |
| 734 | * @see plugin_basename() |
| 735 | * |
| 736 | * @global array $wp_plugin_paths |
| 737 | * |
| 738 | * @param string $file Known path to the file, typically passed in as __FILE__ |
| 739 | * @return string Returns the target filesystem path of a symlinked file |
| 740 | */ |
| 741 | function wp_get_plugin_realpath( $file ) { |
| 742 | |
| 743 | global $wp_plugin_paths; |
| 744 | |
| 745 | foreach ( $wp_plugin_paths as $dir => $realdir ) { |
| 746 | if ( 0 === strpos( $file, $realdir ) ) { |
| 747 | $file = $dir . substr( $file, strlen( $realdir ) ); |
| 748 | } |
| 749 | } |
| 750 | |
| 751 | return $file; |
| 752 | |
| 753 | } |
| 754 | |
| 755 | /** |
735 | 756 | * Get the filesystem directory path (with trailing slash) for the plugin __FILE__ passed in. |
736 | 757 | * |
737 | 758 | * @since 2.8.0 |