filter
Filters whether a user may submit feedback on a section of an article. The Articles domain answers this; it stays true when nothing answers.
Parameters of davo_article_feedback_allowed Parameter Type Description $allowed bool Whether the feedback may be submitted. Default true. $post_id int Article post ID. $user_id int User ID, or 0 for a guest.
Returns bool
add_filter Copyadd_filter ( 'davo_article_feedback_allowed' , 'my_filter_callback' , 10 , 3 );
/**
* @param bool $allowed
* @param int $post_id
* @param int $user_id
*/
function my_filter_callback ( $allowed , $post_id , $user_id ) {
// Change $allowed as needed, then return it.
return $allowed ;
}src/domains/article-section-feedback/repository.php:72, and 2 more places
action
Fires after a new section feedback entry is created.
Parameters of davo_article_section_feedback_created Parameter Type Description $post_id int Post ID. $reason string Feedback reason key. $section_content string Serialized section content. $user_id int|null User ID or null for visitors.
add_action Copyadd_action ( 'davo_article_section_feedback_created' , 'my_action_callback' , 10 , 4 );
/**
* @param int $post_id
* @param string $reason
* @param string $section_content
* @param int|null $user_id
*/
function my_action_callback ( $post_id , $reason , $section_content , $user_id ) {
// Your code here.
}src/domains/article-section-feedback/repository.php:131
action
Fires after a section feedback entry is deleted.
Parameters of davo_article_section_feedback_deleted Parameter Type Description $id int Row ID. $post_id int Post ID.
add_action Copyadd_action ( 'davo_article_section_feedback_deleted' , 'my_action_callback' , 10 , 2 );
/**
* @param int $id
* @param int $post_id
*/
function my_action_callback ( $id , $post_id ) {
// Your code here.
}src/domains/article-section-feedback/repository.php:223
action
Fires after a section feedback status is updated.
Parameters of davo_article_section_feedback_status_updated Parameter Type Description $id int Row ID. $status string New status.
add_action Copyadd_action ( 'davo_article_section_feedback_status_updated' , 'my_action_callback' , 10 , 2 );
/**
* @param int $id
* @param string $status
*/
function my_action_callback ( $id , $status ) {
// Your code here.
}src/domains/article-section-feedback/repository.php:183