??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/sendmaxagency.com/wp-content/plugins/surerank/inc/meta-variables/variables.php
⬅ Kembali
<?php
/**
* Meta Variables
*
* @package surerank
* @since 0.0.1
*/
namespace SureRank\Inc\Meta_Variables;
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly.
}
/**
* This is the base class for all meta_variables classes.
* All meta_variables classes will extend this class.
* Handles common function required for data generation.
*
* @since 0.0.1
*/
class Variables {
/**
* Variables
*
* @var array<string, mixed>
*/
public $variables = [];
/**
* Category
*
* @var string
*/
public $category = '';
/**
* Constructor
*
* @since 1.0.0
*/
public function __construct() {
}
/**
* Check if variables are empty.
*
* @since 0.0.1
* @return bool
*/
public function check_empty_variables() {
if ( empty( $this->variables ) ) {
return false;
}
return true;
}
/**
* Get values of all variables in a class
*
* @since 1.0.0
* @return array<string, mixed>
*/
public function get_all_values() {
if ( ! $this->check_empty_variables() ) {
return [];
}
$new_variables = [];
foreach ( $this->variables as $key => $variable ) {
$new_variables = $this->create_new_variables( $new_variables, $key );
}
return $new_variables;
}
/**
* Get value of specific key in a class
* for example `ID` from `Post` class.
*
* @param string $key Key.
*
* @since 1.0.0
* @return array<string, mixed>
*/
public function get_key_value( $key ) {
if ( ! $this->check_empty_variables() ) {
return [];
}
if ( ! isset( $this->variables[ $key ] ) ) {
return [];
}
$new_variables = [];
return $this->create_new_variables( $new_variables, $key );
}
/**
* Create new variables
*
* @param array<string, mixed> $new_variables New variables.
* @param string $key Key.
*
* @since 1.0.0
* @return array<string, mixed>
*/
public function create_new_variables( $new_variables, $key ) {
$value = $this->get_variable_value( $key );
if ( false !== $value ) {
$this->variables[ $key ]['value'] = $value;
$new_variables[ $key ] = $this->variables[ $key ];
}
return $new_variables;
}
/**
* Get variable value
*
* @param string $key Key.
*
* @since 1.0.0
* @return mixed
*/
public function get_variable_value( $key ) {
$method = "get_{$key}";
if ( method_exists( $this, $method ) ) {
return $this->$method();
}
return false;
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
🐘 post.php
php
7.6 KB
2026-06-26 15:48
🐘 site.php
php
6.7 KB
2026-06-26 15:48
🐘 term.php
php
3.2 KB
2026-06-26 15:48
🐘 user.php
php
3.6 KB
2026-06-26 15:48
🐘 variables.php
php
2.4 KB
2026-06-26 15:48