Skip to content

Commit

Permalink
Better
Browse files Browse the repository at this point in the history
  • Loading branch information
officiallygod committed Jul 26, 2024
1 parent 2d3dda1 commit f0262dc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion includes/Services/SiteGenService.php
Original file line number Diff line number Diff line change
Expand Up @@ -931,6 +931,7 @@ public static function publish_sitemap_pages( $site_description, $content_style,
continue;
}

$page_name = count( explode( '/', $page['path'] ) ) > 1 ? explode( '/', $page['path'] )[1] : false;
$page_content = $other_pages[ $page['slug'] ];
$post_id = SitePagesService::publish_page(
$page['title'],
Expand All @@ -939,7 +940,7 @@ public static function publish_sitemap_pages( $site_description, $content_style,
array(
'nf_dc_page' => $page['slug'],
),
explode( '/', $page['path'] )[1]
$page_name
);

if ( $update_nav_menu && ! is_wp_error( $post_id ) ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/Services/SitePagesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class SitePagesService {
* @param string $name The page name that will be used in the slug.
* @return int|\WP_Error
*/
public static function publish_page( $title, $content, $is_template_no_title = false, $meta = false, $name = false ) {
public static function publish_page( $title, $content, $is_template_no_title = false, $meta = false, $name = null ) {
$post = array(
'post_title' => $title,
'post_status' => 'publish',
Expand Down

0 comments on commit f0262dc

Please sign in to comment.