WordPress.org

Ready to get started?Download WordPress

Codex

Plugin API/Filter Reference/plugin row meta

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

Contents

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(
					'<a href="donation_url" target="_blank">Donate</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