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
| // Run this code at https://dividezigns.com/divi-icon-codes/ | |
| // Glyphs will be added beneath every icon code | |
| jQuery('.et_pb_section_1 .et_pb_row_2 .et_pb_text_inner ul li[class] em').each(function() { | |
| var entity = '&#x' + jQuery(this).text().trim().replace('\\', '') + ';'; | |
| var glyph = jQuery('<div>').html( entity ); | |
| jQuery(this).append( glyph ); | |
| }); |
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
| /* Custom divi icons via <span class="rs-divi-icon" data-icon="l"></span> where the data-icon "l" refers to hex character "\6c" */ | |
| /* To locate icons, refer to https://dividezigns.com/divi-icon-codes/ */ | |
| /* Run this JS on that page to generate a glyph for every icon which you can easily copy: https://gist.github.com/RadGH/6c12de50f590d0aaee7974e2d79c914b */ | |
| /* Or, convert the hex number to glyph in html using Ӓ and copy the glyph manually (in php, use html_entity_decode on it) */ | |
| .rs-divi-icon:before { | |
| font-family: "ETmodules" !important; | |
| text-shadow: 0 0; | |
| font-weight: normal; | |
| font-style: normal; | |
| font-variant: normal; |
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
| foreach( WC()->cart->get_cart_contents() as $cart_item_key => $cart_item ) { | |
| var_dump($cart_item_key); | |
| var_dump($cart_item); | |
| } | |
| ---- | |
| $cart_item_key | |
| string(32) "21e6ce98c8943660f4ccf0435058083d" |
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
| <?php | |
| /** | |
| * When a completed order email is triggered, the email is normally disabled in the settings. | |
| * | |
| * For the PDF workbook, we want to enable it regardless. This is because it is virtual, and does not reach the "processing" step. | |
| * | |
| * @param $enabled | |
| * @param $order |
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
| <?php | |
| // This one is VERY COMPLICATED!! It will re-send the "completed" order email based on order id. | |
| add_action( 'init', function() { | |
| do_action( 'woocommerce_order_status_completed_notification', 40057 ); | |
| }); |
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
| // See: https://radleysustaire.com/s3/2558db/chrome. | |
| // Works with any date format Javascript supports. | |
| // Includes support for "1st" "2nd" "3rd" dates, as well. | |
| // Change field id 5c92eba251e6b to your repeater field key, without the field_ prefix. | |
| // Change field id 5c92ef539f442 to your date field key, without the field_ prefix. | |
| // Not designed for nested repeaters but you could make it work by navigating through specific children. | |
| // Recommend caching selectors with a variable. | |
| jQuery('.acf-field.acf-field-5c92eba251e6b').find('.acf-repeater tbody').first().prepend(function() { | |
| return jQuery(this).children('tr.acf-row').not('.acf-clone').sort(function(a,b) { |
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
| <?php | |
| $full_url = $hero['image']['url']; | |
| $mobile_url = $hero['image_mobile']['url']; | |
| $alt = $hero['image']['alt']; | |
| $breakpoint = 480; // Mobile image will display at or below this breakpoint. | |
| printf( | |
| '<picture> | |
| <source media="(max-width: %dpx)" srcset="%s"> | |
| <source media="(min-width: %dpx)" srcset="%s"> |
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
| <?php | |
| /** | |
| * Only allow purchasing this product if a certain condition is met. | |
| * | |
| * @param WC_Cart $cart | |
| */ | |
| function rs_verify_if_user_can_purchase_product( WC_Cart $cart ) { | |
| if ( !$cart instanceof WC_Cart ) return; | |
| if ( $cart->is_empty() ) return; |
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
| <?php | |
| foreach( WC()->cart->get_cart_contents() as $cart_item_key => $cart_item ) { | |
| var_dump($cart_item); | |
| exit; | |
| } | |
| ?> | |
| array(13) { | |
| ["key"]=> | |
| string(32) "c3804daac5b8859f0975d20c9fe3370e" |
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
| <?php | |
| /** | |
| * Add a column to the orders screen that lists products that were purchased | |
| */ | |
| function aa_product_order( $columns ) { | |
| $columns['product-display'] = __( 'Products' ); | |
| return $columns; | |
| } |