WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#9420 closed feature request (wontfix)

Plugin URL Path

Reported by: enailor Owned by:
Milestone: 2.8 Priority: normal
Severity: normal Version: 2.7
Component: Plugins Keywords: reporter-feedback
Focuses: Cc:

Description

For simplicity sake, themes get a great option called bloginfo('template_url') that can be used for linking to theme files. Stylesheets get bloginfo('stylesheet_url') for liking to theme stylesheets. This would be a great addition if the same functionality were added to Plugins.

The main reason I have found for this is for SSL / Secured pages. Currently, any plugins that call for css sheets in the wp_head() use the get_bloginfo('wpurl') for the link to the css sheet. However, unless you make the wpurl a https link in the admin settings, the source code will require an unsecure link to the file. This produces the Mixed Security dialog box (This page contains both secure and nonsecure items. Do you want to display the nonsecure items?) On secure pages, this can make site visitors nervous.

Currently the only workaround I have found is to not call the wp_head() function on HTTPS pages, and that works, but I do lose any plugins that need the wp_head() function.

I suggest the addition of a bloginfo('plugin_url') function like the bloginfo('template_url') function that seems to be flexible enough to handle HTTPS vs HTTP calls.

Change History (5)

comment:1 DD325 years ago

  • Keywords reporter-feedback added; ssl plugins https removed
  • Priority changed from high to normal

does plugins_url() fit any of that? #6341

I think the current template_url functionality also does SSL.. Or at least i thought it did.

comment:2 hakre5 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

bloginfo() can never return the url of a "plugin" becuase, there exist multiple plugins per blog sothat that function can not decide which plugin_url of those multiple plugins to return.

as ryan suggested, another path must be chosen to get the url of a certain plugin. many plugin developers have already solved this and i strongly assume many other plugin developers will keep up the faith and do it in the future.

comment:3 enailor5 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

plugins_url() does work.. was not aware of the function, and it seems there are some authors with very well known and used plugins that are not aware of this function either. I modified 2 plugins that had calls to stylesheets within the header and they now use the https when the url is forced. Not sure who can do it, but maybe this function should be highlighted in the Codex located at http://codex.wordpress.org/Writing_a_Plugin.

Changing to Reopen so that someone might see this and make note in the Codex.

comment:4 DD325 years ago

  • Resolution set to wontfix
  • Status changed from reopened to closed

The codex is a Wiki, You may edit it yourself, Or edit the talk page to suggest that it be added.

comment:5 markjaquith5 years ago

See also plugin_dir_path(__FILE__) and plugin_dir_url(__FILE__)

Note: See TracTickets for help on using tickets.