• umka

    (@umka)


    Hi!

    If the plugin directory is a symbolic link to another one, the $plugin_dir variable gets an incorrect value.
    I’ve got a several sites with common plugin directory, like this:
    /my_home/site1.com/
    /my_home/site2.com/
    /my_home/site3.com/

    /my_home/plugins/

    And all ‘/my_home/site*.com/wp-content/plugins/’ directories is just a symlinks to ‘/my_home/plugins/’

    In this case, the $plugin_dir variable gets value like this: ‘/my_home/plugins/lightbox-gallery/’ instead of ‘lightbox-gallery’.
    The solution, I’ve found, is to define it this way:

    if ( !defined('WP_PLUGIN_DIR') )
                    $plugin_dir = basename( str_replace( ABSPATH, '', dirname(__FILE__) ) );
            else
                    $plugin_dir = basename( dirname( plugin_basename(__FILE__) ) );

    http://wordpress.org/extend/plugins/lightbox-gallery/

The topic ‘[Plugin: Lightbox Gallery] Troubles with $plugin_dir’ is closed to new replies.