Skip to content

Commit e384a6e

Browse files
author
David Evbodaghe
committed
Fix: Clear unmapped attribute banner when attribute is deleted
1 parent d0b13fe commit e384a6e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

includes/Admin/Global_Attributes_Banner.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,12 +135,12 @@ private function is_attribute_taxonomy( $taxonomy ) {
135135
}
136136

137137
/**
138-
* Check if a WooCommerce attribute still exists.
138+
* Check if a WooCommerce taxonomy attribute still exists.
139139
*
140140
* @param string $attribute_name Attribute name (without pa_ prefix).
141-
* @return bool True if the attribute exists, false otherwise.
141+
* @return bool True if the taxonomy attribute exists, false otherwise.
142142
*/
143-
private function attribute_exists( $attribute_name ) {
143+
private function taxonomy_attribute_exists( $attribute_name ) {
144144
// Check if the taxonomy exists (attributes use pa_{name} taxonomy)
145145
$taxonomy_name = 'pa_' . $attribute_name;
146146

@@ -223,7 +223,7 @@ public function display_unmapped_attribute_banner() {
223223
$attribute_name = $banner_data['attribute_name'];
224224

225225
// Check if the attribute still exists - if deleted, clear transient and return early
226-
if ( ! $this->attribute_exists( $attribute_name ) ) {
226+
if ( ! $this->taxonomy_attribute_exists( $attribute_name ) ) {
227227
delete_transient( 'fb_new_unmapped_attribute_banner' );
228228
delete_transient( 'fb_show_banner_now' );
229229
return;

0 commit comments

Comments
 (0)