Making WordPress.org


Ignore:
Timestamp:
03/24/2023 05:11:34 AM (22 months ago)
Author:
dd32
Message:

Plugin Directory: Add ability to define a 'Plugin Author Notice' for plugins.

This is a notice that plugin reviewers can set, that is then visible on the plugins page by plugin authors/committers.

The intent is that this can inform plugin authors why their plugin has been closed when they miss the email.

Fixse #6880.
Closes https://github.com/WordPress/wordpress.org/pull/135.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/inc/template-tags.php

    r12336 r12492  
    129129    if ( ! in_array( get_post_status( $post ), [ 'rejected', 'closed' ], true ) ) {
    130130        echo wp_kses_post( get_plugin_status_notice( $post ) );
    131     };
     131    }
    132132}
    133133
     
    636636    }
    637637}
     638
     639/**
     640 * Displays a persistent notice to the plugin author.
     641 */
     642function the_author_notice( $post = null ) {
     643    $post = get_post( $post );
     644
     645    if ( ! current_user_can( 'plugin_admin_edit', $post->ID ) ) {
     646        return;
     647    }
     648
     649    $notice = get_post_meta( $post->ID, '_author_notice', true );
     650
     651    if ( $notice && $notice['type'] && $notice['html'] ) {
     652        printf(
     653            '<div class="notice notice-alt notice-%s">%s</div>',
     654            esc_attr( $notice['type'] ),
     655            '<p><strong>' . __( 'A note from the Plugin Review team, visible only to the plugin author &amp; committers.', 'wporg-plugins' ) . '</strong></p>' .
     656            wp_kses_post( $notice['html'] ) // Should have wrapping <p> tags.
     657        );
     658    }
     659}
Note: See TracChangeset for help on using the changeset viewer.