mont58-theme/wp-content/themes/mont58-coffee/functions.php

46 lines
1.3 KiB
PHP
Raw Normal View History

2024-05-08 20:15:09 +00:00
<?php
/**
* Equeue the child theme stylesheet.
*/
function mont58coffee_enqueue_styles() {
wp_enqueue_style('child-style',
get_stylesheet_uri(),
array( 'bridge' ),
wp_get_theme()->get( 'Version' )
);
}
add_action( 'wp_enqueue_scripts', 'mont58coffee_enqueue_styles' );
add_filter( 'get_terms', 'ts_get_subcategory_terms', 10, 3 );
function ts_get_subcategory_terms( $terms, $taxonomies, $args ) {
$new_terms = array();
// if it is a product category and on the shop page
if ( in_array( 'product_cat', $taxonomies ) && ! is_admin() &&is_shop() ) {
foreach( $terms as $key => $term ) {
if ( !in_array( $term->slug, array( 'african-coffees' ) ) ) { //pass the slug name here
$new_terms[] = $term;
}}
$terms = $new_terms;
}
return $terms;
}
/**
* Plugin Name: Extend WooCommerce Subscription Intervals
* Description: Add a "every 10 weeks" billing interval to WooCommerce Subscriptions
* Author: Brent Shepherd
* Author URI: http://brent.io
* Version: 1.0
* License: GPL v2
*/
function eg_extend_subscription_period_intervals( $intervals ) {
$intervals[10] = sprintf( __( 'every %s', 'my-text-domain' ), WC_Subscriptions::append_numeral_suffix( 10 ) );
return $intervals;
}
add_filter( 'woocommerce_subscription_period_interval_strings', 'eg_extend_subscription_period_intervals' );