[wp-trac] [WordPress Trac] #34007: Wordpress symlink (windows) and tinymce plugins languages

WordPress Trac noreply at wordpress.org
Fri Sep 25 08:50:43 UTC 2015


#34007: Wordpress symlink (windows) and tinymce plugins languages
----------------------------------------+-----------------------------
 Reporter:  Hrohh                       |      Owner:
     Type:  defect (bug)                |     Status:  new
 Priority:  normal                      |  Milestone:  Awaiting Review
Component:  TinyMCE                     |    Version:  4.3.1
 Severity:  normal                      |   Keywords:
  Focuses:  javascript, administration  |
----------------------------------------+-----------------------------
 Hi, I have problem with loading tinymce plugins languages on symlinked
 wordpress. Because in wp-config.php users have option to set

 define( 'WP_CONTENT_DIR', CONFIG_PATH . '/wp-content' );
 define( 'WP_PLUGIN_DIR', CONFIG_PATH . '/wordpress/wp-content/plugins' );

 so my workaround is replace
 in wp-includes/class-wp-editor.php

 I know, that isnt bullet proof, but it works
 line
 {{{
 // Try to load langs/[locale].js and langs/[locale]_dlg.js
 if ( ! in_array( $name, $loaded_langs, true ) ) {
 -       $path = str_replace( content_url(), '', $plugurl );
 -       $path = WP_CONTENT_DIR . $path . '/langs/';
 +       $path = str_replace(site_url() . '/', '',$plugurl);
 +       $path = str_replace('\\', '/', ABSPATH) . $path . '/langs/';
 }}}


 and with my ugly filter
 {{{
 function isSymbolicLink($target) {
     if (defined('PHP_WINDOWS_VERSION_BUILD')) {
         if(file_exists($target) && readlink($target) != $target) {
             return true;
         }
     } elseif (is_link($target)) {
         return true;
     }
     return false;
 }
 add_filter( 'plugins_url', 'plugins_url_for_wpmu_plugins', 9999, 3);
 function plugins_url_for_wpmu_plugins( $url, $path, $plugin ) {
         if ( isSymbolicLink(ABSPATH)) {
                 return str_replace('plugins/' . str_replace('\\', '/',
 ABSPATH) . 'wp-content/','',$url);
         } else {
                 $changes = str_replace('/wordpress/wp-content/','/wp-
 content/',$url);
                 return str_replace('wp-content/','wordpress/wp-
 content/',$changes);
         }
 }
 }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34007>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list