Skip to content

Commit

Permalink
[#495] adding notes for TODO
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget committed Mar 1, 2024
1 parent 0840f69 commit 9b14215
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions client-mu-plugins/goodbids/src/classes/Network/Sites.php
Original file line number Diff line number Diff line change
Expand Up @@ -1101,26 +1101,34 @@ private function get_page_path( string $path ): ?WP_Post {
* @since 1.0.0
*/
public function set_nonprofit_navigation(): void {
// TODO: Figure out why it does not fire on setup
add_action(
'goodbids_nonprofit_verified',
function ( int $site_id ): void {
$about_id = get_option( self::ABOUT_OPTION );
$auctions_id = get_option( self::AUCTIONS_OPTION );
$about_id = get_option( self::ABOUT_OPTION );
$auctions_id = get_option( self::AUCTIONS_OPTION );

if ( ! $about_id || ! $auctions_id ) {
return;
}

$wp_navigation = new WP_Query(
[
'post_type' => 'wp_navigation',
'post_status' => [ 'publish' ],
]
);
$nav_links = [

$nav_links = [
get_post( $about_id ),
get_post( $auctions_id ),
];


// Set the navigation content
ob_start();
goodbids()->load_view( 'parts/nonprofit-navigation.php', compact( 'nav_links' ) );

// TODO: figure out how to get ID - it is always the first one
$navigation_content = [
'ID' => $wp_navigation->posts[0]->ID,
'post_content' => ob_get_clean(),
Expand Down

0 comments on commit 9b14215

Please sign in to comment.