add_filter( 'debug_information', 'add_plugin_details', 10, 1 );
function add_plugin_details( array $args ) : array {
$args['plugin-slug'] = [
'label' => esc_html__( 'My Plugin Section', 'text-domain' ),
'description' => esc_html__( 'A description of what this section is about.', 'text-domain' ),
/* The fields you would like to add within the section. */
'fields' => [
/* Each field should have a unique key, this is displayed within copy/paste text. */
'unique_plugin_key' => [
/* The label of the field. */
'label' => esc_html__( 'This is the field text', 'text-domain' ),
/* The value of the field (string, integer, float or array). */
'value' => 'value',
/* Additional field info that should be added to the copy/paste text. Otherwise false. */
'debug' => 'value',
/**
* Set this to true if the value should not be added to copy/paste functionality.
*
* You should hide product keys and sensitive info. Basically anything that would be bad if
* it ended up in a public forum.
*/
'private' => false
]
]
];
return $args;
}
Source: https://www.tannerrecord.com/how-to-add-plugin-info-to-wordpress-site-health/
Leave a Reply