Making WordPress.org

Changeset 13238


Ignore:
Timestamp:
02/22/2024 06:47:02 AM (2 years ago)
Author:
dd32
Message:

Plugin Directory: Add warnings generated during a plugin import to an alert on the plugin page to the author.

See #6108, #7477, #6921.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub
Files:
2 edited

Legend:

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

    r13046 r13238  
    718718                );
    719719        }
    720 }
     720
     721        $import_warnings = get_post_meta( $post->ID, '_import_warnings', true );
     722        if ( $import_warnings ) {
     723                $import_warnings  = '<ul><li>' . implode( '</li><li>', $import_warnings ) . '</li></ul>';
     724                printf(
     725                        '<div class="notice notice-error notice-alt">%s</div>',
     726                        '<p><strong>' . __( 'During the last import of your plugin the following warnings were encountered. This message is visible only to the plugin authors &amp; committers.', 'wporg-plugins' ) . '</strong></p>' .
     727                        wp_kses_post( $import_warnings )
     728                );
     729        }
     730}
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/inc/template-tags.php

    r13046 r13238  
    718718                );
    719719        }
    720 }
     720
     721        $import_warnings = get_post_meta( $post->ID, '_import_warnings', true );
     722        if ( $import_warnings ) {
     723                $import_warnings  = '<ul><li>' . implode( '</li><li>', $import_warnings ) . '</li></ul>';
     724                printf(
     725                        '<div class="notice notice-error notice-alt">%s</div>',
     726                        '<p><strong>' . __( 'During the last import of your plugin the following warnings were encountered. This message is visible only to the plugin authors &amp; committers.', 'wporg-plugins' ) . '</strong></p>' .
     727                        wp_kses_post( $import_warnings )
     728                );
     729        }
     730}
Note: See TracChangeset for help on using the changeset viewer.