WordPress.org

Making WordPress.org

Ticket #2860: show-close-date.patch

File show-close-date.patch, 1.2 KB (added by joostdevalk, 7 months ago)

Patch to show close date on plugins single for closed and disabled plugins

  • wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php

    diff --git wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/template-parts/plugin-single.php
    index d56ec473..28384e87 100644
    $status = get_post_status(); 
    5454                                                // fall through
    5555                                        default:
    5656                                        case 'closed':
    57                                                 $message = __( 'This plugin has been closed and is no longer available for download.', 'wporg-plugins' );
     57                                                $message        = __( 'This plugin has been closed and is no longer available for download.', 'wporg-plugins' );
    5858                                                break;
    5959                                }
     60
     61            if ( in_array( $status, array( 'closed', 'disabled' ) ) ) {
     62                    $closed_date    = get_post_meta( 'plugin_closed_date' );
     63                    if ( ! empty( $closed_date ) ) {
     64                            $message    .= '<br/>'.'This plugin was closed on ' . mysql2date( get_option( 'date_format' ), $closed_date );
     65                    }
     66            }
    6067                        ?>
    6168                        <div class="plugin-notice notice <?php echo esc_attr( $notice_type ); ?> notice-alt">
    6269                                <p><?php echo $message; ?></p>