Forums

[Plugin: WP Page Numbers] link to css files (2 posts)

  1. MACscr
    Member
    Posted 3 months ago #

    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

    http://wordpress.org/extend/plugins/wp-page-numbers/

  2. Jenst
    Member
    Posted 2 months ago #

    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.

Reply

You must log in to post.

About this Topic