id = 'printblob'; $this->label = __( 'PrintBlob', 'printblob' ); parent::__construct(); } protected function get_own_sections() { return array( '' => __( 'Designer', 'printblob' ), ); } protected function get_settings_for_default_section() { $attributes = Settings::attribute_choices(); $pro = Settings::pro_rows(); $designer = array( array( 'id' => 'printblob_designer', 'type' => 'title', 'title' => __( 'Designer', 'printblob' ), 'desc' => sprintf( /* translators: %s: link to PrintBlob › Mockups. */ __( 'Turn the designer on per product in its PrintBlob tab. The product photos and their print areas are under %s.', 'printblob' ), '' . esc_html__( 'PrintBlob › Mockups', 'printblob' ) . '' ), ), array( 'id' => Settings::DESIGNER_PAGE, 'type' => 'single_select_page_with_search', 'title' => __( 'Designer page', 'printblob' ), 'desc_tip' => __( 'Where the Colours block and colour links send customers. Leave empty to use the first page that contains the designer.', 'printblob' ), 'class' => 'wc-page-search', 'args' => array( 'exclude' => array() ), // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude -- Not a query: WooCommerce's page search field reads args.exclude (a PHP notice without it), and nothing is excluded. 'autoload' => false, ), array( 'id' => Settings::COLOR_ATTRIBUTE, 'type' => 'select', 'title' => __( 'Colour attribute', 'printblob' ), 'desc_tip' => __( 'The product attribute whose terms are the product colours. Each colour gets a colour value and a photo on its edit screen.', 'printblob' ), 'default' => 'pa_color', 'options' => $attributes ? $attributes : array( 'pa_color' => 'pa_color' ), 'class' => 'wc-enhanced-select', ), array( 'id' => Settings::SIZE_ATTRIBUTE, 'type' => 'select', 'title' => __( 'Size attribute', 'printblob' ), 'desc_tip' => __( 'The product attribute that holds sizes, shown as size buttons in the designer.', 'printblob' ), 'default' => 'pa_size', 'options' => $attributes ? $attributes : array( 'pa_size' => 'pa_size' ), 'class' => 'wc-enhanced-select', ), array( 'id' => Settings::MAX_UPLOAD_MB, 'type' => 'number', 'title' => __( 'Largest customer image (MB)', 'printblob' ), /* translators: %d: the largest file this server accepts, in MB. */ 'desc' => sprintf( __( 'This server accepts files up to %d MB: a larger setting is held to that.', 'printblob' ), (int) floor( wp_max_upload_size() / MB_IN_BYTES ) ), 'default' => Designer_Data::numbers()['max_upload_mb'], 'custom_attributes' => array( 'min' => Designer_Data::numbers()['max_upload_mb_range']['min'], 'max' => Designer_Data::numbers()['max_upload_mb_range']['max'], 'step' => 1, ), ), array( 'id' => Settings::KEEP_DAYS, 'type' => 'number', 'title' => __( 'Keep unordered designs (days)', 'printblob' ), 'desc' => __( 'Designs added to a cart but never ordered are deleted after this many days. Ordered designs are kept with the order.', 'printblob' ), 'default' => 7, 'custom_attributes' => array( 'min' => 1, 'max' => 365, 'step' => 1, ), ), ); return array_merge( $designer, $pro['fonts'], array( array( 'id' => 'printblob_designer', 'type' => 'sectionend', ), ), $pro['panel'] ); } }