Filters to change front end text


#1

So I did a little research and found that you cannot make front end text changes via the language file (.mo or.po)but you have to add filters to your themes functions file is this true? I should have researched wordpress more as I didn’t realize it was so difficult to do simple customizations so was hoping someone could help me out. What is the filter I need to change the media tab on a users buddy press profile to say photos instead of media and what is the filter to change Attach Files on the activity page to add photos… Any help would be greatly appreciated.


#2

Check this doc -> https://rtcamp.com/rtmedia/docs/developer/rtmedia-defined-constants/ for rtMedia defined constant. You need to define RTMEDIA_MEDIA_LABEL constant in wp-config.php file.

To change Attach Files on the activity page you need to use rtmedia_attach_file_message filter.


#3

Getting close… The one to change media to photos worked but the one to change Attach Files did not.
How about changing “Media Gallery” to Photo Gallery?


#4

Use following code in your theme’s functions.php file yo change Attach Files label on activity page.

add_filter('rtmedia_attach_file_message', 'rtmedia_attach_file_message_custom');  
function rtmedia_attach_file_message_custom( $label ) {  
	return "add photos";  
}

Use ‘rtmedia_gallery_title’ filter to change Media Gallery. I guess it is for shortcode gallery, right?

add_filter('rtmedia_gallery_title', 'rtmedia_gallery_title_custom');  
function rtmedia_gallery_title_custom( $title ) {  
        if( ! $title ){  
             $title = "Photo Gallery";  
        }  
	return $title;  
}

Media Gallery Title
#5

Ritesh,
Looks like that worked… Thank you. I’m curious, is this how word press is built when it comes to changing text or is this just the way the plugin itself was designed? I used to use Joomla a lot and all you had to do was change the language file for each component and you were done. This seems a very non intuitive way of doing things… Thanks again for your help.


#6

@vapidmaven,
WordPress is built for many languages -> http://codex.wordpress.org/WordPress_in_Your_Language and so as our rtMedia plugin -> https://rtcamp.com/rtmedia/docs/common/translations/

The thing is we provide most suitable text and labels for media pages but then we also provide filters so that if user want to change the content then he can.

We can also give admin option to change the text right from rtMedia admin settings which is not available right now but might be added in future.

You can change plugin template content using plugin-editor -> http://codex.wordpress.org/Editing_Files


#7

Thank you for your help. How about removing the “+” sign?


#8

You can remove it using following css code only.

.rtmedia-add-media-button i.rtmicon-plus-circle {  
   display: none;  
}

#9