HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
How can i remove the text "New Discussion" from inside the button ?
ui_designer
New
I want to remove the text "New Discussion" completely from the button/module "Add new Discussion".
I searched in the file class.newdiscussionmodule.php
which renders the button and i tried to use this code:
public function addButton($url) { $this->Buttons[] = ['Url' => $url]; }
instead of this...
public function addButton($text, $url) { $this->Buttons[] = ['Text' => $text, 'Url' => $url]; }
but it doesn't work. Text is still in the button.
One more option could be to create a locale file and use something like that
$Definition['New Discussion'] = '';
but this will remove the text globally
What is the solution so i can remove the text only from the button? I could but i don't want to use CSS or js to simply hide the text.
Many thanks
0
Comments
The translation text for the New Discussion is not easy to guess. Looking at the language files might help, you might have to search the for "New Discussion" or you have to ask.
The translation code for the New Discussion button is
AddText
, therefore you can add$Definition['AddText'] = '';
to /themes/yourtheme/locale/en.php, which wouldn't be optimal sincea) it would only be used in english language forums and
b) any other custom translation might override that
You can use it in the theme hooks file like that:
From my perspective this is cleaner since hiding the text is a design decision of the theme and no language issue
That is even better:
This will only influence the NewDiscussionModule
Thanks for your help @R_J i will try it.