mirror of
https://gh.wpcy.net/https://github.com/WordPress/wordpress.org.git
synced 2026-04-29 06:32:52 +08:00
Props obenland. Closes https://github.com/WordPress/wordpress.org/pull/587. git-svn-id: https://meta.svn.wordpress.org/sites/trunk@14790 74240141-8908-4e6f-9713-ba540dce6ec7
22 lines
595 B
PHP
22 lines
595 B
PHP
<?php
|
|
/**
|
|
* Plugin Name: Plugin Import Notice
|
|
* Description: Shows an admin notice when editing an approved plugin that has no content.
|
|
*/
|
|
|
|
add_action( 'admin_notices', function () {
|
|
$screen = get_current_screen();
|
|
if ( ! $screen || 'plugin' !== $screen->id ) {
|
|
return;
|
|
}
|
|
|
|
$post = get_post();
|
|
if ( ! $post || 'approved' !== $post->post_status ) {
|
|
return;
|
|
}
|
|
|
|
printf(
|
|
'<div class="notice notice-info"><p>This plugin has not been imported yet. If it exists on plugins.svn, run <code>npm run plugins:import %s</code> to import it.</p></div>',
|
|
esc_html( $post->post_name )
|
|
);
|
|
} );
|