WordPress.org

Ready to get started?Download WordPress

Forums

Equivalent to plugins_url('css/file.css',__FILE__) for mu-plugins dir? (2 posts)

  1. erikstainsby
    Member
    Posted 12 months ago #

    I'm looking for an equivalent mapping of the plugins_url( .. ) function for use within the context of the mu-plugins folder. My stylesheets are currently reporting back as 404 Not Found.

    Current code (from non-mu-plugin dployment) is:
    plugins_url('/css/my_plugin.css',__FILE__)

    This is breaking in part I think becasue the Ubuntu server I am on has symlinks pointing from the "real" location (where apache looks for it) of
    /var/libwordpress/wp-content/mu-plugins/.

    The actual files are located in ~web-owner/wp-content/mu-plugins/.

    What I see in the browser is a mash up:
    subdomain.domain.ca/wp-content/home/web-owner/wp-content/mu-plugins/my_plugin/my_plugin.css
    Which is obviously junk.

    Thoughts? Anyone?
    TIA
    Erik

  2. ianhaycox
    Member
    Posted 12 months ago #

    Because __FILE__ resolves symlinks try $_SERVER["SCRIPT_FILENAME"] instead ?

Reply

You must log in to post.

About this Topic