title = __( 'Current Stock Value', ATUM_TEXT_DOMAIN ); $this->description = __( 'Get current all items stock value', ATUM_TEXT_DOMAIN ); $this->thumbnail = ATUM_URL . 'assets/images/dashboard/widget-thumb-stock-control.png'; $this->default_layout = array( 'x' => 0, 'y' => 10, 'width' => 6, 'height' => 4, 'min-height' => 5, ); parent::__construct(); } /** * Widget initialization * * @since 1.5.0 */ public function init() { // TODO: Load the config for this widget?? } /** * Load the widget view * * @since 1.5.0 */ public function render() { $current_stock_values = WidgetHelpers::get_items_in_stock(); $config = $this->get_config(); Helpers::load_view( 'widgets/current-stock-value', compact( 'config', 'current_stock_values' ) ); } /** * Load widget config view * This is what will display when an admin clicks "Configure" at widget header * * @since 1.5.0 * * @return string */ public function get_config() { // TODO: IMPLEMENT WIDGET SETTINGS. return ''; // Helpers::load_view_to_string( 'widgets/stock-control-config' );. } }