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?
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
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.
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?
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.
Worked perfectly! Thank you for your help!