Twig \ Error \ RuntimeError
An exception has been thrown during the rendering of a template ("attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408").
Previous exceptions
  • attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408 (499)
Twig\Error\RuntimeError thrown with message "An exception has been thrown during the rendering of a template ("attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408")." Stacktrace: #39 Twig\Error\RuntimeError in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/themes/g5_helium/views/partials/content-single.html.twig:45 #38 ImagickException in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-doc-preview.php:206 #37 Imagick:__construct in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-doc-preview.php:206 #36 mdocs_show_description in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-functions.php:47 #35 mdocs_display_tabs in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-post-page.php:52 #34 mdocs_post_page in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-shortcodes.php:10 #33 mdocs_post_page_shortcode in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/shortcodes.php:343 #32 do_shortcode_tag in [internal]:0 #31 preg_replace_callback in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/shortcodes.php:218 #30 do_shortcode in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/class-wp-hook.php:292 #29 WP_Hook:apply_filters in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/plugin.php:212 #28 apply_filters in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Post.php:1228 #27 Timber\Post:content in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Post.php:1256 #26 Timber\Post:paged_content in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:702 #25 Twig\Template:getAttribute in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/3b/3b8f9901d8b0528aafebdc3dbf5823e5a8c76eb04bdd0e0c12ea8ef0348e5e9f.php:148 #24 __TwigTemplate_0f0fd2b3248c92459404f06d6fd0ef7b33ae93423f47f210c897ad878bfeb92a:block_content in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:216 #23 Twig\Template:displayBlock in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/3b/3b8f9901d8b0528aafebdc3dbf5823e5a8c76eb04bdd0e0c12ea8ef0348e5e9f.php:41 #22 __TwigTemplate_0f0fd2b3248c92459404f06d6fd0ef7b33ae93423f47f210c897ad878bfeb92a:doDisplay in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #21 Twig\Template:displayWithErrorHandling in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #20 Twig\Template:display in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/a1/a1a010f025c4fdef93e886155b1dbda5b14c3b5f799c45e5a06855b147bd288d.php:54 #19 __TwigTemplate_175456ddc3f69d8bdacb4a9843b46dc96c512264d33b9a9edd21707468cd0e59:block_content in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:216 #18 Twig\Template:displayBlock in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/87/8719a1340621f74b71980feb53b342d92a75b1cf3e58dba56adf0166199a295f.php:55 #17 __TwigTemplate_c73c3d59d63035cdee9b1e1862a0c53f3cde047db2b76c94d7d1f58a9ac90a66:doDisplay in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #16 Twig\Template:displayWithErrorHandling in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #15 Twig\Template:display in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/87/871bfd1f33764fb5bb2712f24b1e10b3008c715bc5f546f14e6b0a589f0c17aa.php:36 #14 __TwigTemplate_b6e3380dc1ed49a1d553dfb20eaf0074c417b44fb8947414757e1b66cb3a8c8a:doDisplay in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #13 Twig\Template:displayWithErrorHandling in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #12 Twig\Template:display in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/a1/a1a010f025c4fdef93e886155b1dbda5b14c3b5f799c45e5a06855b147bd288d.php:40 #11 __TwigTemplate_175456ddc3f69d8bdacb4a9843b46dc96c512264d33b9a9edd21707468cd0e59:doDisplay in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:455 #10 Twig\Template:displayWithErrorHandling in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:422 #9 Twig\Template:display in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/Template.php:434 #8 Twig\Template:render in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/twig/twig/src/TemplateWrapper.php:47 #7 Twig\TemplateWrapper:render in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Loader.php:79 #6 Timber\Loader:render in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Timber.php:334 #5 Timber\Timber:compile in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Timber.php:383 #4 Timber\Timber:fetch in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/gantry5/src/vendor/timber/timber/lib/Timber.php:410 #3 Timber\Timber:render in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/themes/g5_helium/single.php:30 #2 include in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/template-loader.php:106 #1 require_once in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-blog-header.php:19 #0 require in /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/index.php:17
Stack frames (40)
39
Twig\Error\RuntimeError
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/themes/g5_helium/views/partials/content-single.html.twig45
38
ImagickException
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-doc-preview.php206
37
Imagick __construct
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-doc-preview.php206
36
mdocs_show_description
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-functions.php47
35
mdocs_display_tabs
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-post-page.php52
34
mdocs_post_page
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/plugins/memphis-documents-library/includes/mdocs-shortcodes.php10
33
mdocs_post_page_shortcode
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/shortcodes.php343
32
do_shortcode_tag
[internal]0
31
preg_replace_callback
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/shortcodes.php218
30
do_shortcode
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/class-wp-hook.php292
29
WP_Hook apply_filters
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/plugin.php212
28
apply_filters
/vendor/timber/timber/lib/Post.php1228
27
Timber\Post content
/vendor/timber/timber/lib/Post.php1256
26
Timber\Post paged_content
/vendor/twig/twig/src/Template.php702
25
Twig\Template getAttribute
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/3b/3b8f9901d8b0528aafebdc3dbf5823e5a8c76eb04bdd0e0c12ea8ef0348e5e9f.php148
24
__TwigTemplate_0f0fd2b3248c92459404f06d6fd0ef7b33ae93423f47f210c897ad878bfeb92a block_content
/vendor/twig/twig/src/Template.php216
23
Twig\Template displayBlock
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/3b/3b8f9901d8b0528aafebdc3dbf5823e5a8c76eb04bdd0e0c12ea8ef0348e5e9f.php41
22
__TwigTemplate_0f0fd2b3248c92459404f06d6fd0ef7b33ae93423f47f210c897ad878bfeb92a doDisplay
/vendor/twig/twig/src/Template.php455
21
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
20
Twig\Template display
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/a1/a1a010f025c4fdef93e886155b1dbda5b14c3b5f799c45e5a06855b147bd288d.php54
19
__TwigTemplate_175456ddc3f69d8bdacb4a9843b46dc96c512264d33b9a9edd21707468cd0e59 block_content
/vendor/twig/twig/src/Template.php216
18
Twig\Template displayBlock
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/87/8719a1340621f74b71980feb53b342d92a75b1cf3e58dba56adf0166199a295f.php55
17
__TwigTemplate_c73c3d59d63035cdee9b1e1862a0c53f3cde047db2b76c94d7d1f58a9ac90a66 doDisplay
/vendor/twig/twig/src/Template.php455
16
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
15
Twig\Template display
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/87/871bfd1f33764fb5bb2712f24b1e10b3008c715bc5f546f14e6b0a589f0c17aa.php36
14
__TwigTemplate_b6e3380dc1ed49a1d553dfb20eaf0074c417b44fb8947414757e1b66cb3a8c8a doDisplay
/vendor/twig/twig/src/Template.php455
13
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
12
Twig\Template display
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/cache/gantry5/g5_helium/twig/a1/a1a010f025c4fdef93e886155b1dbda5b14c3b5f799c45e5a06855b147bd288d.php40
11
__TwigTemplate_175456ddc3f69d8bdacb4a9843b46dc96c512264d33b9a9edd21707468cd0e59 doDisplay
/vendor/twig/twig/src/Template.php455
10
Twig\Template displayWithErrorHandling
/vendor/twig/twig/src/Template.php422
9
Twig\Template display
/vendor/twig/twig/src/Template.php434
8
Twig\Template render
/vendor/twig/twig/src/TemplateWrapper.php47
7
Twig\TemplateWrapper render
/vendor/timber/timber/lib/Loader.php79
6
Timber\Loader render
/vendor/timber/timber/lib/Timber.php334
5
Timber\Timber compile
/vendor/timber/timber/lib/Timber.php383
4
Timber\Timber fetch
/vendor/timber/timber/lib/Timber.php410
3
Timber\Timber render
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-content/themes/g5_helium/single.php30
2
include
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-includes/template-loader.php106
1
require_once
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/wp-blog-header.php19
0
require
/var/www/vhosts/childrenslawcentre.org.uk/httpdocs/index.php17
        </section>
        {# End Entry Header #}
 
        {# Check if post is password protected #}
        {% if not function( 'post_password_required', post.ID ) %}
 
            {# Begin Entry Content #}
            <section class="entry-content">
 
                {# Begin Featured Image #}
                {% if gantry.config.get('content.' ~ scope ~ '.featured-image.enabled', '1') and post.thumbnail.src %}
                    {% set position = (gantry.config.get('content.' ~ scope ~ '.featured-image.position', 'none') == 'none') ? '' : 'float-' ~ gantry.config.get('content.' ~ scope ~ '.featured-image.position', 'none') %}
                    <a href="{{ post.link }}" class="post-thumbnail" aria-hidden="true">
                        <img src="{{ post.thumbnail.src|resize(gantry.config.get('content.' ~ scope ~ '.featured-image.width', '1200'), gantry.config.get('content.' ~ scope ~ '.featured-image.height', '350')) }}" class="featured-image tease-featured-image {{ position }}" alt="{{ post.title }}" />
                    </a>
                {% endif %}
                {# End Featured Image #}
 
                {# Begin Page Content #}
                {{ post.paged_content|raw }}
 
                {{ function('wp_link_pages', {'before': '<div class="page-links" itemprop="pagination"><ul class="pagination-list">', 'after': '</ul></div>', 'link_before': '<span class="page-number page-numbers">', 'link_after': '</span>', 'echo': 0}) }}
                {# End Page Content #}
 
                {# Begin Edit Link #}
                {{ function('edit_post_link', __('Edit', 'g5_helium'), '<span class="edit-link">', '</span>') }}
                {# End Edit Link #}
 
            </section>
            {# End Entry Content #}
 
            {# Begin Comments #}
            {% if (post.comment_status == 'open' or post.comment_count > 0) and post.post_type != 'product' %}
                {{ function('comments_template')|raw }}
            {% endif %}
            {# End Comments #}
 
        {% else %}
 
            {# Begin Password Protected Form #}
        } else {
            $thumbnail = false;
            
        }
        ?>
        <div class="mdoc-desc">
        <?php
        if($thumbnail) {
            if(function_exists('imagecreatefromjpeg')) {
                ?>
                <img class="mdocs-thumbnail img-thumbnail img-responsive" src="<?php $boxview->getThumbnail($the_mdoc['box-view-id'], $the_mdoc); ?>" alt="<?php echo $the_mdoc['filename']; ?>" />
                <?php
            }
        } elseif($the_mdoc['type'] == 'pdf' && class_exists('imagick')) {
            $the_image_file = preg_replace('/ /', '%20', $the_mdoc['filename']);
            $image_size = @getimagesize(get_site_url().'/?mdocs-img-preview='.$the_image_file);
            $thumbnail_size = 256;
            $upload_dir = wp_upload_dir();
            $file = $upload_dir['basedir']."/mdocs/".$the_mdoc['filename'].'[0]';
            $thumbnail = new Imagick($file);
            $thumbnail->setbackgroundcolor('rgb(64, 64, 64)');
            $thumbnail->thumbnailImage(450, 300, true);
            $thumbnail->setImageFormat('png');
            $uri = "data:image/png;base64," . base64_encode($thumbnail);
            ?>
            <img class="mdocs-thumbnail img-thumbnail  img-responsive" src="<?php echo $uri; ?>" alt="<?php echo $the_mdoc['filename']; ?>" />
            <?php
        } elseif( $image_size != false) {
            $thumbnail_size = 256;
            $width = $image_size[0];
            $height = $image_size[1];
            $aspect_ratio = round($width/$height,2);
            // Width is greater than height and width is greater than thumbnail size
            if($aspect_ratio > 1&&  $width > $thumbnail_size) {
                $thumbnail_width = $thumbnail_size;
                $thumbnail_height = $thumbnail_size/$aspect_ratio;
            // Heigth is greater than width and height is greater then thumbnail size
            } elseif($aspect_ratio < 1 && $height > $thumbnail_size) {
                $aspect_ratio = round($height/$width,2);
                $thumbnail_width = $thumbnail_size/$aspect_ratio;
Exception message: attempt to perform an operation not allowed by the security policy `PDF' @ error/constitute.c/IsCoderAuthorized/408
        } else {
            $thumbnail = false;
            
        }
        ?>
        <div class="mdoc-desc">
        <?php
        if($thumbnail) {
            if(function_exists('imagecreatefromjpeg')) {
                ?>
                <img class="mdocs-thumbnail img-thumbnail img-responsive" src="<?php $boxview->getThumbnail($the_mdoc['box-view-id'], $the_mdoc); ?>" alt="<?php echo $the_mdoc['filename']; ?>" />
                <?php
            }
        } elseif($the_mdoc['type'] == 'pdf' && class_exists('imagick')) {
            $the_image_file = preg_replace('/ /', '%20', $the_mdoc['filename']);
            $image_size = @getimagesize(get_site_url().'/?mdocs-img-preview='.$the_image_file);
            $thumbnail_size = 256;
            $upload_dir = wp_upload_dir();
            $file = $upload_dir['basedir']."/mdocs/".$the_mdoc['filename'].'[0]';
            $thumbnail = new Imagick($file);
            $thumbnail->setbackgroundcolor('rgb(64, 64, 64)');
            $thumbnail->thumbnailImage(450, 300, true);
            $thumbnail->setImageFormat('png');
            $uri = "data:image/png;base64," . base64_encode($thumbnail);
            ?>
            <img class="mdocs-thumbnail img-thumbnail  img-responsive" src="<?php echo $uri; ?>" alt="<?php echo $the_mdoc['filename']; ?>" />
            <?php
        } elseif( $image_size != false) {
            $thumbnail_size = 256;
            $width = $image_size[0];
            $height = $image_size[1];
            $aspect_ratio = round($width/$height,2);
            // Width is greater than height and width is greater than thumbnail size
            if($aspect_ratio > 1&&  $width > $thumbnail_size) {
                $thumbnail_width = $thumbnail_size;
                $thumbnail_height = $thumbnail_size/$aspect_ratio;
            // Heigth is greater than width and height is greater then thumbnail size
            } elseif($aspect_ratio < 1 && $height > $thumbnail_size) {
                $aspect_ratio = round($height/$width,2);
                $thumbnail_width = $thumbnail_size/$aspect_ratio;
function  mdocs_display_tabs($the_mdoc) {
    $mdocs_default_content = get_option('mdocs-default-content');
    $mdocs_show_description = get_option('mdocs-show-description');
    $mdocs_show_preview = get_option('mdocs-show-preview');
    $mdocs_show_versions = get_option('mdocs-show-versions');
    ob_start();
    if($mdocs_show_description) {
        ?><a class="mdocs-nav-tab <?php if($mdocs_default_content=='description') echo 'mdocs-nav-tab-active'; ?>" data-mdocs-show-type="desc" data-mdocs-id="<?php echo $the_mdoc['id']; ?>"><?php _e('Description', 'memphis-documents-library'); ?></a><?php
    }
    if($mdocs_show_preview) {
        ?><a class="mdocs-nav-tab <?php if($mdocs_default_content=='preview') echo 'mdocs-nav-tab-active'; ?>"  data-mdocs-show-type="preview" data-mdocs-id="<?php echo $the_mdoc['id']; ?>"><?php _e('Preview', 'memphis-documents-library'); ?></a><?php
    }
    if($mdocs_show_versions) {
        ?><a class="mdocs-nav-tab <?php if($mdocs_default_content=='versions') echo 'mdocs-nav-tab-active'; ?>"  data-mdocs-show-type="versions" data-mdocs-id="<?php echo $the_mdoc['id']; ?>"><?php _e('Versions', 'memphis-documents-library'); ?></a><?php
    }
    ?>
    <div class="mdocs-show-container" id="mdocs-show-container-<?php echo $the_mdoc['id']; ?>">
        <?php
        if(!isset($_POST['show_type']) && $mdocs_show_description && $mdocs_default_content == 'description') {
            mdocs_show_description($the_mdoc['id']);
        } elseif(!isset($_POST['show_type']) && $mdocs_show_preview && $mdocs_default_content == 'preview') {
            mdocs_show_preview($the_mdoc);
        } elseif(!isset($_POST['show_type']) && $mdocs_show_versions && $mdocs_default_content == 'versions') {
            mdocs_show_versions($the_mdoc['parent']);
        }
        ?>
    </div>
    <?php
    $the_des = ob_get_clean();
    return $the_des;
}
 
function mdocs_rename_file($upload, $file_name) {
    $upload_dir = wp_upload_dir();
    $index = 0;
    $filename_no_comma = str_replace(',','',$file_name);
    $org_filename = $filename_no_comma;
    while(file_exists($upload_dir['basedir'].'/mdocs/'.$filename_no_comma)) {
        $index++;
        $explode = explode('.',$org_filename);
        'has_archive'             => true,
        'hierarchical'            => false,
        'menu_position'       => 5,
        'taxonomies'             => array('post_tag'),
        'supports'                    => $supports,
     );
    register_post_type( 'mdocs-posts', $args );
}
function mdocs_post_page($att=null) {
    global $post;
    if(@$post->post_type = 'mdocs-posts') {
        ob_start();
        $the_mdoc = get_the_mdoc_by($post->ID, 'parent');
        $the_page = '<div class="mdocs mdocs-post mdocs-post-current-file">';
        $the_page .= mdocs_display_file_info_large($the_mdoc, $att);
        $the_page .= '<div class="mdocs-clear-both"></div>';
        $the_page .= mdocs_social($the_mdoc);
        $the_page .= '</div>';
        $the_page .= '<div class="mdocs-clear-both"></div>';
        $the_page .= mdocs_display_tabs($the_mdoc);
        $the_page .= '<div class="mdocs-clear-both"></div>';
        $the_page .= '</div>';
        $the_page .= ob_get_clean();
        if(mdocs_check_post_rights($the_mdoc)) return $the_page;
        else return '<p class="alert alert-info text-center clearfix">'.__('Sorry you can\'t see this Memphis Documents file you don\'t have the proper permission.','memphis-documents-library').'</p>';
    } 
}
function mdocs_display_file_info_large($the_mdoc, $att=null) {
    global $post;
    ob_start();
    $the_mdoc_permalink = mdocs_sanitize_string(get_permalink($the_mdoc['parent']));
    $the_post = get_post($the_mdoc['parent']);
    if(isset($att['new']) && $att['new']) $is_new = true;
    else $is_new = false;
    $date_format = get_option('mdocs-date-format');
    $the_date = mdocs_format_unix_epoch($the_mdoc['modified']);
    $user_logged_in = is_user_logged_in();
    $mdocs_show_non_members = $the_mdoc['non_members'];
    $mdocs_hide_all_files = get_option( 'mdocs-hide-all-files' );
    $mdocs_hide_all_posts = get_option( 'mdocs-hide-all-posts' );
<?php
// Shortcode: [mdocs_upload_btn] - Creates a upload button for the front end.
add_shortcode( 'mdocs_upload_btn', 'mdocs_shortcode_upload' );
function mdocs_shortcode_upload($att, $content=null) { return mdocs_upload_button($att); }
// Shortcode: [mdocs] - Used in list.
add_shortcode( 'mdocs', 'mdocs_shortcode' );
function mdocs_shortcode($att, $content=null) { return mdocs_the_list($att); }
// Shortcode: [mdocs_post_page] - Used with a mdocs post page.
add_shortcode( 'mdocs_post_page', 'mdocs_post_page_shortcode' );
function mdocs_post_page_shortcode($att, $content=null) { return mdocs_post_page($att); }
// Shortcode: [mdocs_upload_btn] - Creates a upload button for the front end.
add_shortcode( 'mdocs_media_attachment', 'mdocs_shortcode_media_attachment' );
function mdocs_shortcode_media_attachment($att, $content=null) { return null; }
// Shortcode Setting Page
function mdocs_shortcodes($current_cat) {
    mdocs_list_header();
    ?>
    <div class="panel panel-primary">
        <div class="panel-heading">
            <h3 class="panel-title"><?php _e('Short Codes','memphis-documents-library'); ?></h3>
        </div>
        <div class="panel-body">
            <table class="table table-hover table-striped table-bordered" >
                <tr>
                    <th><?php _e('Short Codes','memphis-documents-library');?></th>
                    <th><?php _e('Description','memphis-documents-library');?></th>
                </tr>
                <tr>
                    <td>[mdocs]</td>
                    <td><?php _e('Adds the default Memphis Documents Library file list to any page, post or widget.','memphis-documents-library');?></td>
                </tr>
                <tr>
                    <td>[mdocs cat="<?php _e('The Category Name','memphis-documents-library');?>"]</td>
                    <td><?php _e('This still works but you are better off using the "Add mDocs Folder" button, found at the top of the page editor.', 'memphis-documents-library'); echo '<br><br>'; _e('Adds files from  a specific folder of the Memphis Documents Library on any page, post or widget.','memphis-documents-library');?></td>
                </tr>
                <tr>
                    <td>[mdocs cat="All Files"]</td>
                    <td><?php _e('This still works but you are better off using the "Add mDocs Folder" button, found at the top of the page editor.', 'memphis-documents-library'); echo '<br><br>'; _e('Adds a list of all files of the Memphis Documents Library on any page, post or widget.','memphis-documents-library');?></td>
                </tr>
                <tr>
     * Filters whether to call a shortcode callback.
     *
     * Returning a non-false value from filter will short-circuit the
     * shortcode generation process, returning that value instead.
     *
     * @since 4.7.0
     *
     * @param false|string $return      Short-circuit return value. Either false or the value to replace the shortcode with.
     * @param string       $tag         Shortcode name.
     * @param array|string $attr        Shortcode attributes array or empty string.
     * @param array        $m           Regular expression match array.
     */
    $return = apply_filters( 'pre_do_shortcode_tag', false, $tag, $attr, $m );
    if ( false !== $return ) {
        return $return;
    }
 
    $content = isset( $m[5] ) ? $m[5] : null;
 
    $output = $m[1] . call_user_func( $shortcode_tags[ $tag ], $attr, $content, $tag ) . $m[6];
 
    /**
     * Filters the output created by a shortcode callback.
     *
     * @since 4.7.0
     *
     * @param string       $output Shortcode output.
     * @param string       $tag    Shortcode name.
     * @param array|string $attr   Shortcode attributes array or empty string.
     * @param array        $m      Regular expression match array.
     */
    return apply_filters( 'do_shortcode_tag', $output, $tag, $attr, $m );
}
 
/**
 * Search only inside HTML elements for shortcodes and process them.
 *
 * Any [ or ] characters remaining inside elements will be HTML encoded
 * to prevent interference with shortcodes that are outside the elements.
 * Assumes $content processed by KSES already.  Users with unfiltered_html
    if ( false === strpos( $content, '[' ) ) {
        return $content;
    }
 
    if ( empty( $shortcode_tags ) || ! is_array( $shortcode_tags ) ) {
        return $content;
    }
 
    // Find all registered tag names in $content.
    preg_match_all( '@\[([^<>&/\[\]\x00-\x20=]++)@', $content, $matches );
    $tagnames = array_intersect( array_keys( $shortcode_tags ), $matches[1] );
 
    if ( empty( $tagnames ) ) {
        return $content;
    }
 
    $content = do_shortcodes_in_html_tags( $content, $ignore_html, $tagnames );
 
    $pattern = get_shortcode_regex( $tagnames );
    $content = preg_replace_callback( "/$pattern/", 'do_shortcode_tag', $content );
 
    // Always restore square braces so we don't break things like <!--[if IE ]>.
    $content = unescape_invalid_shortcodes( $content );
 
    return $content;
}
 
/**
 * Retrieve the shortcode regular expression for searching.
 *
 * The regular expression combines the shortcode tags in the regular expression
 * in a regex class.
 *
 * The regular expression contains 6 different sub matches to help with parsing.
 *
 * 1 - An extra [ to allow for escaping shortcodes with double [[]]
 * 2 - The shortcode name
 * 3 - The shortcode argument list
 * 4 - The self closing /
 * 5 - The content of a shortcode when it wraps some content.
 
        $nesting_level = $this->nesting_level++;
 
        $this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
        $num_args                           = count( $args );
 
        do {
            $this->current_priority[ $nesting_level ] = current( $this->iterations[ $nesting_level ] );
            $priority                                 = $this->current_priority[ $nesting_level ];
 
            foreach ( $this->callbacks[ $priority ] as $the_ ) {
                if ( ! $this->doing_action ) {
                    $args[0] = $value;
                }
 
                // Avoid the array_slice() if possible.
                if ( 0 == $the_['accepted_args'] ) {
                    $value = call_user_func( $the_['function'] );
                } elseif ( $the_['accepted_args'] >= $num_args ) {
                    $value = call_user_func_array( $the_['function'], $args );
                } else {
                    $value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int) $the_['accepted_args'] ) );
                }
            }
        } while ( false !== next( $this->iterations[ $nesting_level ] ) );
 
        unset( $this->iterations[ $nesting_level ] );
        unset( $this->current_priority[ $nesting_level ] );
 
        $this->nesting_level--;
 
        return $value;
    }
 
    /**
     * Calls the callback functions that have been added to an action hook.
     *
     * @since 4.7.0
     *
     * @param array $args Parameters to pass to the callback functions.
    if ( isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $tag;
        _wp_call_all_hook( $args );
    }
 
    if ( ! isset( $wp_filter[ $tag ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
        return $value;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $tag;
    }
 
    // Don't pass the tag name to WP_Hook.
    array_shift( $args );
 
    $filtered = $wp_filter[ $tag ]->apply_filters( $value, $args );
 
    array_pop( $wp_current_filter );
 
    return $filtered;
}
 
/**
 * Calls the callback functions that have been added to a filter hook, specifying arguments in an array.
 *
 * @since 3.0.0
 *
 * @see apply_filters() This function is identical, but the arguments passed to the
 * functions hooked to `$tag` are supplied using an array.
 *
 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
 * @global string[]  $wp_current_filter Stores the list of current filters with the current one last.
 *
 * @param string $tag  The name of the filter hook.
 * @param array  $args The arguments supplied to the functions hooked to $tag.
 * @return mixed The filtered value after all hooked functions are applied to it.
        }
        if ( $form = $this->maybe_show_password_form() ) {
            return $form;
        }
        if ( $len == -1 && $page == 0 && $this->___content ) {
            return $this->___content;
        }
        $content = $this->post_content;
        if ( $len > 0 ) {
            $content = wp_trim_words($content, $len);
        }
        if ( $page ) {
            $contents = explode('<!--nextpage-->', $content);
            $page--;
            if ( count($contents) > $page ) {
                $content = $contents[$page];
            }
        }
        $content = $this->content_handle_no_teaser_block( $content );
        $content = apply_filters('the_content', ($content));
        if ( $len == -1 && $page == 0 ) {
            $this->___content = $content;
        }
        return $content;
    }
 
    /**
     * Handles for an circumstance with the Block editor where a "more" block has an option to 
     * "Hide the excerpt on the full content page" which hides everything prior to the inserted 
     * "more" block
     * @ticket #2218
     * @param string $content
     * @return string
     */
    protected function content_handle_no_teaser_block( $content ) {
        if ( strpos($content, 'noTeaser:true') !== false ) {
            $arr = explode('<!--noteaser-->', $content);
            return $arr[1];
        }
        return $content;
     * "Hide the excerpt on the full content page" which hides everything prior to the inserted 
     * "more" block
     * @ticket #2218
     * @param string $content
     * @return string
     */
    protected function content_handle_no_teaser_block( $content ) {
        if ( strpos($content, 'noTeaser:true') !== false ) {
            $arr = explode('<!--noteaser-->', $content);
            return $arr[1];
        }
        return $content;
    }
 
    /**
     * @return string
     */
    public function paged_content() {
        global $page;
        return $this->content($page, -1);
    }
 
    /**
     * Get the date to use in your template!
     * @api
     * @example
     * ```twig
     * Published on {{ post.date }} // Uses WP's formatting set in Admin
     * OR
     * Published on {{ post.date('F jS') }} // Jan 12th
     * ```
     *
     * ```html
     * Published on January 12, 2015
     * OR
     * Published on Jan 12th
     * ```
     * @param string $date_format
     * @return string
     */
            if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
                return;
            }
 
            throw new RuntimeError(sprintf('Neither the property "%1$s" nor one of the methods "%1$s()", "get%1$s()"/"is%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), -1, $this->getSourceContext());
        }
 
        if ($isDefinedTest) {
            return true;
        }
 
        if ($this->env->hasExtension('\Twig\Extension\SandboxExtension')) {
            $this->env->getExtension('\Twig\Extension\SandboxExtension')->checkMethodAllowed($object, $method);
        }
 
        // Some objects throw exceptions when they have __call, and the method we try
        // to call is not supported. If ignoreStrictCheck is true, we should return null.
        try {
            if (!$arguments) {
                $ret = $object->$method();
            } else {
                $ret = \call_user_func_array([$object, $method], $arguments);
            }
        } catch (\BadMethodCallException $e) {
            if ($call && ($ignoreStrictCheck || !$this->env->isStrictVariables())) {
                return;
            }
            throw $e;
        }
 
        // @deprecated in 1.28
        if ($object instanceof \Twig_TemplateInterface) {
            $self = $object->getTemplateName() === $this->getTemplateName();
            $message = sprintf('Calling "%s" on template "%s" from template "%s" is deprecated since version 1.28 and won\'t be supported anymore in 2.0.', $item, $object->getTemplateName(), $this->getTemplateName());
            if ('renderBlock' === $method || 'displayBlock' === $method) {
                $message .= sprintf(' Use block("%s"%s) instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('hasBlock' === $method) {
                $message .= sprintf(' Use "block("%s"%s) is defined" instead).', $arguments[0], $self ? '' : ', template');
            } elseif ('render' === $method || 'display' === $method) {
                $message .= sprintf(' Use include("%s") instead).', $object->getTemplateName());
                echo "\" class=\"post-thumbnail\" aria-hidden=\"true\">
                        <img src=\"";
                // line 39
                echo Timber\ImageHelper::resize($this->getAttribute($this->getAttribute(($context["post"] ?? null), "thumbnail", []), "src", []), $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".featured-image.width"), 1 => "1200"], "method"), $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".featured-image.height"), 1 => "350"], "method"));
                echo "\" class=\"featured-image tease-featured-image ";
                echo ($context["position"] ?? null);
                echo "\" alt=\"";
                echo $this->getAttribute(($context["post"] ?? null), "title", []);
                echo "\" />
                    </a>
                ";
            }
            // line 42
            echo "                ";
            // line 43
            echo "
                ";
            // line 45
            echo "                ";
            echo $this->getAttribute(($context["post"] ?? null), "paged_content", []);
            echo "
 
                ";
            // line 47
            echo call_user_func_array($this->env->getFunction('function')->getCallable(), ["wp_link_pages", ["before" => "<div class=\"page-links\" itemprop=\"pagination\"><ul class=\"pagination-list\">", "after" => "</ul></div>", "link_before" => "<span class=\"page-number page-numbers\">", "link_after" => "</span>", "echo" => 0]]);
            echo "
                ";
            // line 49
            echo "
                ";
            // line 51
            echo "                ";
            echo call_user_func_array($this->env->getFunction('function')->getCallable(), ["edit_post_link", __("Edit", "g5_helium"), "<span class=\"edit-link\">", "</span>"]);
            echo "
                ";
            // line 53
            echo "
            </section>
            ";
            // line 56
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
 
        $this->blocks = [
            'content' => [$this, 'block_content'],
        ];
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        echo "<article class=\"post-type-";
        echo $this->getAttribute(($context["post"] ?? null), "post_type", []);
        echo " ";
        echo $this->getAttribute(($context["post"] ?? null), "class", []);
        echo "\" id=\"post-";
        echo $this->getAttribute(($context["post"] ?? null), "ID", []);
        echo "\">
 
    ";
        // line 3
        $this->displayBlock('content', $context, $blocks);
        // line 77
        echo "
</article>
";
    }
 
    // line 3
    public function block_content($context, array $blocks = [])
    {
        // line 4
        echo "
        ";
        // line 6
        echo "        <section class=\"entry-header\">
 
            ";
        // line 8
        if ($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "config", []), "get", [0 => (("content." . ($context["scope"] ?? null)) . ".title.enabled"), 1 => "1"], "method")) {
            // line 9
            echo "                ";
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
        $context["twigTemplate"] = "single.html.twig";
        // line 3
        $context["scope"] = "single";
        // line 1
        $this->parent = $this->loadTemplate("partials/page.html.twig", "single.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 5
    public function block_content($context, array $blocks = [])
    {
        // line 6
        echo "
    <div class=\"platform-content\">
        <div class=\"content-wrapper\">
            <section class=\"entry\">
 
                ";
        // line 11
        $this->loadTemplate([0 => (("partials/content-" . ($context["scope"] ?? null)) . ".html.twig"), 1 => "partials/content.html.twig"], "single.html.twig", 11)->display($context);
        // line 12
        echo "
            </section>
        </div> <!-- /content-wrapper -->
    </div>
 
";
    }
 
    public function getTemplateName()
    {
        return "single.html.twig";
    }
 
    public function isTraitable()
    {
        return false;
    }
 
    public function getDebugInfo()
 
        if ($useBlocks && isset($blocks[$name])) {
            $template = $blocks[$name][0];
            $block = $blocks[$name][1];
        } elseif (isset($this->blocks[$name])) {
            $template = $this->blocks[$name][0];
            $block = $this->blocks[$name][1];
        } else {
            $template = null;
            $block = null;
        }
 
        // avoid RCEs when sandbox is enabled
        if (null !== $template && !$template instanceof self) {
            throw new \LogicException('A block must be a method on a \Twig\Template instance.');
        }
 
        if (null !== $template) {
            try {
                $template->$block($context, $blocks);
            } catch (Error $e) {
                if (!$e->getSourceContext()) {
                    $e->setSourceContext($template->getSourceContext());
                }
 
                // this is mostly useful for \Twig\Error\LoaderError exceptions
                // see \Twig\Error\LoaderError
                if (-1 === $e->getTemplateLine()) {
                    $e->guess();
                }
 
                throw $e;
            } catch (\Exception $e) {
                $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $template->getSourceContext(), $e);
                $e->guess();
 
                throw $e;
            }
        } elseif (false !== $parent = $this->getParent($context)) {
            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks), false);
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 1
        $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "debugger", []), "startTimer", [0 => "render", 1 => "Rendering page"], "method");
        // line 2
        $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "setLayout", [], "method");
        // line 3
        $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "loadAtoms", [], "method");
        // line 4
        $context["segments"] = $this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "segments", [], "method");
        // line 6
        ob_start(function () { return ''; });
        // line 7
        echo "    ";
        if ($this->getAttribute($this->getAttribute(($context["gantry"] ?? null), "theme", []), "hasContent", [], "method")) {
            // line 8
            echo "        ";
            $this->displayBlock('content', $context, $blocks);
            // line 10
            echo "    ";
        }
        $context["content"] = ('' === $tmp = ob_get_clean()) ? '' : new Markup($tmp, $this->env->getCharset());
        // line 13
        $context["offcanvas"] = null;
        // line 14
        $context['_parent'] = $context;
        $context['_seq'] = twig_ensure_traversable(($context["segments"] ?? null));
        foreach ($context['_seq'] as $context["_key"] => $context["segment"]) {
            if (($this->getAttribute($context["segment"], "type", []) == "offcanvas")) {
                // line 15
                $context["offcanvas"] = $context["segment"];
            }
        }
        $_parent = $context['_parent'];
        unset($context['_seq'], $context['_iterated'], $context['_key'], $context['segment'], $context['_parent'], $context['loop']);
        $context = array_intersect_key($context, $_parent) + $_parent;
        // line 18
        ob_start(function () { return ''; });
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function __construct(Environment $env)
    {
        parent::__construct($env);
 
        $this->blocks = [
            'page_head' => [$this, 'block_page_head'],
            'page_footer' => [$this, 'block_page_footer'],
        ];
    }
 
    protected function doGetParent(array $context)
    {
        // line 1
        return "@nucleus/page.html.twig";
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        $this->parent = $this->loadTemplate("@nucleus/page.html.twig", "partials/page.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 3
    public function block_page_head($context, array $blocks = [])
    {
        // line 4
        if (($context["page_head"] ?? null)) {
            // line 5
            echo "        ";
            echo ($context["page_head"] ?? null);
            echo "
    ";
        } else {
            // line 7
            echo "        ";
            $this->displayParentBlock("page_head", $context, $blocks);
            echo "
    ";
        }
    }
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
        $this->blocks = [
            'content' => [$this, 'block_content'],
        ];
    }
 
    protected function doGetParent(array $context)
    {
        // line 1
        return "partials/page.html.twig";
    }
 
    protected function doDisplay(array $context, array $blocks = [])
    {
        // line 2
        $context["twigTemplate"] = "single.html.twig";
        // line 3
        $context["scope"] = "single";
        // line 1
        $this->parent = $this->loadTemplate("partials/page.html.twig", "single.html.twig", 1);
        $this->parent->display($context, array_merge($this->blocks, $blocks));
    }
 
    // line 5
    public function block_content($context, array $blocks = [])
    {
        // line 6
        echo "
    <div class=\"platform-content\">
        <div class=\"content-wrapper\">
            <section class=\"entry\">
 
                ";
        // line 11
        $this->loadTemplate([0 => (("partials/content-" . ($context["scope"] ?? null)) . ".html.twig"), 1 => "partials/content.html.twig"], "single.html.twig", 11)->display($context);
        // line 12
        echo "
            </section>
        </div> <!-- /content-wrapper -->
    </div>
 
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
            $this->doDisplay($context, $blocks);
        } catch (Error $e) {
            if (!$e->getSourceContext()) {
                $e->setSourceContext($this->getSourceContext());
            }
 
            // this is mostly useful for \Twig\Error\LoaderError exceptions
            // see \Twig\Error\LoaderError
            if (-1 === $e->getTemplateLine()) {
                $e->guess();
            }
 
            throw $e;
        } catch (\Exception $e) {
            $e = new RuntimeError(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, $this->getSourceContext(), $e);
            $e->guess();
 
            throw $e;
        }
    }
 
    {
        return $this;
    }
 
    /**
     * Returns all blocks.
     *
     * This method is for internal use only and should never be called
     * directly.
     *
     * @return array An array of blocks
     */
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
    public function getBlocks()
    {
        return $this->blocks;
    }
 
    public function display(array $context, array $blocks = [])
    {
        $this->displayWithErrorHandling($this->env->mergeGlobals($context), array_merge($this->blocks, $blocks));
    }
 
    public function render(array $context)
    {
        $level = ob_get_level();
        if ($this->env->isDebug()) {
            ob_start();
        } else {
            ob_start(function () { return ''; });
        }
        try {
            $this->display($context);
        } catch (\Exception $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        } catch (\Throwable $e) {
            while (ob_get_level() > $level) {
                ob_end_clean();
            }
 
            throw $e;
        }
 
        return ob_get_clean();
    }
 
    protected function displayWithErrorHandling(array $context, array $blocks = [])
    {
        try {
     * @internal
     */
    public function __construct(Environment $env, Template $template)
    {
        $this->env = $env;
        $this->template = $template;
    }
 
    /**
     * Renders the template.
     *
     * @param array $context An array of parameters to pass to the template
     *
     * @return string The rendered template
     */
    public function render($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        return $this->template->render($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Displays the template.
     *
     * @param array $context An array of parameters to pass to the template
     */
    public function display($context = [])
    {
        // using func_get_args() allows to not expose the blocks argument
        // as it should only be used by internal code
        $this->template->display($context, \func_num_args() > 1 ? func_get_arg(1) : []);
    }
 
    /**
     * Checks if a block is defined.
     *
     * @param string $name    The block name
     * @param array  $context An array of parameters to pass to the template
     *
 
        $key = null;
        $output = false;
        if ( false !== $expires ) {
            ksort($data);
            $key = md5($file.json_encode($data));
            $output = $this->get_cache($key, self::CACHEGROUP, $cache_mode);
        }
 
        if ( false === $output || null === $output ) {
            $twig = $this->get_twig();
            if ( strlen($file) ) {
                $loader = $this->get_loader();
                $result = $loader->getCacheKey($file);
                do_action('timber_loader_render_file', $result);
            }
            $data = apply_filters('timber_loader_render_data', $data);
            $data = apply_filters('timber/loader/render_data', $data, $file);
            $template = $twig->load($file);
            $output = $template->render($data);
        }
 
        if ( false !== $output && false !== $expires && null !== $key ) {
            $this->delete_cache();
            $this->set_cache($key, $output, self::CACHEGROUP, $expires, $cache_mode);
        }
        $output = apply_filters('timber_output', $output);
        return apply_filters('timber/output', $output, $data, $file);
    }
 
    protected function delete_cache() {
        Cleaner::delete_transients();
    }
 
    /**
     * Get first existing template.
     *
     * @param array|string $templates  Name(s) of the Twig template(s) to choose from.
     * @return string|bool             Name of chosen template, otherwise false.
     */
        if ( $via_render ) {
            $file = apply_filters('timber_render_file', $file);
        } else {
            $file = apply_filters('timber_compile_file', $file);
        }
 
        $output = false;
 
        if ($file !== false) {
            if ( is_null($data) ) {
                $data = array();
            }
 
            if ( $via_render ) {
                $data = apply_filters('timber_render_data', $data);
            } else {
                $data = apply_filters('timber_compile_data', $data);
            }
 
            $output = $loader->render($file, $data, $expires, $cache_mode);
        } else {
            if ( is_array($filenames) ) {
                $filenames = implode(", ", $filenames);
            }
            Helper::error_log( 'Error loading your template files: '.$filenames.'. Make sure one of these files exists.' );
        }
 
        do_action('timber_compile_done');
        return $output;
    }
 
    /**
     * Compile a string.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
        $twig = $dummy_loader->get_twig();
        $template = $twig->createTemplate($string);
        return $template->render($data);
    }
 
    /**
     * Fetch function.
     *
     * @api
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The returned output.
     */
    public static function fetch( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::compile($filenames, $data, $expires, $cache_mode, true);
        $output = apply_filters('timber_compile_result', $output);
        return $output;
    }
 
    /**
     * Render function.
     *
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     * Passes data to a Twig file and echoes the output.
     *
     * @api
     * @example
     * ```php
     * $context = Timber::context();
     *
     * Timber::render( 'index.twig', $context );
     * ```
     * @param array|string $filenames  Name of the Twig file to render. If this is an array of files, Timber will
     *                                 render the first file that exists.
     * @param array        $data       Optional. An array of data to use in Twig template.
     * @param bool|int     $expires    Optional. In seconds. Use false to disable cache altogether. When passed an
     *                                 array, the first value is used for non-logged in visitors, the second for users.
     *                                 Default false.
     * @param string       $cache_mode Optional. Any of the cache mode constants defined in TimberLoader.
     * @return bool|string The echoed output.
     */
    public static function render( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT ) {
        $output = self::fetch($filenames, $data, $expires, $cache_mode);
        echo $output;
        return $output;
    }
 
    /**
     * Render a string with Twig variables.
     *
     * @api
     * @example
     * ```php
     * $data = array(
     *     'username' => 'Jane Doe',
     * );
     *
     * Timber::render_string( 'Hi {{ username }}, I’m a string with a custom Twig variable', $data );
     * ```
     * @param string $string A string with Twig variables.
     * @param array  $data   An array of data to use in Twig template.
     * @return bool|string
     */
defined('ABSPATH') or die;
 
use Timber\Timber;
 
/*
 * The Template for displaying all single posts
 */
 
$gantry = Gantry\Framework\Gantry::instance();
$theme  = $gantry['theme'];
 
// We need to render contents of <head> before plugin content gets added.
$context              = Timber::get_context();
$context['page_head'] = $theme->render('partials/page_head.html.twig', $context);
 
$post            = Timber::query_post();
$context['post'] = $post;
$context['wp_title'] .= ' - ' . $post->title();
 
Timber::render(['single-' . $post->ID . '.html.twig', 'single-' . $post->post_type . '.html.twig', 'single.html.twig'], $context);
 
            }
 
            break;
        }
    }
 
    if ( ! $template ) {
        $template = get_index_template();
    }
 
    /**
     * Filters the path of the current template before including it.
     *
     * @since 3.0.0
     *
     * @param string $template The path of the template to include.
     */
    $template = apply_filters( 'template_include', $template );
    if ( $template ) {
        include $template;
    } elseif ( current_user_can( 'switch_themes' ) ) {
        $theme = wp_get_theme();
        if ( $theme->errors() ) {
            wp_die( $theme->errors() );
        }
    }
    return;
}
 
<?php
/**
 * Loads the WordPress environment and template.
 *
 * @package WordPress
 */
 
if ( ! isset( $wp_did_header ) ) {
 
    $wp_did_header = true;
 
    // Load the WordPress library.
    require_once __DIR__ . '/wp-load.php';
 
    // Set up the WordPress query.
    wp();
 
    // Load the theme template.
    require_once ABSPATH . WPINC . '/template-loader.php';
 
}
 
<?php
/**
 * Front to the WordPress application. This file doesn't do anything, but loads
 * wp-blog-header.php which does and tells WordPress to load the theme.
 *
 * @package WordPress
 */
 
/**
 * Tells WordPress to load the WordPress theme and output it.
 *
 * @var bool
 */
define( 'WP_USE_THEMES', true );
 
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
 

Environment & details:

empty
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE Apache
REQUEST_URI /mdocs-posts/clc-response-sustainable-schools-apr-2007/
USER clckadmin
HOME /var/www/vhosts/childrenslawcentre.org.uk
SCRIPT_NAME /index.php
QUERY_STRING
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.0
GATEWAY_INTERFACE CGI/1.1
REDIRECT_URL /mdocs-posts/clc-response-sustainable-schools-apr-2007/
REMOTE_PORT 47324
SCRIPT_FILENAME /var/www/vhosts/childrenslawcentre.org.uk/httpdocs/index.php
SERVER_ADMIN [no address given]
CONTEXT_DOCUMENT_ROOT /var/www/vhosts/childrenslawcentre.org.uk/httpdocs
CONTEXT_PREFIX
REQUEST_SCHEME https
DOCUMENT_ROOT /var/www/vhosts/childrenslawcentre.org.uk/httpdocs
REMOTE_ADDR 3.236.214.224
SERVER_PORT 443
SERVER_ADDR 109.228.39.169
SERVER_NAME childrenslawcentre.org.uk
SERVER_SIGNATURE <address>Apache Server at childrenslawcentre.org.uk Port 443</address>
PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HTTP_ACCEPT_ENCODING br,gzip
HTTP_IF_MODIFIED_SINCE Mon, 08 Mar 2021 06:21:54 GMT
HTTP_ACCEPT_LANGUAGE en-US,en;q=0.5
HTTP_ACCEPT text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_USER_AGENT CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_CONNECTION close
HTTP_X_ACCEL_INTERNAL /internal-nginx-static-location
HTTP_X_REAL_IP 3.236.214.224
HTTP_HOST childrenslawcentre.org.uk
proxy-nokeepalive 1
HTTPS on
HTTP_AUTHORIZATION
REDIRECT_STATUS 200
REDIRECT_HTTPS on
REDIRECT_HTTP_AUTHORIZATION
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1623885044.9888
REQUEST_TIME 1623885044
empty
0. Whoops\Handler\PrettyPageHandler