This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_action( 'sliced_after_description', 'si20211021_pre_fill_quote_description' ); | |
| function si20211021_pre_fill_quote_description( $cmb ) { | |
| global $pagenow; | |
| // only pre-fills new quotes | |
| if ( $pagenow === 'post-new.php' && isset( $_GET['post_type'] ) && $_GET['post_type'] === 'sliced_quote' ) { | |
| $field = $cmb->get_field( '_sliced_description' ); | |
| if ( $field ) { | |
| $field->args['default'] = 'Text to pre-fill goes here'; | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'sliced_get_gateway_authorize_net_label', 'sliced_customize_authorize_net_gateway_label' ); | |
| function sliced_customize_authorize_net_gateway_label( $label ) { | |
| return 'Pay by Credit Card'; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'sliced_email_attachment', 'sliced_remove_pdf_attachment', 20, 2 ); | |
| function sliced_remove_pdf_attachment( $attachment = null, $id ) { | |
| return null; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'wpwham_product_open_pricing_metabox_options', 'wpwham_20210930_change_metabox_defaults' ); | |
| function wpwham_20210930_change_metabox_defaults( $options ) { | |
| foreach ( $options as &$option ) { | |
| if ( $option['name'] === 'alg_wc_product_open_pricing_enabled' ) { | |
| $option['default'] = 'yes'; | |
| break; | |
| } | |
| } | |
| return $options; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'sliced_get_email_recipient', 'sliced_custom_add_recipient', 10, 3 ); | |
| function sliced_custom_add_recipient( $output, $id, $type ) { | |
| if ( $type === 'invoice_available' ) // new invoice email sent to client | |
| $output .= ', second_email_address@example.com'; | |
| elseif ( $type === 'quote_available' ) // new quote email sent to client | |
| $output .= ', second_email_address@example.com'; | |
| elseif ( $type === 'quote_accepted' ) // quote accept email sent to admin | |
| $output .= ', second_email_address@example.com'; | |
| elseif ( $type === 'quote_declined' ) // quote declined email sent to admin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'wpwham_sku_sku_template_variables', 'wpwham_20210826_add_custom_sku_variables', 10, 7 ); | |
| function wpwham_20210826_add_custom_sku_variables( $variables, $product_id, $sku_number, $variation_suffix, $is_preview, $parent_product_id, $_product ) { | |
| $variables['{raw_sku}'] = ''; | |
| if ( $_product instanceof WC_Product_Variation ) { | |
| $parent_raw_sku = get_post_meta( $parent_product_id, 'raw_sku', true ); | |
| $variables['{raw_sku}'] = $parent_raw_sku; | |
| } else { | |
| $raw_sku = get_post_meta( $parent_product_id, 'raw_sku', true ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| add_filter( 'wpwham_checkout_files_upload_allow_admin_delete_files', '__return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* To trigger a regeneration of all orders: */ | |
| $BRDP = Alg_WC_Bulk_Regenerate_Download_Permissions_Core::get_instance(); | |
| $BRDP->bulk_regenerate_download_permissions_all_orders(); | |
| /* To trigger a regeneration of a single order: */ | |
| $order_id = 12345; // your WooCommerce order ID goes here | |
| $BRDP = Alg_WC_Bulk_Regenerate_Download_Permissions_Core::get_instance(); | |
| $BRDP->smart_downloadable_product_permissions( $order_id, 'single_item' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // use online at https://3v4l.org/CfM8n | |
| // use ISO 2-digit country codes | |
| // example: AU = Australia, US = United States, GB = United Kingdom, etc. | |
| // reference: https://www.nationsonline.org/oneworld/country_code_list.htm | |
| // put as many countries as you need, 1 per line: | |
| $countries = array | |
| ( | |
| 'AU', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // use online at https://3v4l.org/brsbU | |
| $roles = array | |
| ( | |
| 'guest', | |
| 'administrator', | |
| 'editor', | |
| 'author', | |
| 'contributor', | |
| 'subscriber', |