pbs_save_content_data
సేవ్ చేయవలసిన పోస్ట్ డేటాను సవరించడానికి ఒక ఫిల్టర్. PBS ఎడిటర్ నుండి సేవ్ ప్రక్రియ ప్రారంభించబడినప్పుడు ఇది కాల్ చేయబడుతుంది.
పారామీటర్లు
$post_data
Array. సేవ్ చేయాల్సిన తుది పోస్ట్ డేటా, ఇది ఆ తర్వాత నేరుగా wp_update_post()కి పంపబడుతుంది.
$_POST
Array. సేవ్ చేయడానికి ఎడిటర్ నుండి పంపబడిన రా (raw) పోస్ట్ డేటా. ఇది ఇప్పటికే nonce ధృవీకరించబడింది.
$post_id
Int. మనం సేవ్ చేస్తున్న పోస్ట్ ఐడి.
ఉదాహరణ
add_filter( 'pbs_save_content_data', 'save_always_as_draft', 10, 3 );
function save_always_as_draft( $post_data, $_post, $post_id ) {
// ఏదో ఒక కారణం చేత, పోస్ట్ ఎల్లప్పుడూ డ్రాఫ్ట్గానే ఉండాలని మేము కోరుకుంటున్నాము.
$post_data['post_status'] = 'draft';
return $post_data;
}