Ok, I found the code below where I can make this change (I think), but I don't know how to start. All I want is that a node author DOES NOT have the option to change the $form['twitter']['status']['#default_value'] = variable_get('twitter_default_format', 'New post: !title !tinyurl'); line. My best option would be to make that a hidden field, is that possible? So the only option the user would have is the checkbox to post to Twitter or not.
module_load_include('inc', 'twitter');
$twitter_form = twitter_form();
if (!$twitter_form) {
return;
}
$form['twitter'] = array(
'#type' => 'fieldset',
'#title' => t('Post to twitter.com'),
'#collapsible' => TRUE,
'#collapsed' => FALSE,
'#tree' => TRUE,
);
$form['twitter']['post'] = array(
'#type' => 'checkbox',
'#title' => t('Announce this post on Twitter'),
'#default_value' => (empty($form['nid']['#value'])),
'#id' => 'twitter-toggle',
);
$form['twitter'] += $twitter_form;
$form['twitter']['status']['#default_value'] = variable_get('twitter_default_format', 'New post: !title !tinyurl');
$form['twitter']['status']['#description'] = t('
Comments
Comment #1
steinmb commentedHi, yeah It is possible. Changing the node form is something you do at theme leve, don't hack the Twitter mode :) Pls. read up on theming and the form API.