WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Plugin API/Filter Reference/plugin row meta

This page is marked as incomplete. You can help Codex by expanding it.

Description

The plugin_row_meta filter hook is used to add additional links below each plugin on the plugins page.

Parameters

$links
(array) (required) The array having default links for the plugin.
Default: None
$file
(string) (required) The name of the plugin file.
Default: None

Returns

This hook should return an array.

Examples

The basic usage is as follows...

add_filter( 'plugin_row_meta', 'custom_plugin_row_meta', 10, 2 );

function custom_plugin_row_meta( $links, $file ) {

	if ( strpos( $file, 'plugin-file-name.php' ) !== false ) {
		$new_links = array(
				'donate' => '<a href="donation_url" target="_blank">Donate</a>',
                                'doc' => '<a href="doc_url" target="_blank">Documentation</a>'
				);
		
		$links = array_merge( $links, $new_links );
	}
	
	return $links;
}

This hook passes two parameters, $links and $file. The $links array variable contains the default links for the plugin. The $file variable is the name of the plugin file. So you need to check it against the actual plugin file name within the if condition.

Source File

The plugin_row_meta hook is located in wp-admin/includes/class-wp-plugins-list-table.php within single_row function.

Return to Plugin API/Filter Reference