Skip to content

Commit

Permalink
refactor: remove unused parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
adekbadek committed Oct 4, 2023
1 parent 052ba07 commit 0fa646d
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions includes/wizards/class-setup-wizard.php
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,10 @@ public function api_update_theme_with_mods( $request ) {
if ( substr_compare( $key, '_all_posts', -strlen( '_all_posts' ) ) === 0 ) {
switch ( $key ) {
case 'featured_image_all_posts':
self::update_meta_key_in_batches( $key, 'newspack_featured_image_position', $value );
self::update_meta_key_in_batches( 'newspack_featured_image_position', $value );
break;
case 'post_template_all_posts':
self::update_meta_key_in_batches( $key, '_wp_page_template', $value );
self::update_meta_key_in_batches( '_wp_page_template', $value );
break;
}
continue;
Expand All @@ -532,11 +532,10 @@ public function api_update_theme_with_mods( $request ) {
* Change a meta value on a batch of posts.
*
* @param string $key The key of the theme mod.
* @param string $meta_key The meta key to update.
* @param string $value The value to update.
* @param int $page The page of posts to update.
*/
private static function update_meta_key_in_batches( $key, $meta_key, $value, $page = 0 ) {
private static function update_meta_key_in_batches( $meta_key, $value, $page = 0 ) {
$args = [
'posts_per_page' => 100,
'post_type' => 'post',
Expand All @@ -559,7 +558,7 @@ private static function update_meta_key_in_batches( $key, $meta_key, $value, $pa
update_post_meta( $post, $meta_key, $value );
}
if ( 1 < $number_of_pages ) {
self::update_meta_key_in_batches( $key, $meta_key, $value, $page + 1 );
self::update_meta_key_in_batches( $meta_key, $value, $page + 1 );
}
}

Expand Down

0 comments on commit 0fa646d

Please sign in to comment.