This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <? | |
| if(isset($_GET['image-sizes'])) { | |
| add_action('wp', function() { | |
| require_once(ABSPATH.'wp-admin/includes/media.php'); | |
| require_once(ABSPATH.'wp-admin/includes/file.php'); | |
| require_once(ABSPATH.'wp-admin/includes/image.php'); | |
| // Get image sizes defined by theme/plugins and sort them by width DESC | |
| function get_ordered_image_sizes() { | |
| $image_sizes = wp_get_additional_image_sizes(); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <? | |
| /** | |
| * Programmatically sideload an image from a URL and set all attachment data and meta | |
| * @param string $url URL of image to sideload | |
| * @param array $data['filename'] Image filename | |
| * @param array $data['alt'] Image alt text | |
| * @param array $data['description'] Image description | |
| * @param array $data['caption'] Image caption | |
| * @param string $post_id Post ID to attach image to | |
| * @param boolean $generate_meta Generate attachment metadata? | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <? | |
| /** | |
| * Builds a responsive HTML <img> tag based on the image sizes passed or defined by active themes and plugins | |
| * | |
| * @param array $attributes Associative array of attributes for the <img> tag | |
| * | |
| * @return string HTML <img> tag | |
| */ | |
| function mdg_img($attributes = []) { | |
| // Defaults | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <? | |
| /** | |
| * Builds a responsive HTML <img> tag based on the image sizes passed or defined by active themes and plugins | |
| * | |
| * @param int|array $attachment_id Attachment ID | |
| * @param array $image_sizes Associative array of image size names defined by active themes and plugins | |
| * @param array $attributes Associative array of attributes for the <img> tag | |
| * | |
| * @return string HTML <img> tag | |
| */ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | add_filter('post_type_link', function($permalink, $post) { | |
| if ($post->post_type == 'doctorlandings') { | |
| $permalink = get_post_meta($post->ID, 'doctorlandings_office_website', true); | |
| } | |
| return $permalink; | |
| }, 10, 2); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <? | |
| public function flushCache() { | |
| $iterations = get_option('__website_cache_metadata_boats_count'); | |
| for ($loops = 0; $loops <= ($iterations - 1); $loops++) { | |
| delete_option('__website_cache_metadata_boats_'.$loops); | |
| } | |
| delete_option('__website_cache_metadata_boats_count'); | |
| } | |
| public function loadData() { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | (function($) { | |
| var owl = $('.owl-carousel').owlCarousel({ | |
| items: 1, | |
| nav: false, | |
| dots: false, | |
| loop: true | |
| }); | |
| owl.on('changed.owl.carousel', function(slide) { | |
| if (slide.item) { | |
| var index = (slide.item.index - (slide.relatedTarget._clones.length / 2)); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // Convert currency from one type to another | |
| private function convertCurrency($val, $base = 'EUR', $to = 'USD') { | |
| $json = file_get_contents('https://api.exchangeratesapi.io/latest?base='.$base); | |
| if(!empty($json)) $json = json_decode($json); | |
| return (float)preg_replace('/,/', '', $val) * $json->rates->{$to}; | |
| } | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <? | |
| // Get currency data based on string passed | |
| private function determineCurrency($cur_string) { | |
| $currency = []; | |
| switch(true) { | |
| case substr($cur_string, 0, 7) == '€': | |
| $currency['type'] = 'EUR'; | |
| $currency['val'] = substr($cur_string, 7); | |
| break; | |
| case substr($cur_string, 0, 5) == '$': | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | /** | |
| * The first commented line is your dabblet’s title | |
| */ | |
| background: #f06; | |
| background: linear-gradient(45deg, #f06, yellow); | |
| min-height: 100%; | 
NewerOlder
        