Support Forum
Email follow-up: changing attachment button text
Roman Mica
Member
Free Members
Offline
I need a little bit of help with this. I followed these instructions:
locate the file wp-content/sp-resources/forum-plugins//plupload/sp-plupload-plugin.php
find in that file the function - sp_plupload_pm_editor_button($out, $a)
change the singe line after the 'else' to these two lines:
$buttonText = apply_filters('sph_editor_toolbar_attachment_button', __('Attachments', 'sp-plup'));
$out.= "<input type='button' class='spSubmit spLeft' title='".__('Open/Close to Upload Attachments', 'sp-plup')."' id='spUploadsButton' value='".$buttonText."' onclick='spjOpenEditorBox(\"spUploadsBox\");' />";
This needs to be exact of course.
Create a new file in the wp-content folder called - sp-user-functions.php
Add the following code to it:
<?php
add_filter('sph_editor_toolbar_attachment_button', 'sp_change_attachment_text');
function sp_change_attachment_text($text) {
return 'your button text';
}
?>
Is this the correct folder to add the new file, sp-user-functions.php, or does it belong with the rest of the plugin files? Also, where would the option be to change the name?
Yellow Swordfish
Glinton, England
SP Master
Offline
Yes- that is the correct place to create the new file.This is a special custom code file that will never be removed by an SP update - unlike all other files in the plugin.
You put your preferred button text in that function - where it currently reads: 'your button text'.
YELLOW
SWORDFISH
|
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17366
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626