/home/kingston/site/vendor/twig/twig/src/Loader/FilesystemLoader.php
$name = ltrim($name, '/');
$parts = explode('/', $name);
$level = 0;
foreach ($parts as $part) {
if ('..' === $part) {
--$level;
} elseif ('.' !== $part) {
++$level;
}
if ($level < 0) {
throw new LoaderError(sprintf('Looks like you try to load a template outside configured directories (%s).', $name));
}
}
}
private function isAbsolutePath($file)
{
return strspn($file, '/\\', 0, 1)
|| (\strlen($file) > 3 && ctype_alpha($file[0])
&& ':' === $file[1]
&& strspn($file, '/\\', 2, 1)
)
|| null !== parse_url($file, \PHP_URL_SCHEME)
;
}
}
class_alias('Twig\Loader\FilesystemLoader', 'Twig_Loader_Filesystem');
/home/kingston/site/vendor/twig/twig/src/Loader/FilesystemLoader.php
$name = ltrim($name, '/');
$parts = explode('/', $name);
$level = 0;
foreach ($parts as $part) {
if ('..' === $part) {
--$level;
} elseif ('.' !== $part) {
++$level;
}
if ($level < 0) {
throw new LoaderError(sprintf('Looks like you try to load a template outside configured directories (%s).', $name));
}
}
}
private function isAbsolutePath($file)
{
return strspn($file, '/\\', 0, 1)
|| (\strlen($file) > 3 && ctype_alpha($file[0])
&& ':' === $file[1]
&& strspn($file, '/\\', 2, 1)
)
|| null !== parse_url($file, \PHP_URL_SCHEME)
;
}
}
class_alias('Twig\Loader\FilesystemLoader', 'Twig_Loader_Filesystem');
/home/kingston/site/vendor/twig/twig/src/Loader/FilesystemLoader.php
$this->paths[$namespace] = [];
foreach ($paths as $path) {
$this->addPath($path, $namespace);
}
}
/**
* Adds a path where templates are stored.
*
* @param string $path A path where to look for templates
* @param string $namespace A path namespace
*
* @throws LoaderError
*/
public function addPath($path, $namespace = self::MAIN_NAMESPACE)
{
// invalidate the cache
$this->cache = $this->errorCache = [];
$checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path;
if (!is_dir($checkPath)) {
throw new LoaderError(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath));
}
$this->paths[$namespace][] = rtrim($path, '/\\');
}
/**
* Prepends a path where templates are stored.
*
* @param string $path A path where to look for templates
* @param string $namespace A path namespace
*
* @throws LoaderError
*/
public function prependPath($path, $namespace = self::MAIN_NAMESPACE)
{
// invalidate the cache
$this->cache = $this->errorCache = [];
/home/kingston/site/vendor/twig/twig/src/Loader/FilesystemLoader.php
public function getNamespaces()
{
return array_keys($this->paths);
}
/**
* Sets the paths where templates are stored.
*
* @param string|array $paths A path or an array of paths where to look for templates
* @param string $namespace A path namespace
*/
public function setPaths($paths, $namespace = self::MAIN_NAMESPACE)
{
if (!\is_array($paths)) {
$paths = [$paths];
}
$this->paths[$namespace] = [];
foreach ($paths as $path) {
$this->addPath($path, $namespace);
}
}
/**
* Adds a path where templates are stored.
*
* @param string $path A path where to look for templates
* @param string $namespace A path namespace
*
* @throws LoaderError
*/
public function addPath($path, $namespace = self::MAIN_NAMESPACE)
{
// invalidate the cache
$this->cache = $this->errorCache = [];
$checkPath = $this->isAbsolutePath($path) ? $path : $this->rootPath.$path;
if (!is_dir($checkPath)) {
throw new LoaderError(sprintf('The "%s" directory does not exist ("%s").', $path, $checkPath));
}
/home/kingston/site/vendor/twig/twig/src/Loader/FilesystemLoader.php
protected $paths = [];
protected $cache = [];
protected $errorCache = [];
private $rootPath;
/**
* @param string|array $paths A path or an array of paths where to look for templates
* @param string|null $rootPath The root path common to all relative paths (null for getcwd())
*/
public function __construct($paths = [], string $rootPath = null)
{
$this->rootPath = (null === $rootPath ? getcwd() : $rootPath).\DIRECTORY_SEPARATOR;
if (null !== $rootPath && false !== ($realPath = realpath($rootPath))) {
$this->rootPath = $realPath.\DIRECTORY_SEPARATOR;
}
if ($paths) {
$this->setPaths($paths);
}
}
/**
* Returns the paths to the templates.
*
* @param string $namespace A path namespace
*
* @return array The array of paths where to look for templates
*/
public function getPaths($namespace = self::MAIN_NAMESPACE)
{
return isset($this->paths[$namespace]) ? $this->paths[$namespace] : [];
}
/**
* Returns the path namespaces.
*
* The main namespace is always defined.
*
/home/kingston/site/vendor/timber/timber/lib/Loader.php
* @codeCoverageIgnore
*/
protected function template_exists( $name ) {
return $this->get_loader()->exists($name);
}
/**
* @return \Twig\Loader\FilesystemLoader
*/
public function get_loader() {
$open_basedir = ini_get('open_basedir');
$paths = array_merge($this->locations, array($open_basedir ? ABSPATH : '/'));
$paths = apply_filters('timber/loader/paths', $paths);
$rootPath = '/';
if ( $open_basedir ) {
$rootPath = null;
}
$fs = new \Twig\Loader\FilesystemLoader($paths, $rootPath);
$fs = apply_filters('timber/loader/loader', $fs, $paths, $rootPath);
return $fs;
}
/**
* @return \Twig\Environment
*/
public function get_twig() {
$loader = $this->get_loader();
$params = array('debug' => WP_DEBUG,'autoescape' => false);
if ( isset(Timber::$autoescape) ) {
$params['autoescape'] = Timber::$autoescape === true ? 'html' : Timber::$autoescape;
}
if ( Timber::$cache === true ) {
Timber::$twig_cache = true;
}
if ( Timber::$twig_cache ) {
$twig_cache_loc = apply_filters('timber/cache/location', TIMBER_LOC.'/cache/twig');
if ( !file_exists($twig_cache_loc) ) {
/home/kingston/site/vendor/timber/timber/lib/Loader.php
}
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.
*/
public function choose_template( $templates ) {
// Change $templates into array, if needed
if ( !is_array($templates) ) {
$templates = (array) $templates;
}
// Get Twig loader
$loader = $this->get_loader();
// Run through template array
foreach ( $templates as $template ) {
// Remove any whitespace around the template name
$template = trim( $template );
// Use the Twig loader to test for existance
if ( $loader->exists($template) ) {
// Return name of existing template
return $template;
}
}
// No existing template was found
return false;
}
/**
* @param string $name
* @return bool
/home/kingston/site/vendor/timber/timber/lib/Timber.php
*
* $team_member = Timber::compile( 'team-member.twig', $data );
* ```
* @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.
* @param bool $via_render Optional. Whether to apply optional render or compile filters. Default false.
* @return bool|string The returned output.
*/
public static function compile( $filenames, $data = array(), $expires = false, $cache_mode = Loader::CACHE_USE_DEFAULT, $via_render = false ) {
if ( !defined('TIMBER_LOADED') ) {
self::init();
}
$caller = LocationManager::get_calling_script_dir(1);
$loader = new Loader($caller);
$file = $loader->choose_template($filenames);
$caller_file = LocationManager::get_calling_script_file(1);
apply_filters('timber/calling_php_file', $caller_file);
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 {
/home/kingston/site/web/app/mu-plugins/studio-illicit-project-base-5/shortcodes/social_links.php
<?php
namespace StudioIllicit;
use Timber\Timber;
defined('ABSPATH') or die();
add_shortcode('social_links', function ($attr = null) {
$data = new SocialLinks();
if (!empty($attr['urls']) && is_string($attr['urls'])) {
$template_vars = $data->createTemplateVarsFromServiceUrlMapString($attr['urls']);
} else {
if (isset($attr['include_email'])) {
$data->appendEmailContactField();
}
$template_vars = $data->createTemplateVars();
}
return Timber::compile('social/social-links.twig', $template_vars);
});
/home/kingston/site/web/wp/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 = $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/kingston/site/web/wp/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/kingston/site/web/wp/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/kingston/site/web/wp/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/kingston/site/web/app/mu-plugins/advanced-custom-fields-pro/includes/fields/class-acf-field-wysiwyg.php
* @type filter
* @since 3.6
*
* @param mixed $value The value which was loaded from the database.
* @param mixed $post_id The $post_id from which the value was loaded.
* @param array $field The field array holding all the field options.
* @param boolean $escape_html Should the field return a HTML safe formatted value.
* @return mixed $value The modified value
*/
public function format_value( $value, $post_id, $field, $escape_html ) {
// Bail early if no value or not a string.
if ( empty( $value ) || ! is_string( $value ) ) {
return $value;
}
if ( $escape_html ) {
add_filter( 'acf_the_content', 'acf_esc_html', 1 );
}
$value = apply_filters( 'acf_the_content', $value );
if ( $escape_html ) {
remove_filter( 'acf_the_content', 'acf_esc_html', 1 );
}
// Follow the_content function in /wp-includes/post-template.php
return str_replace( ']]>', ']]>', $value );
}
}
// initialize
acf_register_field_type( 'acf_field_wysiwyg' );
endif; // class_exists check
?>
/home/kingston/site/web/wp/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/kingston/site/web/wp/wp-includes/plugin.php
// Do 'all' actions first.
if ( isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
$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 $args[0];
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $hook_name;
}
$filtered = $wp_filter[ $hook_name ]->apply_filters( $args[0], $args );
array_pop( $wp_current_filter );
return $filtered;
}
/**
* Checks if any filter has been registered for a hook.
*
* When using the `$callback` argument, this function may return a non-boolean value
* that evaluates to false (e.g. 0), so use the `===` operator for testing the return value.
*
* @since 2.5.0
* @since 6.9.0 Added the `$priority` parameter.
*
* @global WP_Hook[] $wp_filter Stores all of the filters and actions.
*
* @param string $hook_name The name of the filter hook.
* @param callable|string|array|false $callback Optional. The callback to check for.
* This function can be called unconditionally to speculatively check
/home/kingston/site/web/app/mu-plugins/advanced-custom-fields-pro/includes/acf-hook-functions.php
// Find field in args using index.
$field = $args[ $index ];
// Loop over variations and apply filters.
foreach ( $variations as $variation ) {
// Get value from field.
// First look for "backup" value ("_name", "_key").
if ( isset( $field[ "_$variation" ] ) ) {
$value = $field[ "_$variation" ];
} elseif ( isset( $field[ $variation ] ) ) {
$value = $field[ $variation ];
} else {
continue;
}
// Apply filters.
if ( $type === 'filter' ) {
$args[0] = apply_filters_ref_array( "$filter/$variation=$value", $args );
// Or do action.
} else {
do_action_ref_array( "$filter/$variation=$value", $args );
}
}
// Return first arg.
return $args[0];
}
// Register store.
acf_register_store( 'deprecated-hooks' );
/**
* acf_add_deprecated_filter
*
* Registers a deprecated filter to run during the replacement.
*
* @date 25/1/19
/home/kingston/site/web/wp/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/kingston/site/web/wp/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/kingston/site/web/app/mu-plugins/advanced-custom-fields-pro/includes/acf-value-functions.php
$field_name = $field['name'];
$cache_name = $escape_html ? "$post_id:$field_name:escaped" : "$post_id:$field_name:formatted";
// Check store.
$store = acf_get_store( 'values' );
if ( $store->has( $cache_name ) ) {
return $store->get( $cache_name );
}
/**
* Filters the $value for use in a template function.
*
* @since 5.0.0
*
* @param mixed $value The value to preview.
* @param string $post_id The post ID for this value.
* @param array $field The field array.
* @param boolean $escape_html Ask the field for a HTML safe version of it's output.
*/
$value = apply_filters( 'acf/format_value', $value, $post_id, $field, $escape_html );
// Update store.
$store->set( $cache_name, $value );
// Return value.
return $value;
}
// Register variation.
acf_add_filter_variations( 'acf/format_value', array( 'type', 'name', 'key' ), 2 );
/**
* acf_update_value
*
* Updates the value for a given field and post_id.
*
* @date 28/09/13
* @since 5.0.0
*
* @param mixed $value The new value.
/home/kingston/site/web/app/mu-plugins/advanced-custom-fields-pro/includes/api/api-template.php
return false;
}
// format value
if ( $format_value ) {
if ( $escape_html ) {
// return the escaped HTML version if requested.
if ( acf_field_type_supports( $field['type'], 'escaping_html' ) ) {
$value = acf_format_value( $value, $post_id, $field, true );
} else {
$new_value = acf_format_value( $value, $post_id, $field );
if ( is_array( $new_value ) ) {
$value = map_deep( $new_value, 'acf_esc_html' );
} else {
$value = acf_esc_html( $new_value );
}
}
} else {
// get value for field
$value = acf_format_value( $value, $post_id, $field );
}
}
// If we've built a dummy text field, we won't format the value, but they may still request it escaped. Use `acf_esc_html`
if ( $dummy_field && $escape_html ) {
if ( is_array( $value ) ) {
$value = map_deep( $value, 'acf_esc_html' );
} else {
$value = acf_esc_html( $value );
}
}
// return
return $value;
}
/**
* This function is the same as echo get_field(), but will escape the value for safe HTML output regardless of parameters.
*
* @since 1.0.3
/home/kingston/site/web/app/mu-plugins/studio-illicit-project-base-5/classes/MainFooter.php
if (!empty($image['sizes']['huge'])) {
return $image['sizes']['huge'];
}
if (!empty($image['sizes']['large'])) {
return $image['sizes']['large'];
}
return $image['url'];
}
private function populateFromAcfFields(): void {
$col_counts = config('footer.cols'); // int[]
if (!$col_counts || !is_array($col_counts)) {
return;
}
foreach ($col_counts as $row_index => $col_count) {
$row_num = $row_index + 1;
for ($col_index = 0; $col_index < $col_count; ++$col_index) {
$col_num = $col_index + 1;
$field_name = 'footer_content_' . $row_num . '_' . $col_num;
$value = get_field($field_name, 'option');
$this->setCellView($col_index, $row_index, $value);
unset($value, $col_num, $field_name);
}
unset($row_num);
}
}
/**
* Setup for the main site footer ACF field group.
*/
public static function init(): void {
add_action('acf/init', function () {
$col_counts = config('footer.cols');
if (!$col_counts) {
return;
}
$fields = [];
$num_rows = count($col_counts);
$media_upload_enabled = (int)config('footer.enable_editor_media', false);
foreach ($col_counts as $row_index => $col_count) {
/home/kingston/site/web/app/mu-plugins/studio-illicit-project-base-5/classes/MainFooter.php
<?php
namespace StudioIllicit;
if (!defined('ABSPATH')) die();
/**
* Represents the site's main footer.
*
* Generally, project-specific code will not need to deal with the class directly.
*/
class MainFooter {
use ViewCells;
public function __construct() {
$this->populateFromAcfFields();
}
public function getData(): ?array {
$rows = $this->getRenderedRows();
if (!$rows) {
return null;
}
return [
'rows' => $rows,
'si_link' => config('footer.studio_illicit_link', true) ? [
'url' => config('urls.studio_illicit'),
'text' => config('misc.si_link_text'),
] : null,
'background_image_url' => $this->getBackgroundImageUrl(),
'background_image' => $this->getBackgroundImage(),
];
}
private function getBackgroundImage(): ?array {
if (!config('footer.enable_background_image')) {
return null;
}
$image = get_field('footer_background_image', 'option');
if (!$image || empty($image['url'])) {
/home/kingston/site/web/app/mu-plugins/studio-illicit-project-base-5/classes/TimberSetup.php
$context['pagination_labels'] = self::getPaginationLabels();
if (is_posts_page()) {
$context['title'] = get_posts_page_title();
} else {
$context['title'] = get_the_title();
}
if (Popups::enabled()) {
$context['popups'] = Popups::getPopupArrays();
}
$context['should_show_si_link'] = is_front_page();
return $context;
}
/**
* Gets data from the MainFooter.
*
* Check out WP admin > Footer.
*/
private static function getMainFooterData() {
$footer = new MainFooter();
return $footer->getData();
}
private static function getPaginationLabels(): array {
return apply_filters('studioillicit/pagination_labels', [
'first' => 'First',
'last' => 'Last',
'previous' => 'Previous',
'next' => 'Next',
'before' => null,
]);
}
public static function addToTwig(Environment $twig): Environment {
$twig->addExtension(new StringLoaderExtension());
self::addTwigFiltersFromDir($twig, BASE_PLUGIN_DIR . 'twig/filters');
self::addTwigFiltersFromDir($twig, WP_CONTENT_DIR . '/themes/studio-illicit/twig/filters');
self::addTwigFunctionsFromDir($twig, BASE_PLUGIN_DIR . 'twig/functions');
self::addTwigFunctionsFromDir($twig, WP_CONTENT_DIR . '/themes/studio-illicit/twig/functions');
$twig->addFunction(new TwigFunction('intval', 'intval'));
/home/kingston/site/web/app/mu-plugins/studio-illicit-project-base-5/classes/TimberSetup.php
public static function addToContext(array $context): array {
$context['add_html_to_head'] = get_field_shortcode('add_html_to_head', 'option');
$context['add_html_to_start_of_body'] = get_field_shortcode('add_html_to_start_of_body', 'option');
$context['add_html_to_end_of_body'] = get_field_shortcode('add_html_to_end_of_body', 'option');
// if there is a user logged in, check whether outputting the code has been disabled
if (!get_current_user_id()) {
$context['add_html_to_head_disable'] = false;
$context['add_html_to_start_of_body_disable'] = false;
$context['add_html_to_end_of_body_disable'] = false;
} else {
$context['add_html_to_head_disable'] = get_field_shortcode('add_html_to_head_disable', 'option');
$context['add_html_to_start_of_body_disable'] = get_field_shortcode('add_html_to_start_of_body_disable', 'option');
$context['add_html_to_end_of_body_disable'] = get_field_shortcode('add_html_to_end_of_body_disable', 'option');
}
$context['google_recaptcha_js_url'] = get_google_recaptcha_keys() ? config('urls.google_recaptcha_js') : null;
$context['main_logo_url'] = get_main_logo_url();
$context['home_url'] = home_url();
$context['main_footer'] = self::getMainFooterData();
$context['empty_archive_message'] = get_field_shortcode_trimmed('empty_archive_message', 'option');
$context['do_load_more_button'] = config('posts.posts_page_load_more_button');
$context['pagination_labels'] = self::getPaginationLabels();
if (is_posts_page()) {
$context['title'] = get_posts_page_title();
} else {
$context['title'] = get_the_title();
}
if (Popups::enabled()) {
$context['popups'] = Popups::getPopupArrays();
}
$context['should_show_si_link'] = is_front_page();
return $context;
}
/**
* Gets data from the MainFooter.
*
* Check out WP admin > Footer.
*/
/home/kingston/site/web/app/mu-plugins/studio-illicit-project-base-5/classes/TimberSetup.php
<?php
namespace StudioIllicit;
use DirectoryIterator;
use Twig\Environment;
use Twig\Extension\StringLoaderExtension;
use Twig\TwigFilter;
use Twig\TwigFunction;
defined('ABSPATH') or die();
class TimberSetup {
public static function init() {
add_filter('timber/context', function (array $context): array {
return self::addToContext($context);
});
add_filter('timber/twig', function (Environment $twig): Environment {
return self::addToTwig($twig);
});
add_filter('timber/locations', function (array $paths): array {
$paths[] = [path_join(BASE_PLUGIN_DIR, 'twig', 'templates')];
return $paths;
});
}
/**
* Adds variables to the Timber context array and returns it.
*/
public static function addToContext(array $context): array {
$context['add_html_to_head'] = get_field_shortcode('add_html_to_head', 'option');
$context['add_html_to_start_of_body'] = get_field_shortcode('add_html_to_start_of_body', 'option');
$context['add_html_to_end_of_body'] = get_field_shortcode('add_html_to_end_of_body', 'option');
// if there is a user logged in, check whether outputting the code has been disabled
if (!get_current_user_id()) {
$context['add_html_to_head_disable'] = false;
$context['add_html_to_start_of_body_disable'] = false;
/home/kingston/site/web/wp/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/kingston/site/web/wp/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/kingston/site/vendor/timber/timber/lib/Timber.php
self::$context_cache['wp_title'] = Helper::get_wp_title();
self::$context_cache['body_class'] = implode(' ', get_body_class());
self::$context_cache['site'] = new Site();
self::$context_cache['request'] = new Request();
$user = new User();
self::$context_cache['user'] = ($user->ID) ? $user : false;
self::$context_cache['theme'] = self::$context_cache['site']->theme;
self::$context_cache['posts'] = new PostQuery();
/**
* @deprecated as of Timber 1.3.0
* @todo remove in Timber 1.4.*
*/
self::$context_cache['wp_head'] = new FunctionWrapper( 'wp_head' );
self::$context_cache['wp_footer'] = new FunctionWrapper( 'wp_footer' );
self::$context_cache = apply_filters('timber_context', self::$context_cache);
self::$context_cache = apply_filters('timber/context', self::$context_cache);
}
return self::$context_cache;
}
/**
* Compile a Twig file.
*
* Passes data to a Twig file and returns the output.
* If the template file doesn't exist it will throw a warning when WP_DEBUG is enabled.
*
* @api
* @example
* ```php
* $data = array(
* 'firstname' => 'Jane',
* 'lastname' => 'Doe',
* 'email' => 'jane.doe@example.org',
* );
/home/kingston/site/vendor/timber/timber/lib/Timber.php
return $return;
}
/* Template Setup and Display
================================ */
/**
* Alias for Timber::get_context() which is deprecated in 2.0.
*
* This will allow us to update the starter theme to use the ::context() method and better
* prepare users for the upgrade (even if the details of what the method returns differs
* slightly).
*
* @see \Timber\Timber::get_context()
* @api
* @return array
*/
public static function context() {
return self::get_context();
}
/**
* Get context.
* @api
* @return array
*/
public static function get_context() {
if ( empty(self::$context_cache) ) {
self::$context_cache['http_host'] = URLHelper::get_scheme().'://'.URLHelper::get_host();
self::$context_cache['wp_title'] = Helper::get_wp_title();
self::$context_cache['body_class'] = implode(' ', get_body_class());
self::$context_cache['site'] = new Site();
self::$context_cache['request'] = new Request();
$user = new User();
self::$context_cache['user'] = ($user->ID) ? $user : false;
self::$context_cache['theme'] = self::$context_cache['site']->theme;
self::$context_cache['posts'] = new PostQuery();
/home/kingston/site/web/app/themes/studio-illicit/page.php
<?php
use Timber\Timber;
defined('ABSPATH') or die();
$context = Timber::context();
$timber_post = Timber::get_post();
$context['post'] = $timber_post;
$context['hide_footer'] = get_field('hide_footer');
Timber::render(['page-' . $timber_post->post_name . '.twig', 'page.twig'], $context);
/home/kingston/site/web/wp/wp-includes/template-loader.php
*/
$template = apply_filters( 'template_include', $template );
$is_stringy = is_string( $template ) || ( is_object( $template ) && method_exists( $template, '__toString' ) );
$template = $is_stringy ? realpath( (string) $template ) : null;
if (
is_string( $template ) &&
( str_ends_with( $template, '.php' ) || str_ends_with( $template, '.html' ) ) &&
is_file( $template ) &&
is_readable( $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/kingston/site/web/wp/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/kingston/site/web/wp/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';