{
protected $view = "single-product";
/**
* Populate $this->data
*/
public function __construct($args = [])
{
global $post;
parent::__construct($args);
$this->addBoutiqueTheme();
$this->data["backurl"] = $this->getBackURL();
$this->model = (new Products)->is($post->ID);
$this->data["user"] = $this->user->loadEverything()->loadTeams()->loadBoutique()->getOne();
$this->data["product"] = $this->model->loadAllowed($this->data["user"])->getOne();
if (!$this->data["user"]->group_tag) { // || isset($_GET["modification-groupe"])
$this->groupEdition();
} else {
$this->addLimitContext();
}
}
// ==================================================
// > GROUP EDITION
// ==================================================
/**
* Add context for the limit
*
* @return void
*/
public function addLimitContext()
{
$this->data["limit_context"] = "";
// No more info
Arguments
"Trying to get property 'group_tag' of non-object"
{
protected $view = "single-product";
/**
* Populate $this->data
*/
public function __construct($args = [])
{
global $post;
parent::__construct($args);
$this->addBoutiqueTheme();
$this->data["backurl"] = $this->getBackURL();
$this->model = (new Products)->is($post->ID);
$this->data["user"] = $this->user->loadEverything()->loadTeams()->loadBoutique()->getOne();
$this->data["product"] = $this->model->loadAllowed($this->data["user"])->getOne();
if (!$this->data["user"]->group_tag) { // || isset($_GET["modification-groupe"])
$this->groupEdition();
} else {
$this->addLimitContext();
}
}
// ==================================================
// > GROUP EDITION
// ==================================================
/**
* Add context for the limit
*
* @return void
*/
public function addLimitContext()
{
$this->data["limit_context"] = "";
// No more info
// Clear obsolete flash data
if (!$same_session_page) {
Data::goToNextSessionPage();
}
// Class method call
if (is_string($resp)) {
// Extracts method
$method = false;
if (preg_match('/(.*)::(.*)/', $resp, $keys)) {
$resp = $keys[1];
$method = $keys[2];
}
// Add namespace to class
$classname = "Syltaen\\$resp";
// Instanciate the class with the arguments
$class = new $classname($args);
// Lauch mehtod if any
if ($method) {
$class->$method();
}
}
// Closure function call
if (is_callable($resp)) {
$resp($args);
}
exit;
}
// ==================================================
// > RULES
// ==================================================
public static function any($resp, $args = [])
{
* @param boolean $resp
* @param array $args
* @return boolean
*/
public static function is($condition, $resp = false, $args = null, $prefix = "is_")
{
$conditions = (array) $condition;
foreach ($conditions as $condition) {
$argument = null;
if (preg_match('/(.*):(.*)/', $condition, $parts)) {
$condition = $parts[1];
$argument = $parts[2];
}
$condition = $prefix . $condition;
if ($condition($argument)) {
if ($resp) {
static::respond($resp, $args);
}
return true;
};
}
return false;
}
/**
* Website is in maintenance mode
*
* @param boolean $resp
* @return void
*/
public static function maintenance($resp = false)
{
if (Data::get("maintenance_mode", "option") && !current_user_can("administrator")) {
static::respond($resp);
}
}
// ==================================================
// > FORUM
// ==================================================
Route::is("single_user_edit", "SpecialPageController::error404", null, "bbp_is_");
Route::is("bbpress", "ForumsController::forum");
// ==================================================
// > SINGLES
// ==================================================
Route::is("singular:amb_team", "SingleTeamAmbController::routing");
Route::is("page:ambassadeurs-creer-equipe", "SingleTeamAmbController::renderCreate");
Route::is("singular:gnp_team", "SingleTeamGNPController::routing");
Route::is("page:gnp-creer-equipe", "SingleTeamGNPController::renderCreate");
Route::is("singular:events", "SingleEventController::routing");
Route::custom("event_create", "SingleEventController::renderCreate", ["type"]);
Route::is("singular:commune", "SingleCommuneController::rapport");
Route::is("singular:product", "SingleProductController::render");
Route::is("single", "SingleController::render");
// ==================================================
// > SEARCH
// ==================================================
Route::is("search", "SpecialPageController::search", ["search" => get_search_query()]);
// ==================================================
// > API
// ==================================================
Route::custom("api", "ApiController", ["method", "target", "mode"]);
// ==================================================
// > NINJA FORM PREVIEW
// ==================================================
Route::query("nf_preview_form", "SpecialPageController::ninjaFormPreview");
}
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/vhosts/bewapp.hungryminds.host/httpdocs/wp-content/themes/syltaen/index.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/vhosts/bewapp.hungryminds.host/httpdocs/wp-includes/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';
Arguments
"/var/www/vhosts/bewapp.hungryminds.host/httpdocs/wp-blog-header.php"