/code
/wp-content
/themes
/sifma-wp-theme
/templates
/layouts
/base.twig
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-841774-1', 'auto');
ga('send', 'pageview');
</script>
{% endif %}
{% block head %}
{% endblock %}
<title>
{% block title %}
{% if wp_title %}
{{ wp_title }} - {{ site.name }}
{% else %}
{{ site.name }}
{% endif %}
{% endblock %}
</title>
{{ function( 'wp_head' ) }}
</head>
<body class="{{ body_class }} {% if pagename %}page-name-{{ pagename }}{% endif %}">
{% if (server_name == "www.sifma.org") %}
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-NVT8WFQ"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
{% endif %}
<svg display="none" width="0" height="0" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<defs>
<symbol id="arrows" viewBox="0 0 20 20">
<path d="M10 1l-5 7h10l-5-7zM10 19l5-7h-10l5 7z"></path>
</symbol>
<symbol id="check" viewBox="0 0 39 32">
<path d="M12.571 20.113l-7.542-7.542-5.028 5.028 12.571 12.571 25.142-25.142-5.028-5.028-20.113 20.113z"></path>
</symbol>
<symbol id="download" viewBox="0 0 26 32">
<path fill="#f1f7e8" d="M0 0h21.227l4.373 4.373v27.627h-25.6z"></path>
<path fill="#68a30c" d="M5.511 22.4c0.178 0 0.32 0.036 0.498 0.071 0.142 0.036 0.284 0.107 0.391 0.213s0.213 0.213 0.249 0.391c0.071 0.142 0.107 0.32 0.107 0.533 0 0.249-0.036 0.462-0.107 0.604s-0.142 0.284-0.284 0.391c-0.107 0.107-0.249 0.178-0.356 0.213-0.142 0.036-0.284 0.071-0.391 0.071h-0.853v-2.489h0.747zM5.12 22.72v1.849h0.498c0.071 0 0.178 0 0.284-0.036s0.178-0.071 0.249-0.142c0.071-0.071 0.142-0.178 0.178-0.284s0.071-0.284 0.071-0.462c0-0.107 0-0.249-0.036-0.356s-0.071-0.213-0.142-0.284c-0.071-0.071-0.142-0.142-0.249-0.178s-0.249-0.071-0.391-0.071h-0.462zM8 23.004c0.142 0 0.249 0.036 0.356 0.071s0.213 0.107 0.284 0.213c0.071 0.071 0.142 0.178 0.178 0.32 0.071 0.107 0.071 0.213 0.071 0.356s-0.036 0.284-0.071 0.391c-0.036 0.107-0.107 0.213-0.178 0.32-0.071 0.071-0.178 0.142-0.284 0.213-0.107 0.036-0.249 0.071-0.391 0.071s-0.284-0.036-0.391-0.071-0.213-0.107-0.284-0.213c-0.071-0.071-0.142-0.178-0.178-0.32s0-0.249 0-0.391c0-0.142 0.036-0.284 0.071-0.391s0.107-0.213 0.178-0.32c0.071-0.071 0.178-0.142 0.284-0.213 0.107-0.036 0.213-0.036 0.356-0.036zM8 23.289c-0.178 0-0.284 0.071-0.391 0.178s-0.142 0.284-0.142 0.498c0 0.213 0.036 0.391 0.142 0.498s0.213 0.178 0.391 0.178c0.178 0 0.284-0.071 0.391-0.178s0.142-0.284 0.142-0.498c0-0.213-0.036-0.356-0.142-0.498s-0.213-0.178-0.391-0.178zM11.164 24.889h-0.427l-0.356-1.387-0.356 1.387h-0.427l-0.533-1.849h0.391l0.356 1.458 0.356-1.458h0.391l0.391 1.458 0.356-1.458h0.356l-0.498 1.849zM12.942 23.004c0.213 0 0.356 0.071 0.462 0.178s0.178 0.284 0.178 0.533v1.173h-0.356v-1.28c0-0.071-0.036-0.107-0.071-0.178s-0.071-0.071-0.107-0.107-0.107-0.036-0.178-0.036-0.142 0-0.178 0.036-0.107 0.071-0.142 0.107c-0.036 0.036-0.071 0.107-0.107 0.178s-0.036 0.142-0.036 0.213v1.067h-0.356v-1.849h0.356v0.249c0.071-0.107 0.142-0.178 0.249-0.213 0.071-0.071 0.178-0.071 0.284-0.071zM14.436 24.391v0.107c0 0.036 0 0.036 0.036 0.071l0.036 0.036h0.178v0.284c-0.071 0-0.142 0.036-0.178 0.036-0.142 0-0.213-0.036-0.284-0.107s-0.107-0.178-0.107-0.356v-2.062h0.356v1.991zM15.893 23.004c0.142 0 0.249 0.036 0.356 0.071s0.213 0.107 0.284 0.213c0.071 0.071 0.142 0.178 0.178 0.32 0.036 0.107 0.071 0.249 0.071 0.391s-0.036 0.284-0.071 0.391c-0.036 0.107-0.107 0.213-0.178 0.32-0.071 0.071-0.178 0.142-0.284 0.213-0.107 0.036-0.249 0.071-0.391 0.071s-0.284-0.036-0.391-0.071-0.213-0.107-0.284-0.213c-0.071-0.071-0.142-0.178-0.178-0.32-0.036-0.107-0.071-0.249-0.071-0.391s0.036-0.284 0.071-0.391c0.036-0.107 0.107-0.213 0.178-0.32 0.071-0.071 0.178-0.142 0.284-0.213s0.284-0.071 0.427-0.071zM15.893 23.289c-0.178 0-0.284 0.071-0.391 0.178s-0.142 0.284-0.142 0.498c0 0.213 0.036 0.391 0.142 0.498s0.213 0.178 0.391 0.178c0.178 0 0.284-0.071 0.391-0.178s0.142-0.284 0.142-0.498c0-0.213-0.036-0.356-0.142-0.498-0.107-0.107-0.249-0.178-0.391-0.178zM17.92 23.004c0.142 0 0.249 0 0.356 0.036s0.178 0.071 0.213 0.107c0.071 0.036 0.107 0.107 0.142 0.178s0.036 0.142 0.036 0.249v1.138c0 0.071 0.036 0.142 0.036 0.213h-0.356c0-0.036-0.036-0.071-0.036-0.107v-0.107c-0.071 0.107-0.178 0.142-0.284 0.178s-0.213 0.071-0.32 0.071-0.178 0-0.284-0.036-0.142-0.071-0.213-0.107c-0.036-0.036-0.107-0.107-0.107-0.178s-0.036-0.142-0.036-0.213c0-0.178 0.071-0.284 0.178-0.391s0.284-0.178 0.569-0.213l0.462-0.071v-0.249c0-0.036-0.036-0.071-0.071-0.107s-0.071-0.036-0.107-0.071-0.107 0-0.178 0c-0.142 0-0.249 0.036-0.32 0.071s-0.107 0.142-0.107 0.249h-0.356c0-0.107 0.036-0.178 0.071-0.249s0.071-0.142 0.142-0.178c0.071-0.036 0.142-0.071 0.249-0.107 0.107-0.107 0.213-0.107 0.32-0.107zM17.956 24c-0.178 0.036-0.284 0.071-0.356 0.107s-0.107 0.142-0.107 0.213c0 0.071 0.036 0.142 0.071 0.213s0.142 0.071 0.249 0.071c0.071 0 0.142 0 0.178-0.036 0.071-0.036 0.107-0.036 0.178-0.071 0.036-0.036 0.071-0.071 0.107-0.142s0.036-0.107 0.036-0.178v-0.249l-0.356 0.071zM20.8 24.889h-0.356v-0.213c-0.071 0.107-0.142 0.178-0.249 0.213s-0.213 0.071-0.284 0.071c-0.142 0-0.249-0.036-0.356-0.071s-0.178-0.107-0.249-0.213c-0.071-0.071-0.142-0.178-0.178-0.32s-0.071-0.249-0.071-0.391c0-0.142 0.036-0.284 0.071-0.391s0.107-0.213 0.178-0.32c0.071-0.071 0.142-0.142 0.249-0.213 0.107-0.036 0.213-0.071 0.356-0.071s0.249 0.036 0.32 0.071c0.071 0.036 0.178 0.107 0.213 0.178v-0.818h0.356v2.489zM19.947 23.289c-0.178 0-0.284 0.071-0.391 0.178-0.071 0.107-0.142 0.284-0.142 0.498s0.036 0.391 0.142 0.498c0.071 0.107 0.213 0.178 0.391 0.178 0.071 0 0.142 0 0.213-0.036s0.107-0.071 0.142-0.142l0.107-0.213c0.036-0.071 0.036-0.178 0.036-0.284s0-0.213-0.036-0.284l-0.107-0.213c-0.036-0.071-0.107-0.107-0.142-0.142-0.071 0-0.142-0.036-0.213-0.036z"></path>
<path d="M12.302 17.138l-1.778-1.778-0.747 0.747 3.022 3.022 3.022-3.022-0.747-0.747-1.742 1.707v-9.422h-1.067l0.036 9.493z"></path>
/code
/wp-content
/themes
/sifma-wp-theme
/lib
/Sifma
/Chapter.php
<?php
namespace Sifma;
class Chapter
{
public static function generateAnchorId($name)
{
$anchor_id = preg_replace('@[^a-z0-9-]+@', '-', strtolower($name));
return $anchor_id;
}
public static function registerScripts()
{
wp_register_script('mfb', get_template_directory_uri() . '/static/js/dist/mfb.js', array( 'jquery' ), false, true);
//wp_register_script('custom', get_template_directory_uri() . '/static/js/dist/custom.js', array( 'jquery' ), true, true);
wp_register_script('custom', get_template_directory_uri() . '/static/js/dist/custom.js', array(), filemtime( get_template_directory_uri() . '/static/js/dist/custom.js') );
wp_register_script('ionicons', '//unpkg.com/[email protected]/dist/ionicons/ionicons.js', array( 'jquery' ), false, true);
wp_enqueue_script( 'mfb' );
wp_enqueue_script( 'custom' );
wp_enqueue_script( 'ionicons' );
}
public static function registerShortcodeUi()
{
wp_enqueue_style('mfb', get_template_directory_uri() . '/static/css/mfb.css');
wp_enqueue_style('ionicons', '//unpkg.com/[email protected]/dist/css/ionicons.min.css');
add_action('wp_enqueue_scripts', array(get_called_class(), 'registerScripts'));
add_action('init', array(get_called_class(), 'shortcode_register_sifma_unit_anchor'));
add_action('register_shortcode_ui', array(get_called_class(), 'shortcode_ui_sifma_unit_anchor'));
}
public static function shortcode_register_sifma_unit_anchor()
{
add_shortcode('sifma_unit_anchor', array(get_called_class(), 'shortcode_sifma_unit_anchor'));
}
/code
/wp-content
/themes
/sifma-wp-theme
/lib
/Sifma
/Chapter.php
<?php
namespace Sifma;
class Chapter
{
public static function generateAnchorId($name)
{
$anchor_id = preg_replace('@[^a-z0-9-]+@', '-', strtolower($name));
return $anchor_id;
}
public static function registerScripts()
{
wp_register_script('mfb', get_template_directory_uri() . '/static/js/dist/mfb.js', array( 'jquery' ), false, true);
//wp_register_script('custom', get_template_directory_uri() . '/static/js/dist/custom.js', array( 'jquery' ), true, true);
wp_register_script('custom', get_template_directory_uri() . '/static/js/dist/custom.js', array(), filemtime( get_template_directory_uri() . '/static/js/dist/custom.js') );
wp_register_script('ionicons', '//unpkg.com/[email protected]/dist/ionicons/ionicons.js', array( 'jquery' ), false, true);
wp_enqueue_script( 'mfb' );
wp_enqueue_script( 'custom' );
wp_enqueue_script( 'ionicons' );
}
public static function registerShortcodeUi()
{
wp_enqueue_style('mfb', get_template_directory_uri() . '/static/css/mfb.css');
wp_enqueue_style('ionicons', '//unpkg.com/[email protected]/dist/css/ionicons.min.css');
add_action('wp_enqueue_scripts', array(get_called_class(), 'registerScripts'));
add_action('init', array(get_called_class(), 'shortcode_register_sifma_unit_anchor'));
add_action('register_shortcode_ui', array(get_called_class(), 'shortcode_ui_sifma_unit_anchor'));
}
public static function shortcode_register_sifma_unit_anchor()
{
add_shortcode('sifma_unit_anchor', array(get_called_class(), 'shortcode_sifma_unit_anchor'));
}
/code
/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.
/code
/wp-includes
/class-wp-hook.php
} 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 ] );
/code
/wp-includes
/plugin.php
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 ) {
/code
/wp-includes
/script-loader.php
* @since 2.8.0
*/
do_action( 'wp_print_footer_scripts' );
}
/**
* Wrapper for do_action( 'wp_enqueue_scripts' ).
*
* Allows plugins to queue scripts for the front end using wp_enqueue_script().
* Runs first in wp_head() where all is_home(), is_page(), etc. functions are available.
*
* @since 2.8.0
*/
function wp_enqueue_scripts() {
/**
* Fires when scripts and styles are enqueued.
*
* @since 2.8.0
*/
do_action( 'wp_enqueue_scripts' );
}
/**
* Prints the styles queue in the HTML head on admin pages.
*
* @since 2.8.0
*
* @global bool $concatenate_scripts
*
* @return array
*/
function print_admin_styles() {
global $concatenate_scripts;
$wp_styles = wp_styles();
script_concat_settings();
$wp_styles->do_concat = $concatenate_scripts;
$wp_styles->do_items( false );
/code
/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.
/code
/wp-includes
/class-wp-hook.php
} 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 ] );
/code
/wp-includes
/plugin.php
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 ) {
/code
/wp-includes
/general-template.php
* @param string $before The HTML to output before the date.
* @param string $after The HTML to output after the date.
*/
echo apply_filters( 'the_weekday_date', $the_weekday_date, $before, $after );
}
/**
* Fires the wp_head action.
*
* See {@see 'wp_head'}.
*
* @since 1.2.0
*/
function wp_head() {
/**
* Prints scripts or data in the head tag on the front end.
*
* @since 1.5.0
*/
do_action( 'wp_head' );
}
/**
* Fires the wp_footer action.
*
* See {@see 'wp_footer'}.
*
* @since 1.5.1
*/
function wp_footer() {
/**
* Prints scripts or data before the closing body tag on the front end.
*
* @since 1.5.1
*/
do_action( 'wp_footer' );
}
/**
* Fires the wp_body_open action.
/code
/wp-content
/plugins
/timber-library
/lib
/Twig.php
if ( is_array($arr) ) {
return $arr;
}
$arr = array($arr);
return $arr;
}
/**
*
*
* @param string $function_name
* @return mixed
*/
public function exec_function( $function_name ) {
$args = func_get_args();
array_shift($args);
if ( is_string($function_name) ) {
$function_name = trim($function_name);
}
return call_user_func_array($function_name, ($args));
}
/**
*
*
* @param string $content
* @return string
*/
public function twig_pretags( $content ) {
return preg_replace_callback('|<pre.*>(.*)</pre|isU', array(&$this, 'convert_pre_entities'), $content);
}
/**
*
*
* @param array $matches
* @return string
*/
public function convert_pre_entities( $matches ) {
return str_replace($matches[1], htmlentities($matches[1]), $matches[0]);
/code
/wp-content
/plugins
/timber-library
/lib
/Twig.php
if ( is_array($arr) ) {
return $arr;
}
$arr = array($arr);
return $arr;
}
/**
*
*
* @param string $function_name
* @return mixed
*/
public function exec_function( $function_name ) {
$args = func_get_args();
array_shift($args);
if ( is_string($function_name) ) {
$function_name = trim($function_name);
}
return call_user_func_array($function_name, ($args));
}
/**
*
*
* @param string $content
* @return string
*/
public function twig_pretags( $content ) {
return preg_replace_callback('|<pre.*>(.*)</pre|isU', array(&$this, 'convert_pre_entities'), $content);
}
/**
*
*
* @param array $matches
* @return string
*/
public function convert_pre_entities( $matches ) {
return str_replace($matches[1], htmlentities($matches[1]), $matches[0]);
/code
/wp-content
/plugins
/timber-library
/vendor
/twig
/twig
/src
/Environment.php
} else {
$source = $loader->getSourceContext($name);
}
$content = $this->compileSource($source);
if ($this->bcWriteCacheFile) {
$this->writeCacheFile($key, $content);
} else {
$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);
}
}
if (!$this->runtimeInitialized) {
$this->initRuntime();
}
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.
*
/code
/wp-content
/plugins
/timber-library
/vendor
/twig
/twig
/src
/Template.php
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;
}
}
/code
/wp-content
/plugins
/timber-library
/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 (\Exception $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
/code
/wp-content
/plugins
/timber-library
/vendor
/twig
/twig
/src
/Environment.php
} else {
$source = $loader->getSourceContext($name);
}
$content = $this->compileSource($source);
if ($this->bcWriteCacheFile) {
$this->writeCacheFile($key, $content);
} else {
$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);
}
}
if (!$this->runtimeInitialized) {
$this->initRuntime();
}
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.
*
/code
/wp-content
/plugins
/timber-library
/vendor
/twig
/twig
/src
/Template.php
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;
}
}
/code
/wp-content
/plugins
/timber-library
/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 (\Exception $e) {
while (ob_get_level() > $level) {
ob_end_clean();
}
throw $e;
} catch (\Throwable $e) {
while (ob_get_level() > $level) {
/code
/wp-content
/plugins
/timber-library
/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 (\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 {
/code
/wp-content
/plugins
/timber-library
/vendor
/twig
/twig
/src
/TemplateWrapper.php
* @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
*
/code
/wp-content
/plugins
/timber-library
/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.
*/
/code
/wp-content
/plugins
/timber-library
/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',
* );
/code
/wp-content
/plugins
/timber-library
/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
/code
/wp-content
/plugins
/timber-library
/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
*/
/code
/wp-content
/themes
/sifma-wp-theme
/single.php
Timber::render('pages/general-resources/page-holiday-schedule-archive.twig', $context);
} elseif ( $sifma_post->page_template === 'industry-testing' ) {
$event = new Sifma\Event();
$context['event'] = $event;
Timber::render('pages/general-resources/page-industry-testing.twig', $context);
} elseif ( $sifma_post->terms('resource_type')[0]) {
if ($sifma_post->terms('resource_type')[0]->name == "Hearing Summary" || $sifma_post->terms('resource_type')[0]->name == "Thought Leader Library" ) {
Timber::render('pages/singles/single.twig', $context);
}
else {
Timber::render('pages/general-resources/page-general-resources.twig', $context);
}
}
else {
Timber::render('pages/general-resources/page-general-resources.twig', $context);
}
} else {
Timber::render(array('pages/singles/single-' . $sifma_post->ID . '.twig', 'pages/singles/single-' . $sifma_post->post_type . '.twig', 'pages/singles/single.twig'), $context);
}
/code
/wp-includes
/template-loader.php
}
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';