Changeset 8570 for trunk/src/bp-core/bp-core-functions.php
- Timestamp:
- 07/09/2014 06:31:14 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-core/bp-core-functions.php
r8557 r8570 508 508 // Create the pages 509 509 foreach ( $pages_to_create as $component_name => $page_name ) { 510 $pages[ $component_name ] = wp_insert_post( array( 511 'comment_status' => 'closed', 512 'ping_status' => 'closed', 513 'post_status' => 'publish', 514 'post_title' => $page_name, 515 'post_type' => 'page', 516 ) ); 510 $exists = get_page_by_path( $component_name ); 511 512 // If page already exists, use it 513 if ( ! empty( $exists ) ) { 514 $pages[ $component_name ] = $exists->ID; 515 } else { 516 $pages[ $component_name ] = wp_insert_post( array( 517 'comment_status' => 'closed', 518 'ping_status' => 'closed', 519 'post_status' => 'publish', 520 'post_title' => $page_name, 521 'post_type' => 'page', 522 ) ); 523 } 517 524 } 518 525
Note: See TracChangeset
for help on using the changeset viewer.