Open borademircan opened 3 years ago
The simplest way to do that would be to remove the download_url
field from the update information. If there is no download URL, WordPress will still show a notification that an update is available, but it won't include the "update now" link. Instead, it will say something like "Automatic update is unavailable for this plugin". The user won't be able to install the update using the admin dashboard.
This update checker doesn't provide a way to customize the update notification; those notifications are part of WordPress core. It doesn't look like WordPress has a convenient hook you could use, either. If you want to change the notification message, you might have to either use the gettext
filter to modify the text, or hide the notification entirely and replace it with your own.
Thank you Yahnis,
Meanwhile, I found a way to append a text to the original update text. Here's how to do it if anyone is interested:
add_action( 'in_plugin_update_message-' . 'your_path/to_main_file.php', 'addUpgradeMessageLink');
function addUpgradeMessageLink () {
echo sprintf( ' ' . esc_html__( 'Your text with %slink%s here.', 'your_domain' ), '<a href="your_url_here">', '</a>' );
}
Ah, good find. I had forgotten about that hook.
We have a plugin sold in a marketplace and we only want to display a message that the plugin needs an update rather than an "update now" link. Is this possible?
Or, are we able to customize the message?
Thanks!