Skip to content

Commit

Permalink
[#39] removing page for menu
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-schmidt-viget committed Dec 19, 2023
1 parent 92a9d4b commit 03573ac
Showing 1 changed file with 1 addition and 28 deletions.
29 changes: 1 addition & 28 deletions client-mu-plugins/goodbids/src/classes/Auctions/Auctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public function __construct() {
// Set the auction archive page in the main navigation
$this->set_auction_archive_posts_per_page();

// Adds the auction archive page to the pages
$this->add_auction_archive_page();

// Sets a default image
$this->set_default_feature_image();
}
Expand Down Expand Up @@ -474,38 +471,14 @@ function ( int $post_id ) {
private function set_auction_archive_posts_per_page(): void {
add_action(
'pre_get_posts',
function ( $query ) {
function ( \WP_Query $query ): void {
if ( ! is_admin() && is_post_type_archive( 'gb-auction' ) ) {
$query->set( 'posts_per_page', 9 );
}
}
);
}

/**
* Adds the Auction archive page the pages section
*
* @since 1.0.0
*
* @return void
*/
private function add_auction_archive_page(): void {
add_action(
'goodbids_init_site',
function () {
$page = array(
'post_type' => 'page',
'post_title' => __( 'Auctions', 'goodbids' ),
'post_status' => 'publish',
'post_author' => 1,
'post_name' => self::ARCHIVE_SLUG,
);

wp_insert_post( $page );
}
);
}


/**
* Set the default feature image for Auction
Expand Down

0 comments on commit 03573ac

Please sign in to comment.