Is there a way to change the text of the publish button on a custom post type to say some different? For example, Save instead of Publish. And also remove the draft button?
|
If you look into
Note the There are two ways to handle your problem: 1. Address the string in a single specialized function (be sure to match the correct textdomain!) or 2. use a more generic approach. @Rarst has just now posted version 1, so I'll add version 2. :)
You don't need to use the code as a plugin. Including it in your theme's functions.php will be enough. UpdateTo remove the original Save button (not sure what the 'draft' button is), add the following code to your functions.php/a plugin:
Yes, it's ugly. |
|||||||||||||
|
|
Another approach would be unregister the metabox, then re-register that same box with differing values, namingly the publish text.. See the discussion i had here regarding moving a meta box, you should be able to apply something similar to rename that Publish text. |
|||
|
|
|
The code for hakre's suggestion to use translation filter would be something like this:
|
|||
|
|
|
You could just find the button via jQuery and swap the text node for something else. That would be a piece of cake to do. |
|||
|
|
|
This is not a full answer but some directions: Any text displayed surpasses a translation filter and can therefore be changed in a callback function (hook). So if the hook is only registered on the page where you would like to change that, job done. The draft button could be "removed" by hiding it via CSS. The CSS could be injected into the |
||||
|
|