Whoops \ Exception \ ErrorException (E_WARNING)
Undefined property: WP_Post_Type::$post_type Whoops\Exception\ErrorException thrown with message "Undefined property: WP_Post_Type::$post_type" Stacktrace: #13 Whoops\Exception\ErrorException in /home/sites/22a/7/7a73d6af3d/public_html/wp-content/plugins/gantry5/src/classes/Gantry/WordPress/Assignments/AssignmentsPost.php:42 #12 Gantry\Component\Whoops\SystemFacade:handleError in /home/sites/22a/7/7a73d6af3d/public_html/wp-content/plugins/gantry5/src/classes/Gantry/WordPress/Assignments/AssignmentsPost.php:42 #11 Gantry\WordPress\Assignments\AssignmentsPost:getRules in /home/sites/22a/7/7a73d6af3d/public_html/wp-content/plugins/gantry5/src/classes/Gantry/Component/Assignments/AbstractAssignments.php:171 #10 Gantry\Component\Assignments\AbstractAssignments:getPage in /home/sites/22a/7/7a73d6af3d/public_html/wp-content/plugins/gantry5/src/classes/Gantry/Framework/Assignments.php:88 #9 Gantry\Framework\Assignments:getPage in /home/sites/22a/7/7a73d6af3d/public_html/wp-content/plugins/gantry5/src/classes/Gantry/Component/Assignments/AbstractAssignments.php:305 #8 Gantry\Component\Assignments\AbstractAssignments:init in /home/sites/22a/7/7a73d6af3d/public_html/wp-content/plugins/gantry5/src/classes/Gantry/Component/Assignments/AbstractAssignments.php:102 #7 Gantry\Component\Assignments\AbstractAssignments:scores in /home/sites/22a/7/7a73d6af3d/public_html/wp-content/plugins/gantry5/src/classes/Gantry/Component/Assignments/AbstractAssignments.php:89 #6 Gantry\Component\Assignments\AbstractAssignments:select in /home/sites/22a/7/7a73d6af3d/public_html/wp-content/plugins/gantry5/src/classes/Gantry/Framework/Theme.php:164 #5 Gantry\Framework\Theme:set_template_layout in /home/sites/22a/7/7a73d6af3d/public_html/wp-includes/class-wp-hook.php:341 #4 WP_Hook:apply_filters in /home/sites/22a/7/7a73d6af3d/public_html/wp-includes/class-wp-hook.php:365 #3 WP_Hook:do_action in /home/sites/22a/7/7a73d6af3d/public_html/wp-includes/plugin.php:522 #2 do_action in /home/sites/22a/7/7a73d6af3d/public_html/wp-includes/template-loader.php:23 #1 require_once in /home/sites/22a/7/7a73d6af3d/public_html/wp-blog-header.php:19 #0 require in /home/sites/22a/7/7a73d6af3d/public_html/index.php:17
Stack frames (14)
13
Whoops\Exception\ErrorException
/src/classes/Gantry/WordPress/Assignments/AssignmentsPost.php42
12
Gantry\Component\Whoops\SystemFacade handleError
/src/classes/Gantry/WordPress/Assignments/AssignmentsPost.php42
11
Gantry\WordPress\Assignments\AssignmentsPost getRules
/src/classes/Gantry/Component/Assignments/AbstractAssignments.php171
10
Gantry\Component\Assignments\AbstractAssignments getPage
/src/classes/Gantry/Framework/Assignments.php88
9
Gantry\Framework\Assignments getPage
/src/classes/Gantry/Component/Assignments/AbstractAssignments.php305
8
Gantry\Component\Assignments\AbstractAssignments init
/src/classes/Gantry/Component/Assignments/AbstractAssignments.php102
7
Gantry\Component\Assignments\AbstractAssignments scores
/src/classes/Gantry/Component/Assignments/AbstractAssignments.php89
6
Gantry\Component\Assignments\AbstractAssignments select
/src/classes/Gantry/Framework/Theme.php164
5
Gantry\Framework\Theme set_template_layout
/home/sites/22a/7/7a73d6af3d/public_html/wp-includes/class-wp-hook.php341
4
WP_Hook apply_filters
/home/sites/22a/7/7a73d6af3d/public_html/wp-includes/class-wp-hook.php365
3
WP_Hook do_action
/home/sites/22a/7/7a73d6af3d/public_html/wp-includes/plugin.php522
2
do_action
/home/sites/22a/7/7a73d6af3d/public_html/wp-includes/template-loader.php23
1
require_once
/home/sites/22a/7/7a73d6af3d/public_html/wp-blog-header.php19
0
require
/home/sites/22a/7/7a73d6af3d/public_html/index.php17
 */
