{
global $post;
if (is_archive()) {
$classes[] = 'archive-' . $post->post_type;
}
$classes[] = $post->post_name;
return $classes;
}
/**
* @param $asset
* @throws \ErrorException
*/
public function handleError($level, $message, $file = '', $line = 0, $context = [])
{
try {
parent::handleError($level, $message, $file, $line, $context);
} catch (Throwable $e) {
if (! apply_filters('acorn/throw_error_exception', true, $e)) {
return false;
}
{
global $post;
if (is_archive()) {
$classes[] = 'archive-' . $post->post_type;
}
$classes[] = $post->post_name;
return $classes;
}
/**
* @param $asset
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 ] );
}
// 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;
}
* @since 2.8.0
*
* @param string[] $classes An array of body class names.
* @param string[] $css_class An array of additional class names added to the body.
*/
$classes = apply_filters( 'body_class', $classes, $css_class );
return array_unique( $classes );
}
/**
->getPossibleViewNameFromPath($file = realpath($file));
$view = trim($view, '\\/.');
/** Gather data to be passed to view */
$data = array_reduce(get_body_class(), function ($data, $class) use ($view, $file) {
return apply_filters("sage/template/{$class}/data", $data, $view, $file);
}, []);
$this->app['sage.view'] = $this->view->exists($view) ? $view : $file;
$this->app['sage.data'] = $data;
// 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 ] ) );
}
// 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;
}
*
* @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() ) {
// Set up the WordPress query.
wp();
// Load the theme template.
require_once ABSPATH . WPINC . '/template-loader.php';
}
* @var bool
*/
define( 'WP_USE_THEMES', true );
/** Loads the WordPress Environment and Template */
require __DIR__ . '/wp-blog-header.php';
ErrorException
|
---|
ErrorException: Attempt to read property "post_name" on null at /home/gocv/go-cv.co.uk/wp-content/themes/go-cv-theme/functions.php:171 at Illuminate\Foundation\Bootstrap\HandleExceptions->handleError() (/home/gocv/go-cv.co.uk/wp-content/themes/go-cv-theme/vendor/roots/acorn/src/Roots/Acorn/Bootstrap/HandleExceptions.php:54) at Roots\Acorn\Bootstrap\HandleExceptions->handleError() (/home/gocv/go-cv.co.uk/wp-content/themes/go-cv-theme/functions.php:171) at custom_body_class() (/home/gocv/go-cv.co.uk/wp-includes/class-wp-hook.php:326) at WP_Hook->apply_filters() (/home/gocv/go-cv.co.uk/wp-includes/plugin.php:205) at apply_filters() (/home/gocv/go-cv.co.uk/wp-includes/post-template.php:857) at get_body_class() (/home/gocv/go-cv.co.uk/wp-content/themes/go-cv-theme/vendor/roots/acorn/src/Roots/Acorn/Sage/Concerns/FiltersTemplates.php:36) at Roots\Acorn\Sage\Sage->filterTemplateInclude() (/home/gocv/go-cv.co.uk/wp-includes/class-wp-hook.php:324) at WP_Hook->apply_filters() (/home/gocv/go-cv.co.uk/wp-includes/plugin.php:205) at apply_filters() (/home/gocv/go-cv.co.uk/wp-includes/template-loader.php:104) at require_once('/home/gocv/go-cv.co.uk/wp-includes/template-loader.php') (/home/gocv/go-cv.co.uk/wp-blog-header.php:19) at require('/home/gocv/go-cv.co.uk/wp-blog-header.php') (/home/gocv/go-cv.co.uk/index.php:17) |