);
get_current_screen()->
set_help_sidebar( '<p><strong>' .
__( 'For more information:'
) . '</strong></p>' .
'<p>' .
__( '<a href="https://wordpress.org/documentation/article/plugins-editor-screen/">Documentation on Editing Plugins</a>'
) . '</p>' .
'<p>' .
__( '<a href="https://developer.wordpress.org/plugins/">Documentation on Writing Plugins</a>'
) . '</p>' .
'<p>' .
__( '<a href="https://wordpress.org/support/forums/">Support forums</a>'
) . '</p>'
);
$settings = array
( 'codeEditor' =>
wp_enqueue_code_editor( array
( 'file' =>
$real_file ) ),
);
wp_enqueue_script( 'wp-theme-plugin-editor'
);
wp_add_inline_script( 'wp-theme-plugin-editor',
sprintf( 'jQuery( function( $ ) { wp.themePluginEditor.init( $( "#template" ), %s ); } )',
wp_json_encode( $settings ) ) );
wp_add_inline_script( 'wp-theme-plugin-editor',
sprintf( 'wp.themePluginEditor.themeOrPlugin = "plugin";'
) );
require_once ABSPATH . 'wp-admin/admin-header.php';
update_recently_edited( WP_PLUGIN_DIR . '/' .
$file );
if ( !
empty( $posted_content ) ) { $content =
$posted_content;
}