Changeset 3791202 for cliedesk/trunk/src/Modules/Knowledge/HelpCenter.php
- Timestamp:
- 11/08/2026 04:28:35 PM (5 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cliedesk/trunk/src/Modules/Knowledge/HelpCenter.php
r3777980 r3791202 36 36 add_filter( 'template_include', array( $this, 'classic_template' ), 20 ); 37 37 add_action( 'wp_enqueue_scripts', array( $this, 'assets' ) ); 38 add_action( 'template_redirect', array( self::class, 'cache_policy' ), 0 ); 38 39 add_filter( 'body_class', array( $this, 'body_class' ) ); 39 40 // KB-37: the help-center search on any page (the block works too). … … 46 47 public static function is_help(): bool { 47 48 return is_post_type_archive( Articles::POST_TYPE ) || is_tax( Articles::TAXONOMY ) || is_singular( Articles::POST_TYPE ); 49 } 50 51 /** 52 * What a page cache may do with this help page: keep it while the help center is public (the same for everyone, 53 * refreshed when an article or a setting changes), never store it when it is private. A visitor who unlocked a 54 * password-protected help center must not fill the cache for everyone else. 55 */ 56 public static function cache_policy(): void { 57 if ( ! self::is_help() ) { 58 return; 59 } 60 if ( self::is_public() ) { 61 \Cliedesk\Infrastructure\Http\NoCache::tag_public(); 62 return; 63 } 64 \Cliedesk\Infrastructure\Http\NoCache::page(); 48 65 } 49 66
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)