Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update WP_CLI::line() to WP_CLI::log() #185

Merged
merged 1 commit into from
Dec 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions includes/wp-cli.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function generate_sitemap_for_year( $args, $assoc_args ) {
if ( is_wp_error( $valid ) )
WP_CLI::error( $valid->get_error_message() );

WP_CLI::line( sprintf( 'Generating sitemap for %s', $year ) );
WP_CLI::log( sprintf( 'Generating sitemap for %s', $year ) );

$max_month = 12;
if ( date( 'Y' ) == $year ) {
Expand Down Expand Up @@ -97,7 +97,7 @@ function generate_sitemap_for_year_month( $args, $assoc_args ) {
if ( is_wp_error( $valid ) )
WP_CLI::error( $valid->get_error_message() );

WP_CLI::line( sprintf( 'Generating sitemap for %s-%s', $year, $month ) );
WP_CLI::log( sprintf( 'Generating sitemap for %s-%s', $year, $month ) );

// Calculate actual number of days in the month since we don't have cal_days_in_month available
if ( ! function_exists( 'cal_days_in_month' ) ) {
Expand Down Expand Up @@ -147,7 +147,7 @@ function generate_sitemap_for_year_month_day( $args, $assoc_args ) {
if ( is_wp_error( $valid ) )
WP_CLI::error( $valid->get_error_message() );

WP_CLI::line( sprintf( 'Generating sitemap for %s-%s-%s', $year, $month, $day ) );
WP_CLI::log( sprintf( 'Generating sitemap for %s-%s-%s', $year, $month, $day ) );

$date_stamp = Metro_Sitemap::get_date_stamp( $year, $month, $day );
if ( Metro_Sitemap::date_range_has_posts( $date_stamp, $date_stamp ) ) {
Expand Down Expand Up @@ -219,8 +219,8 @@ public function recount_indexed_posts() {
}

update_option( 'msm_sitemap_indexed_url_count', $total_count, false );
WP_CLI::line( sprintf( 'Total posts found: %s', $total_count ) );
WP_CLI::line( sprintf( 'Number of sitemaps found: %s', $sitemap_count ) );
WP_CLI::log( sprintf( 'Total posts found: %s', $total_count ) );
WP_CLI::log( sprintf( 'Number of sitemaps found: %s', $sitemap_count ) );

}

Expand Down
Loading