public function custom_template_locator($post_templates, $wp_theme, $post, $post_type)
    {
        // Path to  templates folder.
        $path = \get_stylesheet_directory() . '/' . Config::get('theme.templates_directory') . '/views/post-templates/';

        $templates = \scandir($path);

        if (! empty($templates)) {
            foreach ($templates as $tpl) {
                $full_path = $path . $tpl;

                if ($tpl === '.' || $tpl === '..' || \is_dir($full_path) || $tpl === '_example.php') {
                    continue;
                }

                if (! \preg_match('|Template Name:(.*)$|mi', \file_get_contents($full_path), $header)) {
                    continue;
                }

                $types = ['page'];

                if (\preg_match('|Template Post Type:(.*)$|mi', \file_get_contents($full_path), $type)) {
                    $types = \explode(',', \_cleanup_header_comment(\str_replace(' ', '', $type[1])));
                }

                if (\in_array($post_type, $types)) {
                    $post_templates[ Config::get('theme.templates_directory') . '/views/post-templates/' . $tpl ] = \trim($header[1]);
                }
            }
        }

        return $post_templates;
    }