Skip to content

Commit

Permalink
allowing cpt export to export navigation meta as well
Browse files Browse the repository at this point in the history
  • Loading branch information
mark-c-woodard committed Aug 2, 2024
1 parent 66e903a commit 5371bc9
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions includes/header/cpt-to-template.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,21 @@ public function post_meta ( $post_id ) {
$return .= $key . ': ' . $output . ', ';
}
}

if( str_starts_with( $key, '_kad_navigation_' ) && $value[0] !== '' ) {
if ( str_starts_with( $value[0], 'a:' ) ) {
$return .= $key . ': ' . json_encode( maybe_unserialize( $value[0] ) ) . ', ';
} else {
$output = $value[0];
if( is_numeric( $value[0] )) {
$output = '"' . $value[0] . '"';
} else if ( $key === '_kad_navigation_widthUnit' ) {
$output = '"' . $value[0] . '"';
}

$return .= $key . ': ' . $output . ', ';
}
}
}
$return .= '};';

Expand Down

0 comments on commit 5371bc9

Please sign in to comment.