Exemple #1
0
 /**
  * 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);
 }