AdvancedCustomFields/acf5-beta — pull request #323 by cdcarson (2014-06-29 18:41:36+00:00)
Title: Filter option page text

I'd like a way to control the header and button text in the save box on options pages. Right now the header text ("Publish") and the button text ("Save Options") is hard coded in `options-page.php`.

This potentially poses a UX issue. For example, we're developing a plugin where end users will be creating ~10 custom post types and editing lots and lots of site options. I'd definitely like to make clear to the end user the difference between the two, or at least be able to change up the semantics if we run into user misunderstanding.

This proposed change adds `acf/options_page/publish_text` and `acf/options_page/save_options_text` filters, allowing userland developers like me to change these bits of text. Example...

````
add_filter('acf/options_page/publish_text', function($value, $slug){
// Admin::SLUG_DATES is unique constant for the panel in question
if ($slug !== Admin::SLUG_DATES){
return $value;
}
// use userland translations, rather than 'acf'
return __('Save Dates', 'my-userland-domain');
}, 10, 2);
add_filter('acf/options_page/save_options_text', function($value, $slug){
if ($slug !== Admin::SLUG_DATES){
return $value;
}
return __('Save Date Options', 'my-userland-domain');
}, 10, 2);
````

Let me know what you think. One could do the same thing with javascript but I think this is cleaner.

Thanks for all your work on ACF,

Chris