From 9d4123cee1867ee7199b06bdc92d40611f547ecc Mon Sep 17 00:00:00 2001 From: Zach van Rijn Date: Wed, 21 Jul 2021 14:54:07 -0500 Subject: Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/. --- inc/compatibility/edd/edd-common-functions.php | 324 +++++++++++++++++++++++++ 1 file changed, 324 insertions(+) create mode 100644 inc/compatibility/edd/edd-common-functions.php (limited to 'inc/compatibility/edd/edd-common-functions.php') diff --git a/inc/compatibility/edd/edd-common-functions.php b/inc/compatibility/edd/edd-common-functions.php new file mode 100644 index 0000000..7bcbca6 --- /dev/null +++ b/inc/compatibility/edd/edd-common-functions.php @@ -0,0 +1,324 @@ +'; + do_action( 'astra_edd_archive_block_wrap_top' ); + + foreach ( $edd_structure as $value ) { + + switch ( $value ) { + case 'title': + /** + * Add Product Title on edd page for all products. + */ + do_action( 'astra_edd_archive_title_before' ); + do_action( 'astra_edd_archive_title' ); + do_action( 'astra_edd_archive_title_after' ); + break; + case 'image': + /** + * Add Product Title on edd page for all products. + */ + do_action( 'astra_edd_archive_image_before' ); + do_action( 'astra_edd_archive_image' ); + do_action( 'astra_edd_archive_image_after' ); + break; + case 'price': + /** + * Add Product Price on edd page for all products. + */ + do_action( 'astra_edd_archive_price_before' ); + do_action( 'astra_edd_archive_price' ); + do_action( 'astra_edd_archive_price_after' ); + break; + case 'short_desc': + /** + * Add Product short description on edd page for all products. + */ + do_action( 'astra_edd_archive_short_description_before' ); + do_action( 'astra_edd_archive_short_description' ); + do_action( 'astra_edd_archive_short_description_after' ); + break; + case 'add_cart': + /** + * Add to cart on edd page for all products. + */ + do_action( 'astra_edd_archive_add_to_cart_before' ); + do_action( 'astra_edd_archive_add_to_cart' ); + do_action( 'astra_edd_archive_add_to_cart_after' ); + + break; + case 'category': + /** + * Add and/or Remove Categories from edd archive page. + */ + do_action( 'astra_edd_archive_category_before' ); + do_action( 'astra_edd_archive_category' ); + do_action( 'astra_edd_archive_category_after' ); + break; + default: + break; + } + } + + do_action( 'astra_edd_archive_block_wrap_bottom' ); + echo ''; + do_action( 'astra_edd_archive_after_block_wrap' ); + } + } + + add_action( 'astra_edd_archive_product_content', 'astra_edd_archive_product_structure' ); +} + +/** + * Returns list of Easy Digital Downloads Terms + */ +if ( ! function_exists( 'astra_edd_terms_list' ) ) { + /** + * Show EDD product terms + * + * @param string $taxonomy_name Taxonomy name. + * @return void + */ + function astra_edd_terms_list( $taxonomy_name ) { + $terms = get_terms( $taxonomy_name ); + ?> +
+ + name ); ?> + +
+ '; + $output .= '' . esc_html( $variable_button_text ) . ''; + $output .= ''; + } else { + if ( ! empty( $add_to_cart_text ) ) { + $output = edd_get_purchase_link( + array( + 'price' => false, + 'text' => esc_html( $add_to_cart_text ), + ) + ); + } + } + + return $output; +} -- cgit v1.2.3-60-g2f50