本文整理匯總了PHP中WPSEO_Utils::javascript_console_notification方法的典型用法代碼示例。如果您正苦於以下問題:PHP WPSEO_Utils::javascript_console_notification方法的具體用法?PHP WPSEO_Utils::javascript_console_notification怎麽用?PHP WPSEO_Utils::javascript_console_notification使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WPSEO_Utils
的用法示例。
在下文中一共展示了WPSEO_Utils::javascript_console_notification方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: get_url
/**
* Returns the full URL for this asset based on the path to the plugin file.
*
* @param string $type Type of asset.
* @param string $plugin_file Absolute path to the plugin file.
*
* @return string The full URL to the asset.
*/
public function get_url($type, $plugin_file)
{
$relative_path = $this->get_relative_path($type);
if (empty($relative_path)) {
return '';
}
if (!$this->get_suffix()) {
$plugin_path = plugin_dir_path($plugin_file);
if (!file_exists($plugin_path . $relative_path)) {
// Give a notice to the user in the console (only once).
WPSEO_Utils::javascript_console_notification('Development Files', sprintf(__('You are trying to load non-minified files, these are only available in our development package. Check out %1$s to see all the source files.', 'wordpress-seo'), 'https://github.com/Yoast/wordpress-seo'), true);
// Just load the .min file.
$relative_path = $this->get_relative_path($type, '.min');
}
}
return plugins_url($relative_path, $plugin_file);
}