AdminPageFrameworkLoader_Registry::getPluginURL PHP Method

getPluginURL() public static method

Example

AdminPageFrameworkLoader_Registry::getPluginURL( 'asset/css/meta_box.css' );
Since: 3.5.0
public static getPluginURL ( $sRelativePath = '' ) : string
return string
    public static function getPluginURL($sRelativePath = '')
    {
        if (isset(self::$_sPluginURLCache)) {
            return self::$_sPluginURLCache . $sRelativePath;
        }
        self::$_sPluginURLCache = trailingslashit(plugins_url('', self::$sFilePath));
        return self::$_sPluginURLCache . $sRelativePath;
    }

Usage Example

 /**
  * Retrieves contents of a change log section of a readme file.
  * @since       3.5.0
  * @return      void
  */
 private function _getChangeLog($sSection)
 {
     $_aReplacements = array('%PLUGIN_DIR_URL%' => AdminPageFrameworkLoader_Registry::getPluginURL(), '%WP_ADMIN_URL%' => admin_url());
     $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser(AdminPageFrameworkLoader_Registry::$sDirPath . '/readme.txt', $_aReplacements);
     $_sChangeLog = $_oWPReadmeParser->getSection($sSection);
     $_oWPReadmeParser = new AdminPageFramework_WPReadmeParser(AdminPageFrameworkLoader_Registry::$sDirPath . '/changelog.md', $_aReplacements);
     $_sChangeLog .= $_oWPReadmeParser->getSection($sSection);
     return $_sChangeLog ? $_sChangeLog : '<p>' . __('No valid changlog was found.', 'admin-page-framework-loader') . '</p>';
 }
All Usage Examples Of AdminPageFrameworkLoader_Registry::getPluginURL