I'm trying to change the submit button text "Save and keep published", but with no luck. I'm using the standard hook_form_FORM_ID_alter()
.
function mymodule_form_node_news_form_alter(&$form, \Drupal\Core\Form\FormStateInterface $form_state, $form_id) {
// This is the problem, what should I put here
$form['actions']['publish']['#value'] == '';
}
This is what dpm()
returns.
'publish' => array(7)
'#value' => object Drupal\Core\StringTranslation\TranslatableMarkup(5)
protected string -> string(18) "Save and keep published"
protected translatedMarkup -> NULL
protected options -> array(0)
protected stringTranslation -> NULL
protected arguments -> array(0)
How do I change text on the submission button in the node form?