/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/views/page-microsite.html.twig
{% extends 'layout/base.html.twig' %}
{% block content %}
<article class="entry {{ post.class }}">
{# Begin Page Header #}
{% include 'partials/slider.html.twig' %}
{# Check if post is password protected #}
{% if not function( 'post_password_required', post.ID ) %}
<section>
<div class="container-fluid">
<div class="row">
<div class="col-12 entry-content">
{{ post.content }}
</div>
</div>
</div>
</section>
{% else %}
{# Begin Password Protected Form #}
<div class="password-form">
{# Include the password form #}
{% include 'partials/password-form.html.twig' %}
</div>
{# End Password Protected Form #}
{% endif %}
</article>
{% endblock %}
{% block scripts %}
<script>document.home_slides = {{ slides|json_encode }}</script>
{% endblock %}
/home/sacs.nsw.edu.au/public_html/wp-content/plugins/custom-facebook-feed-pro/inc/Integrations/CFF_Graph_Data.php
if (false !== $this->feed_cache->get($cache_type . '_backup')) {
$posts_json = $this->feed_cache->get($cache_type . '_backup');
$error_message = isset($fb_data->error->message) ? $fb_data->error->message : '';
$error_type = isset($fb_data->error->type) ? $fb_data->error->type : '';
$error_json = [
'cached_error' => [
'message' => $error_message,
'type' => $error_type
]
];
if (!empty($posts_json)) {
array_push(
$error_json,
json_decode($posts_json, true)
);
}
$posts_json = wp_json_encode($error_json);
}
return $posts_json;
}
/**
* Check if the Multifeed is Processing Data
* So we can use it for API calls and Caching/Backup insert
*
* @since 5.0
*/
public function multifeed_still_process()
{
return $this->is_multifeed && $this->page_id !== end($this->page_ids);
}
/**
* Process API Erro
*
* @since 5.0
*/
public function process_backup_data($fb_data)
/home/sacs.nsw.edu.au/public_html/wp-content/plugins/custom-facebook-feed-pro/inc/Integrations/CFF_Graph_Data.php
if (false !== $this->feed_cache->get($cache_type . '_backup')) {
$posts_json = $this->feed_cache->get($cache_type . '_backup');
$error_message = isset($fb_data->error->message) ? $fb_data->error->message : '';
$error_type = isset($fb_data->error->type) ? $fb_data->error->type : '';
$error_json = [
'cached_error' => [
'message' => $error_message,
'type' => $error_type
]
];
if (!empty($posts_json)) {
array_push(
$error_json,
json_decode($posts_json, true)
);
}
$posts_json = wp_json_encode($error_json);
}
return $posts_json;
}
/**
* Check if the Multifeed is Processing Data
* So we can use it for API calls and Caching/Backup insert
*
* @since 5.0
*/
public function multifeed_still_process()
{
return $this->is_multifeed && $this->page_id !== end($this->page_ids);
}
/**
* Process API Erro
*
* @since 5.0
*/
public function process_backup_data($fb_data)
/home/sacs.nsw.edu.au/public_html/wp-content/plugins/custom-facebook-feed-pro/inc/Integrations/CFF_Graph_Data.php
* Check if the Multifeed is Processing Data
* So we can use it for API calls and Caching/Backup insert
*
* @since 5.0
*/
public function multifeed_still_process()
{
return $this->is_multifeed && $this->page_id !== end($this->page_ids);
}
/**
* Process API Erro
*
* @since 5.0
*/
public function process_backup_data($fb_data)
{
if (!empty($fb_data)) {
if (isset($fb_data->error)) {
$posts_json = $this->process_api_error($fb_data, $this->cache_type);
$this->set_posts_json($posts_json);
} else {
if ($this->cache_type === 'posts') {
$this->feed_cache->after_new_posts_retrieved();
}
}
$this->feed_cache->update_or_insert($this->cache_type, $this->posts_json);
}
}
/**
* Triggered when clicking the Load More Button
* to Get new Feed Posts
*
* @since 5.0
*/
public function load_more_feed_data()
{
if (is_null($this->next_urls_arr_safe) || empty($this->next_urls_arr_safe)) {
/home/sacs.nsw.edu.au/public_html/wp-content/plugins/custom-facebook-feed-pro/inc/Integrations/CFF_Graph_Data.php
{
$fb_data_json = !is_array($posts_json) ? json_decode($posts_json) : [];
$fb_data = [];
if (isset($fb_data_json->data)) {
$fb_data = $fb_data_json->data;
} else {
$fb_data = !is_array($posts_json) ? json_decode($posts_json) : [];
}
$posts_json = [
'api_url' => $this->graph_url,
'shortcode_options' => $this->shortcode_atts,
'data' => $fb_data
];
if (isset($fb_data_json->paging)) {
$posts_json['paging'] = $fb_data_json->paging;
}
$posts_json = wp_json_encode($posts_json, true);
$this->set_posts_json($posts_json);
$this->process_backup_data($fb_data);
}
/**
* Process Posts JSON Response
*
* @since 5.0
*/
public function process_cached_posts_json()
{
$posts_json = $this->feed_cache->get($this->cache_type_page);
if ($posts_json !== null && strpos($posts_json, '"error":{"message":') !== false && false !== get_transient('!cff_backup_' . $this->transient_name)) {
$posts_json = $this->feed_cache->get($this->cache_type . '_backup');
}
if ($posts_json === false) {
$posts_json = $this->get_remote_data();
}
$this->set_posts_json($posts_json);
}
/**
/home/sacs.nsw.edu.au/public_html/wp-content/plugins/custom-facebook-feed-pro/inc/Integrations/CFF_Graph_Data.php
* Get Group Posts
*
* @since 5.0
*/
public static function should_make_group_call()
{
return time() < strtotime('2024-4-22');
}
/**
* Get Feed Data
*
* @since 5.0
*/
public function get_feed_data()
{
if ($this->feed_cache->is_expired($this->cache_type) || $this->is_customizer) {
$posts_json = $this->get_posts_json_byfeed_type();
$this->process_posts_json_response($posts_json);
} else {
$this->process_cached_posts_json();
}
if ($this->is_group) {
$posts_json = $this->get_group_posts();
$this->set_posts_json($posts_json);
}
return $this->get_posts_json();
}
/**
* Process Posts JSON Response
*
* @since 5.0
*/
public function process_posts_json_response($posts_json)
{
$fb_data_json = !is_array($posts_json) ? json_decode($posts_json) : [];
$fb_data = [];
/home/sacs.nsw.edu.au/public_html/wp-content/plugins/custom-facebook-feed-pro/inc/CFF_Shortcode.php
$page_access_token = $feed_options['pagetoken'];
$page_id = trim($feed_options['id']);
$cff_album_id = $feed_options['album'];
$is_multifeed = $feed_options['multifeedactive'] === true && function_exists('cff_multifeed_ids');
$page_ids = $is_multifeed ? cff_multifeed_ids($page_id) : [$page_id];
if (!empty($cff_album_id)) {
$page_ids = array($page_ids[0]);
}
$feed_id = isset($feed_options['the_feed_id']) && $feed_options['the_feed_id'] !== false ? $feed_options['the_feed_id'] : false;
$FBdata_arr = [];
// Loop through page IDs
foreach ($page_ids as $page_id) {
// Are there more posts to get for this ID?
$graph_data = new CFF_Graph_Data($page_id, $page_ids, $feed_id, $feed_options, $data_att_html, $next_urls_arr_safe, $is_customizer, $FBdata_arr);
if (!is_null($next_urls_arr_safe)) {
$feed_data = $graph_data->load_more_feed_data();
} else {
$feed_data = $graph_data->get_feed_data();
}
$FBdata = $feed_data !== 'no_more_posts' ? json_decode($feed_data) : $feed_data;
$FBdata_arr[$page_id] = $FBdata;
} //End page_id loop
return $FBdata_arr;
}
public static function check_published_videos($data_array)
{
$result = [];
foreach ($data_array as $page_id => $single_page) {
if (isset($single_page->data)) {
$post_data = [];
foreach ($single_page->data as $post) {
if (isset($post->status->publishing_phase->publish_time)) {
array_push($post_data, $post);
}
}
$single_page->data = $post_data;
/home/sacs.nsw.edu.au/public_html/wp-content/plugins/custom-facebook-feed-pro/inc/CFF_Shortcode_Display.php
if (count($feed_list) !== 1) {
return '';
}
}
return "<span id='cff-no-id'>" . sprintf(__("No feed found with the ID %s. Go to the %sAll Feeds page%s and select an ID from an existing feed.", 'custom-facebook-feed'), esc_html($feed_options['feederror']), '<a href="' . esc_url(admin_url('admin.php?page=cff-feed-builder')) . '">', '</a>') . "</span><br /><br />";
}
if ($feed_options['cff_enqueue_with_shortcode'] === 'on' || $feed_options['cff_enqueue_with_shortcode'] === 'true') {
wp_enqueue_style('cff');
wp_enqueue_script('cffscripts');
}
$mobile_num = isset($this->feed_options['nummobile']) && (int)$this->feed_options['nummobile'] > 0 ? (int)$this->feed_options['nummobile'] : 0;
$desk_num = isset($this->feed_options['num']) && (int)$this->feed_options['num'] > 0 ? (int)$this->feed_options['num'] : 0;
if ($desk_num < $mobile_num) {
$this->feed_options['minnum'] = $mobile_num;
}
$json_data_arr = CFF_Shortcode::cff_get_json_data($this->feed_options, null, $data_att_html);
isset($json_data_arr) ? $next_urls_arr_safe = CFF_Shortcode::cff_get_next_url_parts($json_data_arr) : $next_urls_arr_safe = '';
$html = $this->cff_get_post_set_html($this->feed_options, $json_data_arr, $original_atts);
// Create the prev URLs array to add to the button
$prev_info = $this->cff_get_prev_url_parts($json_data_arr);
$prev_urls_arr_safe = $prev_info['prev_urls_arr_safe'];
$json_data = $prev_info['json_data'];
$page_id = $this->feed_options['id'];
// ***FEED CONTAINER HTML (header, likebox, load more, etc)***//
// Width
$cff_feed_width = CFF_Utils::get_css_distance($this->feed_options[ 'width' ]) ;
// Set to be 100% width on mobile?
$cff_feed_width_resp = $this->feed_options[ 'widthresp' ];
( $cff_feed_width_resp == 'on' || $cff_feed_width_resp == 'true' || $cff_feed_width_resp == true ) ? $cff_feed_width_resp = true : $cff_feed_width_resp = false;
if ($this->feed_options[ 'widthresp' ] == 'false') {
$cff_feed_width_resp = false;
/home/sacs.nsw.edu.au/public_html/wp-includes/shortcodes.php
*
* Returning a non-false value from filter will short-circuit the
* shortcode generation process, returning that value instead.
*
* @since 4.7.0
* @since 6.5.0 The `$attr` parameter is always an array.
*
* @param false|string $output Short-circuit return value. Either false or the value to replace the shortcode with.
* @param string $tag Shortcode name.
* @param array $attr Shortcode attributes array, can be empty if the original arguments string cannot be parsed.
* @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
* @since 6.5.0 The `$attr` parameter is always an array.
*
* @param string $output Shortcode output.
* @param string $tag Shortcode name.
* @param array $attr Shortcode attributes array, can be empty if the original arguments string cannot be parsed.
* @param array $m Regular expression match array.
*/
return apply_filters( 'do_shortcode_tag', $output, $tag, $attr, $m );
}
/**
* Searches 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.
/home/sacs.nsw.edu.au/public_html/wp-includes/shortcodes.php
// 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;
}
// Ensure this context is only added once if shortcodes are nested.
$has_filter = has_filter( 'wp_get_attachment_image_context', '_filter_do_shortcode_context' );
$filter_added = false;
if ( ! $has_filter ) {
$filter_added = add_filter( 'wp_get_attachment_image_context', '_filter_do_shortcode_context' );
}
$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 );
// Only remove the filter if it was added in this scope.
if ( $filter_added ) {
remove_filter( 'wp_get_attachment_image_context', '_filter_do_shortcode_context' );
}
return $content;
}
/**
* Filter the `wp_get_attachment_image_context` hook during shortcode rendering.
*
* When wp_get_attachment_image() is called during shortcode rendering, we need to make clear
* that the context is a shortcode and not part of the theme's template rendering logic.
*
* @since 6.3.0
* @access private
/home/sacs.nsw.edu.au/public_html/wp-includes/class-wp-hook.php
$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.
/home/sacs.nsw.edu.au/public_html/wp-includes/plugin.php
$all_args = func_get_args(); // phpcs:ignore PHPCompatibility.FunctionUse.ArgumentFunctionsReportCurrentValue.NeedsInspection
_wp_call_all_hook( $all_args );
}
if ( ! isset( $wp_filter[ $hook_name ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
// Pass the value to WP_Hook.
array_unshift( $args, $value );
$filtered = $wp_filter[ $hook_name ]->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 `$hook_name` are supplied using an array.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
* @global int[] $wp_filters Stores the number of times each filter 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 filter hook.
* @param array $args The arguments supplied to the functions hooked to `$hook_name`.
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/timber/timber/lib/Post.php
}
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 || strpos($content, '"noTeaser":true') !== false) && strpos($content, '<!-- /wp:more -->') !== false) {
$arr = explode('<!-- /wp:more -->', $content);
return trim($arr[1]);
}
return $content;
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Extension/CoreExtension.php
if ($ignoreStrictCheck || !$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()"/"has%1$s()" or "__call()" exist and have public access in class "%2$s".', $item, $class), $lineno, $source);
}
if ($isDefinedTest) {
return true;
}
if ($sandboxed) {
$env->getExtension(SandboxExtension::class)->checkMethodAllowed($object, $method, $lineno, $source);
}
// 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 {
$ret = $object->$method(...$arguments);
} catch (\BadMethodCallException $e) {
if ($call && ($ignoreStrictCheck || !$env->isStrictVariables())) {
return;
}
throw $e;
}
return $ret;
}
/**
* Returns the values from a single column in the input array.
*
* <pre>
* {% set items = [{ 'fruit' : 'apple'}, {'fruit' : 'orange' }] %}
*
* {% set fruits = items|column('fruit') %}
*
* {# fruits now contains ['apple', 'orange'] #}
* </pre>
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Environment.php
$key = $this->cache->generateKey($name, $mainCls);
if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
$this->cache->load($key);
}
$source = null;
if (!class_exists($cls, false)) {
$source = $this->getLoader()->getSourceContext($name);
$content = $this->compileSource($source);
$this->cache->write($key, $content);
$this->cache->load($key);
if (!class_exists($mainCls, false)) {
/* Last line of defense if either $this->bcWriteCacheFile was used,
* $this->cache is implemented as a no-op or we have a race condition
* where the cache was cleared between the above calls to write to and load from
* the cache.
*/
eval('?>'.$content);
}
if (!class_exists($cls, false)) {
throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
}
}
}
// to be removed in 3.0
$this->extensionSet->initRuntime($this);
return $this->loadedTemplates[$cls] = new $cls($this);
}
/**
* Creates a template from source.
*
* This method should not be used as a generic way to load templates.
*
* @param string $template The template source
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Template.php
{
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, $templateContext ?? $this);
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Environment.php
$key = $this->cache->generateKey($name, $mainCls);
if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
$this->cache->load($key);
}
$source = null;
if (!class_exists($cls, false)) {
$source = $this->getLoader()->getSourceContext($name);
$content = $this->compileSource($source);
$this->cache->write($key, $content);
$this->cache->load($key);
if (!class_exists($mainCls, false)) {
/* Last line of defense if either $this->bcWriteCacheFile was used,
* $this->cache is implemented as a no-op or we have a race condition
* where the cache was cleared between the above calls to write to and load from
* the cache.
*/
eval('?>'.$content);
}
if (!class_exists($cls, false)) {
throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
}
}
}
// to be removed in 3.0
$this->extensionSet->initRuntime($this);
return $this->loadedTemplates[$cls] = new $cls($this);
}
/**
* Creates a template from source.
*
* This method should not be used as a generic way to load templates.
*
* @param string $template The template source
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Template.php
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} 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;
}
}
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Template.php
{
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 (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Environment.php
$key = $this->cache->generateKey($name, $mainCls);
if (!$this->isAutoReload() || $this->isTemplateFresh($name, $this->cache->getTimestamp($key))) {
$this->cache->load($key);
}
$source = null;
if (!class_exists($cls, false)) {
$source = $this->getLoader()->getSourceContext($name);
$content = $this->compileSource($source);
$this->cache->write($key, $content);
$this->cache->load($key);
if (!class_exists($mainCls, false)) {
/* Last line of defense if either $this->bcWriteCacheFile was used,
* $this->cache is implemented as a no-op or we have a race condition
* where the cache was cleared between the above calls to write to and load from
* the cache.
*/
eval('?>'.$content);
}
if (!class_exists($cls, false)) {
throw new RuntimeError(sprintf('Failed to load Twig template "%s", index "%s": cache might be corrupted.', $name, $index), -1, $source);
}
}
}
// to be removed in 3.0
$this->extensionSet->initRuntime($this);
return $this->loadedTemplates[$cls] = new $cls($this);
}
/**
* Creates a template from source.
*
* This method should not be used as a generic way to load templates.
*
* @param string $template The template source
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Template.php
} else {
ob_start(function () { return ''; });
}
try {
$this->display($context);
} 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;
}
}
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Template.php
{
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 (\Throwable $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
}
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/Template.php
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 (\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());
}
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/twig/twig/src/TemplateWrapper.php
* directly (use Twig\Environment::load() instead).
*
* @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
*/
public function render(array $context = []): string
{
// 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_get_args()[1] ?? []);
}
/**
* Displays the template.
*
* @param array $context An array of parameters to pass to the template
*/
public function display(array $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_get_args()[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
*/
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/timber/timber/lib/Loader.php
$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.
*/
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/timber/timber/lib/Timber.php
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',
* );
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/timber/timber/lib/Timber.php
$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
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/vendor/timber/timber/lib/Timber.php
* 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
*/
/home/sacs.nsw.edu.au/public_html/wp-content/themes/sacs2021/page-microsite.php
* @license GNU/GPLv2 and later
*
* http://www.gnu.org/licenses/gpl-2.0.html
*/
defined('ABSPATH') or die;
use Firefly\Timber\FireflyPost;
$context = Timber::get_context();
$post = Timber::query_post(false, FireflyPost::class);
$context['post'] = $post;
// Setup home page slides, and use array_map so we can get the URL for the image.
$context['slides'] = $post->get_field('slider');
$templates = ['page-microsite.html.twig', 'page.html.twig'];
Timber::render($templates, $context);
/home/sacs.nsw.edu.au/public_html/wp-includes/template-loader.php
/**
* 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 ) {
/**
* Fires immediately before including the template.
*
* @since 6.9.0
*
* @param string $template The path of the template about to be included.
*/
do_action( 'wp_before_include_template', $template );
include $template;
} elseif ( current_user_can( 'switch_themes' ) ) {
$theme = wp_get_theme();
if ( $theme->errors() ) {
wp_die( $theme->errors() );
}
}
return;
}
/home/sacs.nsw.edu.au/public_html/wp-blog-header.php
<?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';
}
/home/sacs.nsw.edu.au/public_html/index.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';