class AssignmentsPost implements AssignmentsInterface
{
    public $type = 'post';
    public $priority = 6;
 
    /**
     * Returns list of rules which apply to the current page.
     *
     * @return array
     */
    public function getRules()
    {
        $rules = [];
 
        $queried_object = \get_queried_object();
 
        if ($queried_object !== null) {
            if (\is_singular()) {
                $post_type = $queried_object->post_type;
                $id        = $queried_object->ID;
 
                $rules[$post_type][$id] = $this->priority;
                $rules[$post_type]['is_singular'] = $this->priority;
 
                // Get current post type taxonomies and its terms
                $taxonomies = \get_object_taxonomies($queried_object);
                if (!empty($taxonomies)) {
                    foreach ($taxonomies as $tax) {
                        $args = [
                            'orderby' => 'name',
                            'order'   => 'ASC',
                            'fields'  => 'all'
                        ];
 
                        $terms = \wp_get_post_terms($id, $tax, $args);
 
                        foreach ($terms as $term) {
                            $rules[$post_type . '-terms'][$tax . '-' . $term->term_id] = $this->priority;
                        }
 */
class AssignmentsPost implements AssignmentsInterface
{
    public $type = 'post';
    public $priority = 6;
 
    /**
     * Returns list of rules which apply to the current page.
     *
     * @return array
     */
    public function getRules()
    {
        $rules = [];
 
        $queried_object = \get_queried_object();
 
        if ($queried_object !== null) {
            if (\is_singular()) {
                $post_type = $queried_object->post_type;
                $id        = $queried_object->ID;
 
                $rules[$post_type][$id] = $this->priority;
                $rules[$post_type]['is_singular'] = $this->priority;
 
                // Get current post type taxonomies and its terms
                $taxonomies = \get_object_taxonomies($queried_object);
                if (!empty($taxonomies)) {
                    foreach ($taxonomies as $tax) {
                        $args = [
                            'orderby' => 'name',
                            'order'   => 'ASC',
                            'fields'  => 'all'
                        ];
 
                        $terms = \wp_get_post_terms($id, $tax, $args);
 
                        foreach ($terms as $term) {
                            $rules[$post_type . '-terms'][$tax . '-' . $term->term_id] = $this->priority;
                        }
 
    /**
     * Get all assignments for the current page.
     *
     * @return array
     */
    public function getPage()
    {
        $list = [];
 
        foreach($this->types() as $class => $type) {
            $class = is_numeric($class) ? sprintf($this->className, $this->platform, ucfirst($type)) : $class;
 
            if (!class_exists($class)) {
                throw new \RuntimeException("Assignment type {$type} is missing");
            }
 
            /** @var AssignmentsInterface $instance */
            $instance = new $class;
            $list[$type] = $instance->getRules();
            unset($instance);
        }
 
        return $list;
    }
 
    /**
     * Filter assignments data.
     *
     * @param array $data
     * @param bool $minimize
     * @return array
     */
    public function filter(array $data, $minimize = false)
    {
        $types = [];
        foreach ($this->types() as $type) {
            $types[$type] = [];
        }
 
        $gantry = Gantry::instance();
 
        // Use a concrete event with declared property to avoid PHP 8.2+ dynamic property deprecations.
        $event = new class extends Event {
            /** @var array */
            public $types = [];
        };
        $event->types = $types;
 
        $gantry->fireEvent('assignments.types', $event);
 
        return \apply_filters('gantry5_assignments_types', $event->types);
    }
 
    /**
     * @return array
     */
    public function getPage()
    {
        $list = parent::getPage();
 
        \do_action('gantry5_assignments_page', $list);
 
        return $list;
    }
}
 
    public function setAssignment($value)
    {
    }
 
    /**
     * Get extra options for assignments.
     *
     * @return array
     */
    public function assignmentOptions()
    {
        return [];
    }
 
    protected function init()
    {
        if (!$this->filter) {
            $this->filter = new AssignmentFilter;
            $this->candidates = $this->loadAssignments();
            $this->page = $this->getPage();
        }
    }
 
    /**
     * Return list of assignment types.
     *
     * @return array
     */
    abstract public function types();
}
 
     *
     * @param string $default
     * @return string
     */
    public function select($default = 'default')
    {
        $scores = $this->scores();
 
        return key($scores) ?: $default;
    }
 
    /**
     * List matching outlines sorted by score.
     *
     * @param array|null $candidates
     * @return array
     */
    public function scores(?array $candidates = null)
    {
        $this->init();
        $candidates = $candidates ?: $this->candidates;
 
        return $this->filter->scores($candidates, $this->page, $this->specialFilterMethod);
    }
 
    /**
     * List matching outlines with matched assignments.
     *
     * @param array|null $candidates
     * @return array
     */
    public function matches(?array $candidates = null)
    {
        $this->init();
        $candidates = $candidates ?: $this->candidates;
 
        return $this->filter->matches($candidates, $this->page, $this->specialFilterMethod);
    }
 
    /**
 
    /**
     * Set (save) assignments.
     *
     * @param array $data
     */
    public function set(array $data)
    {
        $this->save($data);
    }
 
    /**
     * Select assigned outline.
     *
     * @param string $default
     * @return string
     */
    public function select($default = 'default')
    {
        $scores = $this->scores();
 
        return key($scores) ?: $default;
    }
 
    /**
     * List matching outlines sorted by score.
     *
     * @param array|null $candidates
     * @return array
     */
    public function scores(?array $candidates = null)
    {
        $this->init();
        $candidates = $candidates ?: $this->candidates;
 
        return $this->filter->scores($candidates, $this->page, $this->specialFilterMethod);
    }
 
    /**
     * List matching outlines with matched assignments.
     * @return string
     */
    public function render($file, array $context = [])
    {
        static $timberContext;
 
        if (!isset($timberContext)) {
            $timberContext = Timber::get_context();
        }
 
        // Include Gantry specific things to the context.
        $context = array_replace($timberContext, $context);
 
        return $this->renderer()->render($file, $context);
    }
 
    public function set_template_layout()
    {
        $assignments = new Assignments();
        $selected = $assignments->select();
 
        if (\GANTRY_DEBUGGER) {
            Debugger::addMessage('Selecting outline (rules, matches, scores):', 'debug');
            Debugger::addMessage($assignments->getPage(), 'debug');
            Debugger::addMessage($assignments->matches(), 'debug');
            Debugger::addMessage($assignments->scores(), 'debug');
        }
 
        $this->setLayout($selected);
    }
 
    public function widgets_init()
    {
        $gantry = Gantry::instance();
 
        /** @var Outlines $outlines */
        $outlines = $gantry['outlines'];
 
        // Positions are set inside layouts and we need to grab all of them as we do not yet know which layout will be
        // displayed. We also need to register all the positions for the admin.
 
        $this->iterations[ $nesting_level ] = $this->priorities;
 
        $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, $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.
        } 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.
     */
    public function do_action( $args ) {
        $this->doing_action = true;
        $this->apply_filters( '', $args );
 
        // If there are recursive calls to the current action, we haven't finished it until we get to the last one.
        if ( ! $this->nesting_level ) {
            $this->doing_action = false;
        }
    }
 
    /**
     * Processes the functions hooked into the 'all' hook.
     *
     * @since 4.7.0
     *
     * @param array $args Arguments to pass to the hook callbacks. Passed by reference.
     */
    public function do_all_hook( &$args ) {
        $nesting_level                      = $this->nesting_level++;
        $this->iterations[ $nesting_level ] = $this->priorities;
 
        do {
            $priority = current( $this->iterations[ $nesting_level ] );
    if ( ! isset( $wp_filter[ $hook_name ] ) ) {
        if ( isset( $wp_filter['all'] ) ) {
            array_pop( $wp_current_filter );
        }
 
        return;
    }
 
    if ( ! isset( $wp_filter['all'] ) ) {
        $wp_current_filter[] = $hook_name;
    }
 
    if ( empty( $arg ) ) {
        $arg[] = '';
    } elseif ( is_array( $arg[0] ) && 1 === count( $arg[0] ) && isset( $arg[0][0] ) && is_object( $arg[0][0] ) ) {
        // Backward compatibility for PHP4-style passing of `array( &$this )` as action `$arg`.
        $arg[0] = $arg[0][0];
    }
 
    $wp_filter[ $hook_name ]->do_action( $arg );
 
    array_pop( $wp_current_filter );
}
 
/**
 * Calls the callback functions that have been added to an action hook, specifying arguments in an array.
 *
 * @since 2.1.0
 *
 * @see do_action() This function is identical, but the arguments passed to the
 *                  functions hooked to `$hook_name` are supplied using an array.
 *
 * @global WP_Hook[] $wp_filter         Stores all of the filters and actions.
 * @global int[]     $wp_actions        Stores the number of times each action was triggered.
 * @global string[]  $wp_current_filter Stores the list of current filters with the current one last.
 *
 * @param string $hook_name The name of the action to be executed.
 * @param array  $args      The arguments supplied to the functions hooked to `$hook_name`.
 */
function do_action_ref_array( $hook_name, $args ) {
 *
 * @package WordPress
 */
if ( wp_using_themes() ) {
    /**
     * Fires before determining which template to load.
     *
     * This action hook executes just before WordPress determines which template page to load.
     * It is a good hook to use if you need to do a redirect with full knowledge of the content
     * that has been queried.
     *
     * Note: Loading a different template is not a good use of this hook. If you include another template
     * and then use `exit()` or `die()`, no subsequent `template_redirect` hooks will be run, which could
     * break the site’s functionality. Instead, use the {@see 'template_include'} filter hook to return
     * the path to the new template you want to use. This will allow an alternative template to be used
     * without interfering with the WordPress loading process.
     *
     * @since 1.5.0
     */
    do_action( 'template_redirect' );
}
 
/**
 * Filters whether to allow 'HEAD' requests to generate content.
 *
 * Provides a significant performance bump by exiting before the page
 * content loads for 'HEAD' requests. See #14348.
 *
 * @since 3.5.0
 *
 * @param bool $exit Whether to exit without generating any content for 'HEAD' requests. Default true.
 */
if ( 'HEAD' === $_SERVER['REQUEST_METHOD'] && apply_filters( 'exit_on_http_head', true ) ) {
    exit;
}
 
// Process feeds and trackbacks even if not using themes.
if ( is_robots() ) {
    /**
     * Fired when the template loader determines a robots.txt request.
<?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:

Key Value
pagename calendar
shortcode 3f42eefd
empty
empty
empty
empty
Key Value
SERVER_SOFTWARE Apache
REQUEST_URI /diary/month/?pagename=calendar&shortcode=3f42eefd
USER 7a73d6af3d
HOME /home/sites/22a/7/7a73d6af3d/
SCRIPT_NAME /index.php
QUERY_STRING pagename=calendar&shortcode=3f42eefd
REQUEST_METHOD GET
SERVER_PROTOCOL HTTP/1.1
GATEWAY_INTERFACE CGI/1.1
REDIRECT_QUERY_STRING pagename=calendar&shortcode=3f42eefd
REDIRECT_URL /diary/month/
REMOTE_PORT 58206
SCRIPT_FILENAME /home/sites/22a/7/7a73d6af3d/public_html/index.php
SERVER_ADMIN your hosting provider
CONTEXT_DOCUMENT_ROOT /home/sites/22a/7/7a73d6af3d/public_html/
CONTEXT_PREFIX
REQUEST_SCHEME http
DOCUMENT_ROOT /home/sites/22a/7/7a73d6af3d/public_html/
REMOTE_ADDR 216.73.216.233
SERVER_PORT 80
SERVER_ADDR 127.0.0.1
SERVER_NAME stourtoncaundle.org.uk
SERVER_SIGNATURE
PATH /sbin:/usr/sbin:/bin:/usr/bin
HTTP_X_STACKPROTECT_RATE_LIMIT_INTERVAL 60
HTTP_X_STACKPROTECT_RATE_LIMIT 60
HTTP_X_STACKPROTECT_LIMITER_ROLE botweb
HTTP_X_CAPTCHA_ACL malware_expert_drop
HTTP_X_CAPTCHA_IP 216.73.216.233
HTTP_X_BALANCED_USERNAME 7a73d6af3d-c8d534dc0025bb60edb32e146347f4e5
HTTP_X_ASN 16509
HTTP_X_COUNTRY US
HTTP_X_PROTO SSL
HTTP_X_SERVICE_LEVEL wordpress
HTTP_X_FORWARDED_FOR 216.73.216.233
HTTP_X_TARGET_DC LHR
HTTP_X_FORWARDED_PROTO https
HTTP_PS_CAPABILITYLIST fully general optimizations only
HTTP_X_BALANCED_HOST stourtoncaundle.org.uk
HTTP_CDN_LOOP StackCDN
HTTP_STACKCDN_CONNECTING_IP 216.73.216.233
HTTP_X_TARGET_IP 185.151.30.182
HTTP_STACKCDN_CONNECTING_ASN 16509
HTTP_USER_AGENT Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
HTTP_ACCEPT */*
HTTP_HOST stourtoncaundle.org.uk
proxy-nokeepalive 1
stackSUPHPpath /etc/suphpwp.conf
MAGICK_THREAD_LIMIT 1
PHP_VERSION 83
USERNAME 7a73d6af3d
USERNAME_REAL 7a73d6af3d
SCRIPT_URI http://stourtoncaundle.org.uk/diary/month/
SCRIPT_URL /diary/month/
HTTP_AUTHORIZATION
HTTPS on
UNIQUE_ID amQ9kveYv93pHFjJs0xboAAAAQE
REDIRECT_STATUS 200
REDIRECT_MAGICK_THREAD_LIMIT 1
REDIRECT_USERNAME 7a73d6af3d
REDIRECT_USERNAME_REAL 7a73d6af3d
REDIRECT_SCRIPT_URI http://stourtoncaundle.org.uk/diary/month/
REDIRECT_SCRIPT_URL /diary/month/
REDIRECT_HTTP_AUTHORIZATION
REDIRECT_HTTPS on
REDIRECT_UNIQUE_ID amQ9kveYv93pHFjJs0xboAAAAQE
FCGI_ROLE RESPONDER
PHP_SELF /index.php
REQUEST_TIME_FLOAT 1784954258.8637
REQUEST_TIME 1784954258
empty
0. Whoops\Handler\PrettyPageHandler