/var/www/content/themes/skillslab/includes/partials/cards/bulletpoints/trainingproduct.php
<?php
$product = $product ?? false;
if (!$product) {
return;
}
if (!($product instanceof WC_Product_Simple)) {
if ($product instanceof WP_Post) {
$product = $product->ID;
}
$product = wc_get_product(intval($product));
}
if (!$product) {
return;
}
// $bookingUrl = \Probots\Tools\Helper::getBookingLinkByProduct($product);
$factsValue = explode("\r\n", get_post_meta($product->get_id(), 'skl_product_facts', true));
$facts = array_map(
function ($f) {
return ['text' => $f];
},
$factsValue ?: []
);
$cardData = [
'selectors' => false,
'period' => false,
'tag' => __t('card.training.perUnit'),
'price' => $product->get_price(),
'bullets' => $facts,
'cta_text' => __t('card.bookNow'),
'cta_url' => '#',
'product_id' => $product->get_id(),
'classes' => ['js-bookingcta']
];
?>
<div class="">
Arguments
"Call to undefined function wc_get_product()"
/var/www/content/themes/skillslab/class/src/Tools/Helper.php
<?php
namespace Probots\Tools;
class Helper
{
public static function includePartial($file, $data = [])
{
extract($data);
include sprintf(
'%s/includes/partials/%s.php',
get_template_directory(),
$file
);
}
public static function loadPartial($file, $data = [])
{
ob_start();
extract($data);
include sprintf(
'%s/includes/partials/%s.php',
get_template_directory(),
$file
);
return ob_get_clean();
}
public static function includeBlock($file, $data = [])
{
extract($data);
include sprintf(
'%s/includes/blocks/%s.php',
get_template_directory(),
$file
);
}
public static function getAssetUrl($name = '')
{
return sprintf('%s/assets/%s', get_template_directory_uri(), $name);
/var/www/content/themes/skillslab/class/functions/helpers.php
<?php
if (!function_exists('loadPartial')) {
function loadPartial($name, $data = [])
{
\Probots\Tools\Helper::includePartial($name, $data);
}
}
if (!function_exists('assetUrl')) {
function assetUrl($name)
{
return \Probots\Tools\Helper::getAssetUrl($name);
}
}
if (!function_exists('loadSvg')) {
function loadSvg($name)
{
include(get_template_directory() . '/assets/' . $name . '.svg');
}
}
if (!function_exists('loadLaser')) {
function loadLaser($name)
{
include(get_template_directory() . '/assets/' . $name . '.svg');
include(get_template_directory() . '/assets/' . $name . '.svg');
include(get_template_directory() . '/assets/' . $name . '.svg');
include(get_template_directory() . '/assets/' . $name . '.svg');
}
}
// if (!function_exists('clearPhoneNumber')) {
// function clearPhoneNumber($number)
// {
// $plus = preg_match('/^(\+)/', $number)?"+":"";
// $number = preg_replace('/[^0-9|\+]/', '', $number);
// $number = preg_replace('/(\+)([0-9]{2})(0)/', '${2}', $number);
// $number = preg_replace('/\|/', '', $number);
Arguments
"cards/bulletpoints/trainingproduct"
array:1 [
"product" => WP_Post {#2367}
]
/var/www/content/themes/skillslab/includes/layouts/card_booking.php
<div class="block__text ft--copy-small">
<?= $block['text'] ?>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<div class="o-grid__col u-6/12@sm">
<div class="card__holder">
<div class="laser-element top">
<?php loadLaser('svg/hexagon'); ?>
</div>
<div class="laser-element right">
<?php loadLaser('svg/t4_tor'); ?>
</div>
<div class="card__holder__inner">
<?php if ($product) {
loadPartial('cards/bulletpoints/trainingproduct', [
'product' => $product
]);
} ?>
</div>
</div>
</div>
</div>
</div>
</div>
Arguments
"cards/bulletpoints/trainingproduct"
array:1 [
"product" => WP_Post {#2367}
]
/var/www/content/themes/skillslab/class/src/Modules/Builder.php
print $content;
wp_reset_postdata();
}
}
private function getModuleHtml($layout, $variables)
{
$fileName = sprintf('%s.php', $layout);
$filePath = sprintf('%s/%s/%s', get_template_directory(), $this->layoutDir, $fileName);
if (!file_exists($filePath)) {
print 'MODULE LAYOUT NOT FOUND IN: ' . $filePath;
return;
}
extract($variables);
include($filePath);
}
private function getDebugHtml($layout, $variables)
{
if (!isset($_GET['debug-modules'])) {
return;
}
printf("<div>");
print '<pre>';
print_r($variables);
print '</pre>';
printf("</div>");
}
private function getModules()
{
return \get_field($this->acfModulesFieldKey) ?: [];
}
private function getLayoutName($module)
Arguments
"/var/www/content/themes/skillslab/includes/layouts/card_booking.php"
/var/www/content/themes/skillslab/class/src/Modules/Builder.php
private $moduleClassName = 'module';
private $layoutDir = './';
public function build()
{
$modules = $this->getModules();
foreach ($modules as $mKey => $module) {
$layout = $this->getLayoutName($module);
$variables = $module;
unset($variables[$this->acfLayoutFieldKey]);
$variables['layout'] = $layout;
$baseClassName = $this->moduleClassName;
$layoutClassName = $baseClassName . "--" . $layout;
ob_start();
printf("<div id=\"layout-%d\" class=\"%s %s\">\n", $mKey, $baseClassName, $layoutClassName);
$this->getDebugHtml($layout, $variables);
$this->getModuleHtml($layout, $variables);
print("</div>\n");
$content = ob_get_clean();
print $content;
wp_reset_postdata();
}
}
private function getModuleHtml($layout, $variables)
{
$fileName = sprintf('%s.php', $layout);
$filePath = sprintf('%s/%s/%s', get_template_directory(), $this->layoutDir, $fileName);
if (!file_exists($filePath)) {
print 'MODULE LAYOUT NOT FOUND IN: ' . $filePath;
return;
Arguments
"card_booking"
array:4 [
"headline" => "Book your free trial"
"blocks" => array:4 [
0 => array:3 [
"icon" => "stop-watch"
"headline" => "One hour of football"
"text" => "Get to know skills.lab in a free 60-minute training session."
]
1 => array:3 [
"icon" => "target"
"headline" => "Engaging training"
"text" => "Players improve their football skills in diverse exercises."
]
2 => array:3 [
"icon" => "whistle"
"headline" => "Professional coaching"
"text" => "Small-group training with certified and experienced coaching staff."
]
3 => array:3 [
"icon" => "star"
"headline" => "Interactive experience"
"text" => "Entertaining physical activity meets digital experience."
]
]
"product" => WP_Post {#2367}
"layout" => "card_booking"
]
/var/www/content/themes/skillslab/single-training.php
<?php
get_header();
?>
<?php
$Modules = new \Probots\Modules\Builder;
$Modules
->setModulesFieldKey('modules')
->setLayoutFieldKey('acf_fc_layout')
->setModuleClassName('layout')
->setLayoutSubDirectory('includes/layouts');
$Modules->build();
?>
<?php
get_footer();
/var/www/wp/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;
}
Arguments
"/var/www/content/themes/skillslab/single-training.php"
/var/www/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';
}
Arguments
"/var/www/wp/wp-includes/template-loader.php"
/var/www/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( dirname( __FILE__ ) . '/wp/wp-blog-header.php' );
Arguments
"/var/www/wp/wp-blog-header.php"