WC_Settings_Emails::get_settings_for_default_section │ protected │ WC 1.0
Get settings array.
Method of the class: WC_Settings_Emails{}
Hooks from the method
Returns
Array
.
Usage
// protected - for code of main (parent) or child class $result = $this->get_settings_for_default_section();
WC_Settings_Emails::get_settings_for_default_section() WC Settings Emails::get settings for default section code WC 9.9.3
protected function get_settings_for_default_section() { $desc_help_text = sprintf( /* translators: %1$s: Link to WP Mail Logging plugin, %2$s: Link to Email FAQ support page. */ __( 'To ensure your store’s notifications arrive in your and your customers’ inboxes, we recommend connecting your email address to your domain and setting up a dedicated SMTP server. If something doesn’t seem to be sending correctly, install the <a href="%1$s">WP Mail Logging Plugin</a> or check the <a href="%2$s">Email FAQ page</a>.', 'woocommerce' ), 'https://wordpress.org/plugins/wp-mail-logging/', 'https://woocommerce.com/document/email-faq' ); $block_email_editor_enabled = FeaturesUtil::feature_is_enabled( 'block_email_editor' ); $email_improvements_enabled = $this->get_email_improvements_enabled(); // These defaults should be chosen by the same logic as the other color option properties. list( 'base_color_default' => $base_color_default, 'bg_color_default' => $bg_color_default, 'body_bg_color_default' => $body_bg_color_default, 'body_text_color_default' => $body_text_color_default, 'footer_text_color_default' => $footer_text_color_default, ) = EmailColors::get_default_colors( $email_improvements_enabled ); if ( $block_email_editor_enabled ) { $email_notifications_field = 'email_notification_block_emails'; $email_notifications_desc = null; } else { $email_notifications_field = 'email_notification'; /* translators: %s: help description with link to WP Mail logging and support page. */ $email_notifications_desc = sprintf( __( 'Email notifications sent from WooCommerce are listed below. Click on an email to configure it.<br>%s', 'woocommerce' ), $desc_help_text ); } $settings = array( array( 'title' => __( 'Email notifications', 'woocommerce' ), 'desc' => $email_notifications_desc, 'type' => 'title', 'id' => 'email_notification_settings', ), array( 'type' => $email_notifications_field ), array( 'type' => 'sectionend', 'id' => 'email_notification_settings', ), array( 'type' => 'sectionend', 'id' => 'email_recipient_options', ), array( 'title' => __( 'Email sender options', 'woocommerce' ), 'type' => 'title', 'desc' => __( "Set the name and email address you'd like your outgoing emails to use.", 'woocommerce' ), 'id' => 'email_options', ), array( 'title' => __( '"From" name', 'woocommerce' ), 'desc' => '', 'id' => 'woocommerce_email_from_name', 'type' => 'text', 'css' => 'min-width:400px;', 'default' => esc_attr( get_bloginfo( 'name', 'display' ) ), 'autoload' => false, 'desc_tip' => true, ), array( 'title' => __( '"From" address', 'woocommerce' ), 'desc' => '', 'id' => 'woocommerce_email_from_address', 'type' => 'email', 'custom_attributes' => array( 'multiple' => 'multiple', ), 'css' => 'min-width:400px;', 'default' => get_option( 'admin_email' ), 'autoload' => false, 'desc_tip' => true, ), array( 'type' => 'sectionend', 'id' => 'email_options', ), ); // If the email editor is enabled the design is handled by the email editor. if ( ! $block_email_editor_enabled ) { $settings = array_merge( $settings, array( array( 'title' => __( 'Email template', 'woocommerce' ), 'type' => 'title', 'desc' => __( 'Customize your WooCommerce email template and preview it below.', 'woocommerce' ), 'id' => 'email_template_options', ), array( 'title' => __( 'Try new templates', 'woocommerce' ), 'type' => 'previewing_new_templates', 'id' => 'previewing_new_templates', ), array( 'title' => __( 'Logo', 'woocommerce' ), 'desc' => __( 'Add your logo to each of your WooCommerce emails. If no logo is uploaded, your site title will be used instead.', 'woocommerce' ), 'id' => 'woocommerce_email_header_image', 'type' => 'email_image_url', 'css' => 'min-width:400px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'default' => '', 'autoload' => false, 'desc_tip' => true, ), array( 'title' => __( 'Logo width (px)', 'woocommerce' ), 'id' => 'woocommerce_email_header_image_width', 'desc_tip' => '', 'default' => '120', 'type' => 'number', 'row_class' => $email_improvements_enabled ? '' : 'disabled', ), array( 'title' => __( 'Header alignment', 'woocommerce' ), 'id' => 'woocommerce_email_header_alignment', 'desc_tip' => '', 'default' => 'left', 'type' => 'select', 'class' => 'wc-enhanced-select', 'options' => array( 'left' => __( 'Left', 'woocommerce' ), 'center' => __( 'Center', 'woocommerce' ), 'right' => __( 'Right', 'woocommerce' ), ), 'row_class' => $email_improvements_enabled ? '' : 'disabled', ), array( 'title' => __( 'Font family', 'woocommerce' ), 'id' => 'woocommerce_email_font_family', 'default' => 'Helvetica', 'type' => 'email_font_family', 'row_class' => $email_improvements_enabled ? '' : 'disabled', ), array( 'title' => __( 'Footer text', 'woocommerce' ), /* translators: %s: Available placeholders for use */ 'desc' => __( 'This text will appear in the footer of all of your WooCommerce emails.', 'woocommerce' ) . ' ' . sprintf( __( 'Available placeholders: %s', 'woocommerce' ), '{site_title} {site_url} {store_address} {store_email}' ), 'id' => 'woocommerce_email_footer_text', 'css' => 'width:400px; height: 75px;', 'placeholder' => __( 'N/A', 'woocommerce' ), 'type' => 'textarea', 'default' => '{site_title}<br />{store_address}', 'autoload' => false, 'desc_tip' => true, ), array( 'type' => 'sectionend', 'id' => 'email_template_options', ), array( 'title' => __( 'Color palette', 'woocommerce' ), 'type' => 'email_color_palette', 'id' => 'email_color_palette', ), array( 'title' => __( 'Accent', 'woocommerce' ), /* translators: %s: default color */ 'desc' => sprintf( __( 'Customize the color of your buttons and links. Default %s.', 'woocommerce' ), '<code>' . $base_color_default . '</code>' ), 'id' => 'woocommerce_email_base_color', 'type' => 'color', 'css' => 'width:6em;', 'default' => $base_color_default, 'autoload' => false, 'desc_tip' => true, ), array( 'title' => __( 'Email background', 'woocommerce' ), /* translators: %s: default color */ 'desc' => sprintf( __( 'Select a color for the background of your emails. Default %s.', 'woocommerce' ), '<code>' . $bg_color_default . '</code>' ), 'id' => 'woocommerce_email_background_color', 'type' => 'color', 'css' => 'width:6em;', 'default' => $bg_color_default, 'autoload' => false, 'desc_tip' => true, ), array( 'title' => __( 'Content background', 'woocommerce' ), /* translators: %s: default color */ 'desc' => sprintf( __( 'Choose a background color for the content area of your emails. Default %s.', 'woocommerce' ), '<code>' . $body_bg_color_default . '</code>' ), 'id' => 'woocommerce_email_body_background_color', 'type' => 'color', 'css' => 'width:6em;', 'default' => $body_bg_color_default, 'autoload' => false, 'desc_tip' => true, ), array( 'title' => __( 'Heading & text', 'woocommerce' ), /* translators: %s: default color */ 'desc' => sprintf( __( 'Set the color of your headings and text. Default %s.', 'woocommerce' ), '<code>' . $body_text_color_default . '</code>' ), 'id' => 'woocommerce_email_text_color', 'type' => 'color', 'css' => 'width:6em;', 'default' => $body_text_color_default, 'autoload' => false, 'desc_tip' => true, ), array( 'title' => __( 'Secondary text', 'woocommerce' ), /* translators: %s: footer default color */ 'desc' => sprintf( __( 'Choose a color for your secondary text, such as your footer content. Default %s.', 'woocommerce' ), '<code>' . $footer_text_color_default . '</code>' ), 'id' => 'woocommerce_email_footer_text_color', 'type' => 'color', 'css' => 'width:6em;', 'default' => $footer_text_color_default, 'autoload' => false, 'desc_tip' => true, ), array( 'title' => __( 'Auto-sync with theme', 'woocommerce' ), 'desc' => __( 'Automatically update email styles when theme styles change', 'woocommerce' ), 'id' => 'woocommerce_email_auto_sync_with_theme', 'type' => 'hidden', 'default' => 'no', 'autoload' => false, ), array( 'type' => 'sectionend', 'id' => 'email_color_palette', ), array( 'title' => __( 'Email improvements button', 'woocommerce' ), 'type' => 'email_improvements_button', 'id' => 'email_improvements_button', ), array( 'type' => 'email_preview' ), ) ); } // Remove empty elements that depend on the email_improvements feature flag. $settings = array_filter( $settings ); return apply_filters( 'woocommerce_email_settings', $settings ); }