| 开发者 | quizpin |
|---|---|
| 更新时间 | 2026年5月4日 04:29 |
| PHP版本: | 8.0 及以上 |
| WordPress版本: | 6.9 |
| 版权: | GPL-2.0-or-later |
| 版权网址: | 版权信息 |
[slg_gf_favorites] shortcode for a saved posts page.[slg_gf_favorite_button] shortcode for manual button placement.slg_gf_favorite_button() template function for theme developers.slg-guest-favorites folder to the /wp-content/plugins/ directory.Plugins screen in WordPress.My Favorites and add the [slg_gf_favorites] shortcode.Settings > SLG Guest Favorites and select that page in the Favorites page dropdown.[slg_gf_favorite_button] manually.slg_gf_favorite_button().Guest favorites are stored in the visitor's browser on that device. Logged-in favorites are stored in user meta. If a visitor later logs in, the current plugin behavior can merge guest favorites into the account.
Yes. Theme and plugin developers can call slg_gf_favorite_button() to render the same button markup used by the shortcode and public renderer. Pass a post ID when needed, or let the function resolve the current post where possible.
Public post types selected in Settings > SLG Guest Favorites are supported. By default, only standard posts are enabled.
The plugin is designed to stay cache-friendly by keeping guest state in the browser and updating the UI client-side where needed. If your site uses aggressive full-page caching, a CDN, or security rules, make sure normal frontend AJAX requests can still reach admin-ajax.php.
Guest favorites rely on browser storage in the current version. If the browser is blocking saved items, heavily restricted, or cleared, guest favorites may not persist after reload. Logged-in favorites are stored in the user account and are not affected in the same way.
The plugin removes its own saved settings. User favorites stored in user meta are preserved by default to avoid destructive data loss.
No. This plugin does not create custom database tables in the current version.
slg_gf_favorite_button() template function for theme developers.