Skip to content

Instantly share code, notes, and snippets.

View ayoubkhan558's full-sized avatar
🏠
Working from home

Muhammad Ayoub Khan ayoubkhan558

🏠
Working from home
View GitHub Profile
@ayoubkhan558
ayoubkhan558 / gist:cec3901541952152aeffd53d4ef042ef
Created December 12, 2023 06:03
Show ACF repeater fields from Product taxonomy in tag taxonomy archive page
<?php
// Get the current tag
$tag = get_queried_object();
// Check if the tag exists
if ($tag) {
// Get ACF repeater field values for the current tag
$repeaterField = get_field('product_tag_faq', 'product_tag_' . $tag->term_id);
@ayoubkhan558
ayoubkhan558 / gist:fb05f4ef59f5e747813a616e59af89ca
Created December 12, 2023 06:03
Show ACF repeater fields from Product categories in tag taxonomy archive page
<?php
// Get the current category ID
$category_id = get_queried_object_id();
$term = get_queried_object();
$repeaterField = get_field('category_faq', 'product_cat_' . $category_id);
// Check if repeater field has values
if ($repeaterField) :
echo '<ul class="accordion accordionjs">';
$counter = 1;
@ayoubkhan558
ayoubkhan558 / Yup conditional validation
Created April 26, 2024 03:33
How to validate two fields that depend on each other with Yup
# How to validate two fields that depend on each other with Yup
```js
const schema = yup.object().shape({
propCategory: yup.object().shape({
label: yup.string().required(),
value: yup.string().required(),
icon: yup.string().required(),
}),