Changeset 13836
- Timestamp:
- 06/19/2024 05:20:46 AM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wp-themes.com/public_html/wp-content/plugins/pattern-page/inc/page-intercept.php
r12460 r13836 9 9 */ 10 10 function get_pattern_page_id() { 11 return 256; 11 $page_id = get_option( 'pattern_page_id' ); 12 if ( $page_id ) { 13 return $page_id; 14 } 15 16 // Find the existing page. 17 $page_id = get_page_by_path( 'pattern-page' )->ID ?? 0; 18 19 // Or create it. 20 if ( ! $page_id ) { 21 $page_id = wp_insert_post( [ 22 'post_type' => 'page', 23 'post_parent' => 0, 24 'post_name' => 'pattern-page', 25 'post_title' => 'Pattern Previewer', 26 'post_status' => 'draft' 27 ] ); 28 } 29 30 update_option( 'pattern_page_id', $page_id ); 31 32 return $page_id; 12 33 } 13 34
Note: See TracChangeset
for help on using the changeset viewer.