: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Represent a simple value or a dynamic one.
* Used for module attributes and content.
* Flag whether the value is static or dynamic.
protected $dynamic = false;
* Value content. Represents the dynamic content type when dynamic.
* Array of dynamic content settings.
protected $settings = array();
* ET_Builder_Value constructor.
* @param boolean $dynamic
public function __construct( $dynamic, $content, $settings = array() ) {
$this->dynamic = $dynamic;
$this->content = $content;
$this->settings = $settings;
* Check if the value is dynamic or not.
public function is_dynamic() {
* Retrieve the value content.
public function get_content() {
* Get the resolved content.
* @param integer $post_id
public function resolve( $post_id ) {
if ( ! $this->dynamic ) {
return et_builder_resolve_dynamic_content( $this->content, $this->settings, $post_id, 'display' );
* Get the static content or a serialized representation of the dynamic one.
public function serialize() {
if ( ! $this->dynamic ) {
return et_builder_serialize_dynamic_content( $this->dynamic, $this->content, $this->settings );