id = 'alg_wc_ean'; $this->label = apply_filters( 'alg_wc_ean_settings_page_label', __( 'EAN', 'ean-for-woocommerce' ) ); parent::__construct(); // Sections require_once( 'class-alg-wc-ean-settings-section.php' ); // Sections: EAN require_once( 'class-alg-wc-ean-settings-general.php' ); require_once( 'class-alg-wc-ean-settings-tools.php' ); require_once( 'class-alg-wc-ean-settings-compatibility.php' ); // Sections: Barcodes require_once( 'class-alg-wc-ean-settings-barcodes.php' ); require_once( 'class-alg-wc-ean-settings-barcodes-compatibility.php' ); new Alg_WC_EAN_Settings_Barcodes( '1d' ); new Alg_WC_EAN_Settings_Barcodes_Compatibility( '1d' ); new Alg_WC_EAN_Settings_Barcodes( '2d' ); new Alg_WC_EAN_Settings_Barcodes_Compatibility( '2d' ); // Sections: Print require_once( 'class-alg-wc-ean-settings-print.php' ); if ( 'yes' === get_option( 'alg_wc_ean_print_products_list_section', 'no' ) && 'yes' === get_option( 'alg_wc_ean_print_barcodes_to_pdf', 'no' ) ) { require_once( 'class-alg-wc-ean-settings-print-products.php' ); } // Sections: Advanced require_once( 'class-alg-wc-ean-settings-advanced.php' ); // Sections: Extra fields require_once( 'class-alg-wc-ean-settings-extra-fields.php' ); require_once( 'class-alg-wc-ean-settings-extra-field.php' ); for ( $i = 1; $i <= get_option( 'alg_wc_ean_extra_fields_num_total', 0 ); $i++ ) { new Alg_WC_EAN_Settings_Extra_Field( $i ); } // Custom fields add_action( 'woocommerce_admin_field_' . 'alg_wc_ean_file', array( $this, 'alg_wc_ean_file' ) ); } /** * alg_wc_ean_file. * * @version 3.1.0 * @since 3.1.0 * * @see https://github.com/woocommerce/woocommerce/blob/6.1.1/plugins/woocommerce/includes/admin/class-wc-admin-settings.php#L720 */ function alg_wc_ean_file( $value ) { // Custom attribute handling. $custom_attributes = array(); if ( ! empty( $value['custom_attributes'] ) && is_array( $value['custom_attributes'] ) ) { foreach ( $value['custom_attributes'] as $attribute => $attribute_value ) { $custom_attributes[] = esc_attr( $attribute ) . '="' . esc_attr( $attribute_value ) . '"'; } } // Description handling. $field_description = WC_Admin_Settings::get_field_description( $value ); $description = $field_description['description']; $tooltip_html = $field_description['tooltip_html']; ?>
' . __( 'Your settings have been reset.', 'ean-for-woocommerce' ) . '