%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/
Upload File :
Create Path :
Current File : /home/opti/public_html/stlc/wp-content/plugins/insur-addon/includes/Utility.php

<?php

namespace Layerdrops\Insur;

class Utility
{
    public function __construct()
    {
        $this->register_image_size();
        add_filter('single_template', [$this, 'load_portfolio_template']);
    }
    public function register_image_size()
    {
        add_image_size('insur_blog_370X270', 370, 270, true); // in use
        add_image_size('insur_blog_370X343', 370, 343, true); // in use
        add_image_size('insur_portfolio_1170X510', 1170, 510, true); // in use
        add_image_size('insur_portfolio_370X410', 370, 410, true); // in use
        add_image_size('insur_brand_logo_167X80', 167, 80, true); // in use
    }

    public function load_portfolio_template($template)
    {
        global $post;

        if ('portfolio' === $post->post_type && locate_template(array('single-portfolio.php')) !== $template) {
            /*
            * This is a 'portfolio' post
            * AND a 'single portfolio template' is not found on
            * theme or child theme directories, so load it
            * from our plugin directory.
            */
            return INSUR_ADDON_PATH . '/post-templates/single-portfolio.php';
        }

        return $template;
    }
}

Zerion Mini Shell 1.0