Main::increment_views( string $id )
Increment views for an onboarding element.
Contents
Parameters
- $id
-
(string) (Required) The onboarding ID (tour or hint).
Return
(int) The views count for the particular $id
.
Source
File: src/Tribe/Onboarding/Main.php
public function increment_views( $id ) { $option = tribe_get_option( 'tribe_onboarding_views', [] ); $views = 0; if ( isset( $option[ $id ] ) ) { $views = intval( $option[ $id ] ); } // Increment views and save. $views++; $option[ $id ] = $views; tribe_update_option( 'tribe_onboarding_views', $option ); return $views; }
Changelog
Version | Description |
---|---|
4.14.9 | Introduced. |