/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-content/themes/startupslam/app/Controllers/Partials/Hero.php
public static $hero_image;
public function __construct()
{
self::$id = (is_home() ? get_option('page_for_posts') : get_the_ID());
self::$hero_type = get_field('hero_type');
}
/**
* Return hero content for the current page
*
* @return object
*/
public function hero()
{
$hero = get_field('hero', self::$id);
return objectify([
'id' => "hero",
'label' => $hero['hero_label'] ?? '',
'heading' => $hero['hero_heading'] ?: App::title(),
'content' => $hero['hero_content'] ?? '',
'link' => $hero['hero_link'] ?? '',
'image' => $hero['hero_image'] && !empty($hero['hero_image'])
? $hero['hero_image']
: get_field('default_hero_image', 'option'),
'logo_label' => $hero['logo_label'] ?? '',
'logos' => $hero['logos'] ?? [],
'classes' => Html::processClasses([
'hero',
is_front_page() ? 'hero--front' : 'hero--not-front',
]),
]);
}
}
Arguments
"Trying to access array offset on value of type null"
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-content/themes/startupslam/app/Controllers/Partials/Hero.php
public static $hero_image;
public function __construct()
{
self::$id = (is_home() ? get_option('page_for_posts') : get_the_ID());
self::$hero_type = get_field('hero_type');
}
/**
* Return hero content for the current page
*
* @return object
*/
public function hero()
{
$hero = get_field('hero', self::$id);
return objectify([
'id' => "hero",
'label' => $hero['hero_label'] ?? '',
'heading' => $hero['hero_heading'] ?: App::title(),
'content' => $hero['hero_content'] ?? '',
'link' => $hero['hero_link'] ?? '',
'image' => $hero['hero_image'] && !empty($hero['hero_image'])
? $hero['hero_image']
: get_field('default_hero_image', 'option'),
'logo_label' => $hero['logo_label'] ?? '',
'logos' => $hero['logos'] ?? [],
'classes' => Html::processClasses([
'hero',
is_front_page() ? 'hero--front' : 'hero--not-front',
]),
]);
}
}
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-content/themes/startupslam/vendor/soberwp/controller/src/Controller.php
});
// Get all public static methods from class
$this->staticMethods = $this->class->getMethods(\ReflectionMethod::IS_STATIC);
// Remove $this->staticMethods from $this->methods using array_diff
$this->dataMethods = array_diff($this->methods, $this->staticMethods);
// Filter the remaining data methods
$this->dataMethods = array_filter($this->dataMethods, function ($method) {
return $method = $method->name;
});
// For each method convert method name to snake case and add to data[key => value]
foreach ($this->dataMethods as $method) {
// Convert method name to snake case
$var = Utils::convertToSnakeCase($method->name);
// Add var method name to data[]
$this->data[$var] = $this->{$method->name}();
}
}
/**
* Set Blade Data
*
* Update $this->data with __blade
*/
final private function __setBladeData()
{
// Get the data
$debuggerData = $this->data;
// Loop through each data method
foreach ($this->dataMethods as $dataMethod) {
// Convert the key to snake case to find in $debuggerData
$key = Utils::convertToSnakeCase($dataMethod->name);
// Save the returned value from the above key
$returned = $debuggerData[$key];
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-content/themes/startupslam/vendor/soberwp/controller/src/Controller.php
* Set Controller Data
*
* Set the Controller raw data for this Controller
* @return $this
*/
final public function __setData($incomingData)
{
$this->incomingData = $incomingData;
// Set the data from the WordPress post if singular to $this->data
$this->__setDataFromPost();
// Set the data from Advanced Custom Fields to $this->data
$this->__setDataFromModuleAcf();
// Set incoming filter data from Sage to App before Debugger
$this->__setDataFromFilter();
// Set the public methods from the class to $this->methods
$this->__setDataFromMethods();
// Set debugger data first to use only the raw data from the Controller
$this->__setBladeData();
// Set app data to $this->data['__app'] or merge with current data
$this->__setAppData();
// Set tree data to $this->data['__tree'] or merge with current data
$this->__setTreeData();
}
/**
* Set Data From Post
*
* Set the WordPress post
*/
final private function __setDataFromPost()
{
// Only set data from $post to App class
if ($this->template !== 'app') {
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-content/themes/startupslam/vendor/soberwp/controller/controller.php
// Set the params required for template param
$controller->__setParams();
// Determine template location to expose data
$location = "sage/template/{$controller->__getTemplateParam()}-data/data";
// Pass data to filter
add_filter($location, function ($data) use ($container, $class) {
// Recreate the class so that $post is included
$controller = $container->make($class);
// Params
$controller->__setParams();
// Lifecycle
$controller->__before();
// Data
$controller->__setData($data);
// Lifecycle
$controller->__after();
// Return
return $controller->__getData();
}, 10, 2);
}
}
/**
* Blade
*/
function blade()
{
// Get Sage function
$sage = sage();
// Return if function does not exist
if (!$sage) {
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-includes/class-wp-hook.php
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$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, (int) $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/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-includes/plugin.php
if ( isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $tag;
_wp_call_all_hook( $args );
}
if ( ! isset( $wp_filter[ $tag ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $tag;
}
// Don't pass the tag name to WP_Hook.
array_shift( $args );
$filtered = $wp_filter[ $tag ]->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 `$tag` are supplied using an array.
*
* @global array $wp_filter Stores all of the filters and actions.
* @global array $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $tag The name of the filter hook.
* @param array $args The arguments supplied to the functions hooked to $tag.
* @return mixed The filtered value after all hooked functions are applied to it.
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-content/themes/startupslam/app/filters.php
'frontpage', 'page', 'paged', 'search', 'single', 'singular', 'attachment', 'embed'
])->map(function ($type) {
add_filter("{$type}_template_hierarchy", __NAMESPACE__.'\\filter_templates');
});
/**
* Render page using Blade
*/
add_filter('template_include', function ($template) {
collect(['get_header', 'wp_head'])->each(function ($tag) {
ob_start();
do_action($tag);
$output = ob_get_clean();
remove_all_actions($tag);
add_action($tag, function () use ($output) {
echo $output;
});
});
$data = collect(get_body_class())->reduce(function ($data, $class) use ($template) {
return apply_filters("sage/template/{$class}/data", $data, $template);
}, []);
if ($template) {
echo template($template, $data);
return get_stylesheet_directory().'/index.php';
}
return $template;
}, PHP_INT_MAX);
/**
* Render comments.blade.php
*/
add_filter('comments_template', function ($comments_template) {
$comments_template = str_replace(
[get_stylesheet_directory(), get_template_directory()],
'',
$comments_template
);
$data = collect(get_body_class())->reduce(function ($data, $class) use ($comments_template) {
return apply_filters("sage/template/{$class}/data", $data, $comments_template);
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-content/themes/startupslam/vendor/illuminate/support/Collection.php
*/
public function random($number = null)
{
if (is_null($number)) {
return Arr::random($this->items);
}
return new static(Arr::random($this->items, $number));
}
/**
* Reduce the collection to a single value.
*
* @param callable $callback
* @param mixed $initial
* @return mixed
*/
public function reduce(callable $callback, $initial = null)
{
return array_reduce($this->items, $callback, $initial);
}
/**
* Create a collection of all elements that do not pass a given truth test.
*
* @param callable|mixed $callback
* @return static
*/
public function reject($callback)
{
if ($this->useAsCallable($callback)) {
return $this->filter(function ($value, $key) use ($callback) {
return ! $callback($value, $key);
});
}
return $this->filter(function ($item) use ($callback) {
return $item != $callback;
});
}
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-content/themes/startupslam/app/filters.php
])->map(function ($type) {
add_filter("{$type}_template_hierarchy", __NAMESPACE__.'\\filter_templates');
});
/**
* Render page using Blade
*/
add_filter('template_include', function ($template) {
collect(['get_header', 'wp_head'])->each(function ($tag) {
ob_start();
do_action($tag);
$output = ob_get_clean();
remove_all_actions($tag);
add_action($tag, function () use ($output) {
echo $output;
});
});
$data = collect(get_body_class())->reduce(function ($data, $class) use ($template) {
return apply_filters("sage/template/{$class}/data", $data, $template);
}, []);
if ($template) {
echo template($template, $data);
return get_stylesheet_directory().'/index.php';
}
return $template;
}, PHP_INT_MAX);
/**
* Render comments.blade.php
*/
add_filter('comments_template', function ($comments_template) {
$comments_template = str_replace(
[get_stylesheet_directory(), get_template_directory()],
'',
$comments_template
);
$data = collect(get_body_class())->reduce(function ($data, $class) use ($comments_template) {
return apply_filters("sage/template/{$class}/data", $data, $comments_template);
}, []);
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-includes/class-wp-hook.php
$nesting_level = $this->nesting_level++;
$this->iterations[ $nesting_level ] = array_keys( $this->callbacks );
$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, (int) $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/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-includes/plugin.php
if ( isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $tag;
_wp_call_all_hook( $args );
}
if ( ! isset( $wp_filter[ $tag ] ) ) {
if ( isset( $wp_filter['all'] ) ) {
array_pop( $wp_current_filter );
}
return $value;
}
if ( ! isset( $wp_filter['all'] ) ) {
$wp_current_filter[] = $tag;
}
// Don't pass the tag name to WP_Hook.
array_shift( $args );
$filtered = $wp_filter[ $tag ]->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 `$tag` are supplied using an array.
*
* @global array $wp_filter Stores all of the filters and actions.
* @global array $wp_current_filter Stores the list of current filters with the current one last.
*
* @param string $tag The name of the filter hook.
* @param array $args The arguments supplied to the functions hooked to $tag.
* @return mixed The filtered value after all hooked functions are applied to it.
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-includes/template-loader.php
if ( 'is_attachment' === $tag ) {
remove_filter( 'the_content', 'prepend_attachment' );
}
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;
}
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-blog-header.php
<?php
/**
* Loads the WordPress environment and template.
*
* @package WordPress
*/
if ( ! isset( $wp_did_header ) ) {
$wp_did_header = true;
// Load the WordPress library.
require_once __DIR__ . '/wp-load.php';
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
Arguments
"/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-includes/template-loader.php"
/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/index.php
<?php
/**
* Front to the WordPress application. This file doesn't do anything, but loads
* wp-blog-header.php which does and tells WordPress to load the theme.
*
* @package WordPress
*/
/**
* Tells WordPress to load the WordPress theme and output it.
*
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
Arguments
"/home/306802.cloudwaysapps.com/vqbgxdzrmt/public_html/wp-blog-header.php"