/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-includes
/post-template.php
array(
'echo' => false,
'post' => $_post,
)
)
),
__( '(more…)' )
);
}
$output = '';
$has_teaser = false;
// If post password required and it doesn't match the cookie.
if ( post_password_required( $_post ) ) {
return get_the_password_form( $_post );
}
// If the requested page doesn't exist.
if ( $elements['page'] > count( $elements['pages'] ) ) {
// Give them the highest numbered page that DOES exist.
$elements['page'] = count( $elements['pages'] );
}
$page_no = $elements['page'];
$content = $elements['pages'][ $page_no - 1 ];
if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {
if ( has_block( 'more', $content ) ) {
// Remove the core/more block delimiters. They will be left over after $content is split up.
$content = preg_replace( '/<!-- \/?wp:more(.*?) -->/', '', $content );
}
$content = explode( $matches[0], $content, 2 );
if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) ) {
$more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) );
}
$has_teaser = true;
} else {
/code
/wp-includes
/post-template.php
array(
'echo' => false,
'post' => $_post,
)
)
),
__( '(more…)' )
);
}
$output = '';
$has_teaser = false;
// If post password required and it doesn't match the cookie.
if ( post_password_required( $_post ) ) {
return get_the_password_form( $_post );
}
// If the requested page doesn't exist.
if ( $elements['page'] > count( $elements['pages'] ) ) {
// Give them the highest numbered page that DOES exist.
$elements['page'] = count( $elements['pages'] );
}
$page_no = $elements['page'];
$content = $elements['pages'][ $page_no - 1 ];
if ( preg_match( '/<!--more(.*?)?-->/', $content, $matches ) ) {
if ( has_block( 'more', $content ) ) {
// Remove the core/more block delimiters. They will be left over after $content is split up.
$content = preg_replace( '/<!-- \/?wp:more(.*?) -->/', '', $content );
}
$content = explode( $matches[0], $content, 2 );
if ( ! empty( $matches[1] ) && ! empty( $more_link_text ) ) {
$more_link_text = strip_tags( wp_kses_no_null( trim( $matches[1] ) ) );
}
$has_teaser = true;
} else {
/code
/wp-content
/themes
/sifma-wp-theme
/functions.php
}, 0);
function safe_trim( $post_content, $length ) {
if (strlen($post_content) < $length){
return wp_strip_all_tags($post_content);
}
else {
return wp_strip_all_tags(substr($post_content, 0, strpos($post_content, ' ', $length)));
}
}
add_filter('wpseo_opengraph_desc', function( $description ) {
global $post;
// check for excerpt first
if ( has_excerpt() ) {
return safe_trim( get_the_excerpt(), 300);
}
// now, is there default wp content?
$the_content = apply_filters( 'the_content', get_the_content() );
if ( !empty($the_content) ) {
return safe_trim( $the_content, 300);
}
// pull content field from each of the custom post types
$content_fields = array(
'committee' => 'objective',
'news' => 'content',
'person' => 'biography',
'research_report' => 'summary',
'society' => 'about_the_society',
'filing' => 'summary'
);
$post_type = get_post_type();
$content_field = $content_fields[$post_type] ?? 'content';
$the_content = get_field( $content_field );
if ( !empty($the_content) ) {
return safe_trim( $the_content, 300);
}
// fallback to whatever (if anything) was sent in
return safe_trim( $description, 300 );
/code
/wp-includes
/class-wp-hook.php
$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.
*/
public function do_action( $args ) {
/code
/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`.
/code
/wp-content
/plugins
/wordpress-seo
/src
/presenters
/open-graph
/description-presenter.php
*
* @var string
*/
protected $tag_format = self::META_PROPERTY_CONTENT;
/**
* Run the Open Graph description through replace vars and the `wpseo_opengraph_desc` filter and sanitization.
*
* @return string The filtered description.
*/
public function get() {
$meta_og_description = $this->replace_vars( $this->presentation->open_graph_description );
/**
* Filter: 'wpseo_opengraph_desc' - Allow changing the Yoast SEO generated Open Graph description.
*
* @param string $description The description.
* @param Indexable_Presentation $presentation The presentation of an indexable.
*/
$meta_og_description = \apply_filters( 'wpseo_opengraph_desc', $meta_og_description, $this->presentation );
$meta_og_description = $this->helpers->string->strip_all_tags( \stripslashes( $meta_og_description ) );
return \trim( $meta_og_description );
}
}
/code
/wp-content
/plugins
/wordpress-seo
/src
/presenters
/abstract-indexable-tag-presenter.php
* The tag format including placeholders.
*
* @var string
*/
protected $tag_format = self::DEFAULT_TAG_FORMAT;
/**
* The method of escaping to use.
*
* @var string
*/
protected $escaping = 'attribute';
/**
* Returns a tag in the head.
*
* @return string The tag.
*/
public function present() {
$value = $this->get();
if ( ! \is_string( $value ) || $value === '' ) {
return '';
}
/**
* There may be some classes that are derived from this class that do not use the $key property
* in their $tag_format string. In that case the key property will simply not be used.
*/
return \sprintf(
$this->tag_format,
$this->escape_value( $value ),
$this->key,
\is_admin_bar_showing() ? ' class="yoast-seo-meta-tag"' : ''
);
}
/**
* Escaped the output.
*
/code
/wp-content
/plugins
/wordpress-seo
/src
/integrations
/front-end-integration.php
*/
public function present_head() {
$context = $this->context_memoizer->for_current_page();
$presenters = $this->get_presenters( $context->page_type, $context );
/**
* Filter 'wpseo_frontend_presentation' - Allow filtering the presentation used to output our meta values.
*
* @param Indexable_Presention $presentation The indexable presentation.
* @param Meta_Tags_Context $context The meta tags context for the current page.
*/
$presentation = \apply_filters( 'wpseo_frontend_presentation', $context->presentation, $context );
echo \PHP_EOL;
foreach ( $presenters as $presenter ) {
$presenter->presentation = $presentation;
$presenter->helpers = $this->helpers;
$presenter->replace_vars = $this->replace_vars;
$output = $presenter->present();
if ( ! empty( $output ) ) {
// phpcs:ignore WordPress.Security.EscapeOutput -- Presenters are responsible for correctly escaping their output.
echo "\t" . $output . \PHP_EOL;
}
}
echo \PHP_EOL . \PHP_EOL;
}
/**
* Returns all presenters for this page.
*
* @param string $page_type The page type.
* @param Meta_Tags_Context|null $context The meta tags context for the current page.
*
* @return Abstract_Indexable_Presenter[] The presenters.
*/
public function get_presenters( $page_type, $context = null ) {
if ( \is_null( $context ) ) {
$context = $this->context_memoizer->for_current_page();
}
/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-content
/plugins
/wordpress-seo
/src
/integrations
/front-end-integration.php
}
return \array_diff( $presenters, [ 'Yoast\\WP\\SEO\\Presenters\\Robots_Presenter' ] );
}
/**
* Presents the head in the front-end. Resets wp_query if it's not the main query.
*
* @codeCoverageIgnore It just calls a WordPress function.
*
* @return void
*/
public function call_wpseo_head() {
global $wp_query;
$old_wp_query = $wp_query;
// phpcs:ignore WordPress.WP.DiscouragedFunctions.wp_reset_query_wp_reset_query -- Reason: The recommended function, wp_reset_postdata, doesn't reset wp_query.
\wp_reset_query();
\do_action( 'wpseo_head' );
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.Prohibited -- Reason: we have to restore the query.
$GLOBALS['wp_query'] = $old_wp_query;
}
/**
* Echoes all applicable presenters for a page.
*
* @return void
*/
public function present_head() {
$context = $this->context_memoizer->for_current_page();
$presenters = $this->get_presenters( $context->page_type, $context );
/**
* Filter 'wpseo_frontend_presentation' - Allow filtering the presentation used to output our meta values.
*
* @param Indexable_Presention $presentation The indexable presentation.
* @param Meta_Tags_Context $context The meta tags context for the current page.
*/
/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
/content-index.php
}
if ( $featuredCTA ) {
$context['featuredCTA'] = new Sifma\Post($featuredCTA->ID);
//die('<pre>'.print_r($context['featuredCTA'], true).'</pre>');
}
// Parse selected content type to send to Algolia. This is rendered
// as metadata
$contentTypeField = get_field('content_type', $post);
$contentTypeArray = explode('|', $contentTypeField);
$algoliaTerm = $contentTypeArray[1];
if ($algoliaTerm == "Filings") {
$algoliaTerm = "Submissions";
}
$context['contentLabel'] = $contentTypeArray[0];
$context['contentName'] = $algoliaTerm;
Timber::render('pages/content-index.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';