public function __construct($name)
 {
     $this->addonPath = '/addons/' . $name;
     $this->addonDir = WPUltimateRecipePremium::get()->premiumDir . $this->addonPath;
     $this->addonUrl = WPUltimateRecipePremium::get()->premiumUrl . $this->addonPath;
     $this->addonName = $name;
 }
Esempio n. 2
0
 public function add()
 {
     $assets = func_get_args();
     foreach ($assets as $asset) {
         if (isset($asset['file'])) {
             if (!isset($asset['type'])) {
                 $asset['type'] = pathinfo($asset['file'], PATHINFO_EXTENSION);
             }
             if (!isset($asset['priority'])) {
                 $asset['priority'] = 10;
             }
             // Set a URL and DIR variable
             if (isset($asset['direct']) && $asset['direct']) {
                 $asset['url'] = $asset['file'];
                 $asset['dir'] = $asset['file'];
             } else {
                 $base_url = WPUltimateRecipe::get()->coreUrl;
                 $base_dir = WPUltimateRecipe::get()->coreDir;
                 if (isset($asset['premium']) && $asset['premium']) {
                     $base_url = WPUltimateRecipePremium::get()->premiumUrl;
                     $base_dir = WPUltimateRecipePremium::get()->premiumDir;
                 }
                 $asset['url'] = $base_url . $asset['file'];
                 $asset['dir'] = $base_dir . $asset['file'];
             }
             $this->assets[] = $asset;
         }
     }
 }
if (WPUltimateRecipe::is_premium_active()) {
    ?>
    <script src="<?php 
    echo WPUltimateRecipePremium::get()->premiumUrl;
    ?>
/addons/unit-conversion/vendor/js-quantities.js"></script>
    <script src="<?php 
    echo WPUltimateRecipePremium::get()->premiumUrl;
    ?>
/addons/unit-conversion/js/unit-conversion.js"></script>
    <link rel="stylesheet" type="text/css" href="<?php 
    echo WPUltimateRecipePremium::get()->premiumUrl;
    ?>
/addons/nutritional-information/css/nutrition-label.css">
    <link rel="stylesheet" type="text/css" href="<?php 
    echo WPUltimateRecipePremium::get()->premiumUrl;
    ?>
/addons/user-ratings/css/user-ratings.css">
<?php 
} else {
    ?>
    <script src="<?php 
    echo WPUltimateRecipe::get()->coreUrl;
    ?>
/js/adjustable_servings.js"></script>
<?php 
}
?>

<?php 
if ($fonts) {