Skip to content

Commit d5147c2

Browse files
author
Alec
committed
[ticket/15879] Add core.posting_modify_default_variables
Allows the modification of default variables put into post_data. Also allows you to unset variables in post_data to inherit the default ones. PHPBB3-15879
1 parent 5179e4f commit d5147c2

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

phpBB/posting.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -597,6 +597,20 @@
597597
// Set some default variables
598598
$uninit = array('post_attachment' => 0, 'poster_id' => $user->data['user_id'], 'enable_magic_url' => 0, 'topic_status' => 0, 'topic_type' => POST_NORMAL, 'post_subject' => '', 'topic_title' => '', 'post_time' => 0, 'post_edit_reason' => '', 'notify_set' => 0);
599599

600+
/**
601+
* This event allows you to modify the default variables for post_data, and unset them in post_data if needed
602+
*
603+
* @event core.posting_modify_default_variables
604+
* @var array post_data Array with post data
605+
* @var array uninit Array with default vars to put into post_data, if they aren't there
606+
* @since 3.2.5-RC1
607+
*/
608+
$vars = array(
609+
'post_data',
610+
'uninit',
611+
);
612+
extract($phpbb_dispatcher->trigger_event('core.posting_modify_default_variables', compact($vars)));
613+
600614
foreach ($uninit as $var_name => $default_value)
601615
{
602616
if (!isset($post_data[$var_name]))

0 commit comments

Comments
 (0)