Set the method of violating the house rule of the message author in the naughty column

($status! =’approved’)
Delete\u comment\u meta ($comment\u ID, self:: meta\u key);
If (! Empty ($\u get[‘houserules’]) |! Empty ($\u post[‘houserules’])
Update\u comment\u meta ($comment\u ID, self:: meta\u key,’1′);
}The
If the comment is not in the approval process, the tag of the comment will be removed. Then check if houserules is set and make sure there are tags in the comments. The
Process updates to the comment page. How about replacing text? Step 2 – on the Settings > discussions page, add options to the discussions page to easily update the message with the rule violation message tag to replace the text in the specified comment. Easily update the violation rule message through androg settings \/\/register new house rules message option on discussion page
Function hr\register\u setting(){
Register_setting(
‘discussion’,
‘hr_msg’,
‘trim’
);
Add_settings_field(
‘houserules’,
‘broke house rules message’,
Array (&$this,’hr_show_settings’),
‘discussion’,
‘default’,
Array (‘label\u for’= >’hr\u msg’)
);
}The
\/\/Description for new HR option
Function hr_description(){
Echo ‘
Male enter message to be displayed in place of comment text
‘;
}The
\/\/Get the option value
Function hr_show_settings ($args){
$data = esc\u attr (get\u option (‘hr\u msg’,’ ‘);
Printf(
‘male ‘$ Data.’ Male ‘,
$data,
$args[‘label_for’]
);
}The
This is the standard configuration api code and is added to the admin_init operation. Add a new house rule message option at the bottom of the default options in the Settings > discussion page. Options are stored as global options named hr\u MSG. Messages to search for and use as alternate text for markup comments. The
Step 3 – replacing the marked comment text with \
Function get_comment_text ($text, $comment){
If (get\u comment\u meta ($comment->comment\u ID, self:: meta\u key, true)){
Return get\u option (‘hr\u msg’,’ ‘);
}Else{
Return $text;
}The
}The
Now, if the message is marked as a rule violator, the following is publicly displayed: The
Now Chris Knowles has undoubtedly violated the rules. Comments can be a powerful and effective means of building and engaging audiences, but they must set well-defined boundaries. Using the \
Photo courtesy: Daniel novta label: Comments

Author:

Leave a Reply

Your email address will not be published. Required fields are marked *