How do I get the [View details] link to appear on the Plugin admin page in the Description area?
The plugin is working fine, the version and authors (with links) show up fine, but no [View details] like most other plugins.
Perhaps I’m asking the wrong question, but I’m working on a plugin and I would like to show the readme.txt and screenshots like I see in so many plugins. How do I get this link to appear and show the contents of the readme.txt file?
I’ve been reading through Professional WordPress Plugin Development, but I can’t find this reference. I can refer to an external URI, but I would like the nice and concise panel that shows on other plugins.
The ‘View details’ link in the installed plugins list table is only shown for plugins that are hosted in the WordPress.org plugin repository. If you take a look at the source for WP_Plugins_List_Table->single_row()
, you’ll see that the details link is only generated if there’s API data present, e.g. the slug is set:
// Details link using API info, if available
if ( isset( $plugin_data['slug'] ) && current_user_can( 'install_plugins' ) ) {
$plugin_meta[] = sprintf( '<a href="https://wordpress.stackexchange.com/questions/162146/%s" class="thickbox" aria-label="https://wordpress.stackexchange.com/questions/162146/%s" data-title="https://wordpress.stackexchange.com/questions/162146/%s">%s</a>',
esc_url( network_admin_url( 'plugin-install.php?tab=plugin-information&plugin=' . $plugin_data['slug'] .
'&TB_iframe=true&width=600&height=550' ) ),
esc_attr( sprintf( __( 'More information about %s' ), $plugin_name ) ),
esc_attr( $plugin_name ),
__( 'View details' )
);
} elseif ( ! empty( $plugin_data['PluginURI'] ) ) {
$plugin_meta[] = sprintf( '<a href="https://wordpress.stackexchange.com/questions/162146/%s">%s</a>',
esc_url( $plugin_data['PluginURI'] ),
__( 'Visit plugin site' )
);
}