Change delete message and media slug

Hi, (1) I want to change the delete message from “Are you sure you want to delete this media?” to “Are you sure you want to delete this photo?” (2) How can I change the slug “/media” to “/photo” For this I tried to insert code define(‘BP_MEDIA_SLUG’, ‘photo’); in the wp-config file but no luck.

There is one more message if no photo is uploaded "Oops !! There’s no media found for the request !! " I also want to change it in "Oops !! There’s no photo found for the request !! "

Is there any language file in which I can change the all messages and lebels

Hello @Nim_jain,

Please, find my answers below to your questions:

(1) I want to change the delete message from “Are you sure you want to delete this media?” to “Are you sure you want to delete this photo?”

There is not any filter to change the text directly for the plugin. However, you can change it from the language file.

The name of the file of translation ready strings for rtMedia plugin is buddypress-media.po. It is located at this path : wp-content/plugins/buddypress-media/language`

(2) How can I change the slug “/media” to “/photo” For this I tried to insert code define(‘BP_MEDIA_SLUG’, ‘photo’); in the wp-config file but no luck.

You need to add below two constants in the wp-config file:

define ( 'RTMEDIA_MEDIA_SLUG', 'media' );
define ( 'RTMEDIA_MEDIA_LABEL', 'Media' );

Reference document link- https://rtmedia.io/docs/developers/rtmedia-defined-constants/

(3)There is one more message if no photo is uploaded "Oops !! There’s no media found for the request !! " I also want to change it in "Oops !! There’s no photo found for the request !! "

Please, refer this document for the related filter and a sample code - https://rtmedia.io/docs/developers/hooks/change-default-media-found-message-media-tab/

I hope this helps you. Thanks.

Thanks for the reply… I check these, but none is working. (3) I inserted code in function.php, but nothing is happening

(1) I changed the language file as u said but no luck again.

(2) I pasted the above code in wp-config.php, It is changing the slug but showing no page.

That is strange @Nim_jain,

It should work.

Please, once try it using any default theme of WordPress and deactivating all other plugins to troubleshoot the issue.

Also, check if you are getting any errors in your server error log file.

Thanks.

Hi Pranali, (1) and (3) solved… For (2), slug is changing but not connected with reference page. The same problem was coming when I was changing the another buddypress label “Friend” and I placed the following code into function.php as given below, and it worked.

// change BP /Friend/ slug to /connection/ define ( ‘BP_FRIENDS_SLUG’, ‘connection’ );

// reference the newly defined slug /connection/ function bpcodex_rename_profile_tabs() {

buddypress()->members->nav->edit_nav( array( 'name' => __( 'Connection', 'textdomain' ) ), 'connection' );

} add_action( ‘bp_setup_nav’, ‘bpcodex_rename_profile_tabs’ );

Now again I think this kind of code is required…

Hello @Nim_jain,

Once you change the slug using the defined constants, please re-save permalink structure. Here is the document you can refer for re-saving the permalinks - https://rtmedia.io/docs/troubleshooting/solve-404-page-not-found-error-media-tab-buddypress/

Additionally, I wanted to inform you that now we have added a new filter that can change the text Are you sure you want to delete this media? on your request.

Here is the sample code that you can refer for the same - https://rtmedia.io/docs/developers/hooks/rtmedia_delete_prompt_message/

I hope it helps you. Thanks.

Hi Pranali, Thanks for the help. Your comments solved the problems. All done. Thanks a lot…

You are welcome, @Nim_jain.

We are glad to know that your issue has been fixed.

I am closing this thread now. Please, feel free to create new if you have any doubts in future.

Regards, Pranali