Skip Navigation

[Resolved] Replace "Deleting.." Text

This support ticket is created 4 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by aaronW-4 4 years, 8 months ago.

Assisted by: Waqar.

Author
Posts
#1863007

Tell us what you are trying to do?
I added the code to delete a post from the frontend. Instead of saying something like "Delete", I put a simple "X". The problem is while the post is being deleted, it shows "Deleting.." which looks very strange in the location where I previously had just an "X" is there a way to replace or remove the "Deleting.." text?
Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#1863259

Hi,

Thank you for contacting us and I'd be happy to assist.

I've performed some tests, but couldn't reproduce this behavior.

Can you please share temporary admin login details along with the link to a page where this delete link can be seen?

Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.

regards,
Waqar

#1864689

Thank you for sharing these details.

From the code of the delete link, it seems you're using the older "cred_delete_post_link" shortcode, which has been replaced by a new shortcode "cred-delete-post":
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred-delete-post

Example:


[cred-delete-post action='trash' onsuccess='self']X[/cred-delete-post]

This shortcode will only show the AJAX indicator for processing, without the "Deleting.." text.

#1864721

That works for removing the "Deleting.." text, but it also removes the option to have a prompt message asking "Are you sure?", which is necessary. Is there a way to still have that message?

#1865581

Thanks for writing back.

I'm afraid, the new "cred-delete-post" shortcode doesn't offer the consent prompt feature. If it is necessary, you can keep using the "cred_delete_post_link" shortcode.

As for the "Deleting.." text, you can remove it, through the "gettext" filter. For example:
( ref: https://developer.wordpress.org/reference/hooks/gettext/ )


add_filter('gettext', 'change_delete_link_text_func', 20, 3);
function change_delete_link_text_func( $translated_text, $untranslated_text, $domain ) {
	switch ( $translated_text ) {
		case 'Deleting..' :
			$translated_text = __( '', 'wp-cred' );
			break;
	}
	return $translated_text;
}

The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through active theme's "functions.php" file.

#1865727

Worked perfectly! Thank you for your help!