Last active
August 22, 2022 08:55
-
-
Save avillegasn/dba35a8499aaf00228162c052a937d55 to your computer and use it in GitHub Desktop.
Add a settings link under your plugin title in the list of plugins
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // do not include this opening php tag in your file | |
add_filter( 'plugin_action_links_nelio-content/nelio-content.php', 'nc_settings_link' ); | |
function nc_settings_link( $links ) { | |
// Build and escape the URL. | |
$url = esc_url( add_query_arg( | |
'page', | |
'nelio-content-settings', | |
get_admin_url() . 'admin.php' | |
) ); | |
// Create the link. | |
$settings_link = "<a href='$url'>" . __( 'Settings' ) . '</a>'; | |
// Adds the link to the end of the array. | |
array_push( | |
$links, | |
$settings_link | |
); | |
return $links; | |
}//end nc_settings_link() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
its not work please tell me how to use it?