Changeset 3744556 for cookie-notice/trunk/includes/settings.php
- Timestamp:
- 10/13/2026 05:31:48 PM (3 weeks ago)
- File:
-
- 1 edited
-
cookie-notice/trunk/includes/settings.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
cookie-notice/trunk/includes/settings.php
r3731548 r3744556 2453 2453 /** 2454 2454 * Point the WordPress privacy policy page at the banner's policy page, when synced. 2455 * With no page chosen (id 0) the site's existing privacy page is kept, never cleared. 2455 2456 * 2456 2457 * @param array $options Full (merged) options … … 2458 2459 */ 2459 2460 public function sync_privacy_policy_page( $options ) { 2460 if ( $options['see_more_opt']['link_type'] === 'page' && $options['see_more_opt']['sync'] )2461 if ( $options['see_more_opt']['link_type'] === 'page' && $options['see_more_opt']['sync'] && (int) $options['see_more_opt']['id'] > 0 ) 2461 2462 update_option( 'wp_page_for_privacy_policy', $options['see_more_opt']['id'] ); 2462 2463 } … … 2471 2472 if ( $options['see_more'] && $options['link_position'] === 'message' && strpos( $options['message_text'], '[cookies_policy_link' ) === false ) 2472 2473 $options['message_text'] .= ' [cookies_policy_link]'; 2474 // Link position "banner": drop a bare trailing [cookies_policy_link] (left from "message" position; one the admin typed there is dropped too). Mid-message shortcodes and ones with attributes stay. 2475 elseif ( $options['see_more'] && $options['link_position'] === 'banner' ) 2476 $options['message_text'] = rtrim( preg_replace( '/ \[cookies_policy_link\]\s*$/', '', $options['message_text'] ) ); 2473 2477 2474 2478 return $options;
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)