/** * overwrite the default WordPress constructor */ function __construct() { // read our map_array $this->map_array = td_api_block::get_by_id($this->td_block_id); $widget_ops = array('classname' => 'td_pb_widget', 'description' => '[tagDiv] ' . $this->map_array['name']); /** * overwrite the widget settings, we emulate the WordPress settings. Before WP 4.3 we called the old php4 constructor again :( * @see \WP_Widget::__construct */ $id_base = $this->map_array['base'] . '_widget'; $name = '[tagDiv] ' . $this->map_array['name']; $widget_options = $widget_ops; $control_options = array(); $this->id_base = strtolower($id_base); $this->name = $name; $this->option_name = 'widget_' . $this->id_base; $this->widget_options = wp_parse_args($widget_options, array('classname' => $this->option_name)); $this->control_options = wp_parse_args($control_options, array('id_base' => $this->id_base)); // build the default values? $this->map_param_default_array = $this->build_param_default_values(); }
function __construct() { $this->td_widget_builder = new td_widget_builder($this); //get block map $this->td_widget_builder->td_map(td_api_block::get_by_id($this->td_block_id)); }