Support » Plugins » [Plugin: WP Page Numbers] link to css files

  • Not everyone uses the standard wp-content folder for their plugins.

    WP_CONTENT_DIR and the corresponding WP_CONTENT_URL for the entire wp-content directory

    These also exist, but you probably don’t need to use them:
    WP_PLUGIN_DIR — plugins directory (full server path)
    PLUGINDIR — (deprecated) plugin directory relative to ABSPATH

    I recommend putting this in the start of your plugin somewhere:

    if ( ! defined( ‘WP_CONTENT_URL’ ) )
    define( ‘WP_CONTENT_URL’, get_option(‘url’) . ‘/wp-content’ );
    if ( ! defined( ‘WP_PLUGIN_URL’ ) )
    define( ‘WP_PLUGIN_URL’, WP_CONTENT_URL. ‘/plugins’ )

    …and then use URLs based on WP_PLUGIN_URL when calling scripts

Viewing 1 replies (of 1 total)
  • Jenst


    Thanks! I made a new one called WP Paging. It takes care of these kinds of problems.

    The code is much better written this time.

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: WP Page Numbers] link to css files’ is closed to new replies.