PluginProbe
Tiered Pricing Table for WooCommerce / 8.0.2
Tiered Pricing Table for WooCommerce v8.0.2
8.0.2 7.1.7 7.1.5 7.1.4 7.1.1 6.5.0 6.4.0 6.1.0 trunk 1.0 1.1 2.0 2.0.1 2.0.2 2.1 2.1.1 2.1.2 2.2.0 2.2.1 2.2.2 2.2.3 2.3.0 2.3.1 2.3.2 2.3.3 All 91 releases
← All changes | src/Settings/Sections/SectionAbstract.php +20 -0 6.4.0 → 8.0.2 View file →
@@ -30,5 +30,25 @@
30 30 public function isIntegration(): bool {
31 31 return false;
32 32 }
33 33
34 + /**
35 + * "Unread" indicator on this section's navigation link. Return a version string to enable it;
36 + * bump the version to show the badge again after it was seen. Store-wide: the first visit
37 + * clears it for every user.
38 + */
39 + public function getBadgeVersion(): ?string {
40 + return null;
41 + }
42 +
43 + public function isBadgeUnseen(): bool {
44 + $version = $this->getBadgeVersion();
45 +
46 + return $version && get_option( 'tpt_section_badge_seen_' . $this->getSlug() ) !== $version;
47 + }
48 +
49 + public function markBadgeSeen() {
50 + if ( $this->getBadgeVersion() ) {
51 + update_option( 'tpt_section_badge_seen_' . $this->getSlug(), $this->getBadgeVersion(), false );
52 + }
53 + }
34 54 }