bsk_pdfm_after_document_update
Description
Use this hook to perform actions after a document updated. The hook is triggered when a document is updated..
Usage
add_action( "bsk_pdfm_after_document_update", "do_sepcial_action_when_document_updated", 10, 5 );
Parameters
- $pdf_id integer. The id of the new inserted document.
- $pdf_categories array. The id of the categories that the document is assigned.
- $pdf_tags array. The id of the tags that the document is assigned.
- $file_url string. The URL of the file, empty string if no file uploaded.
- $extra_datas array. Extra data of the document, includes: title ( string), description ( string ), publish_date ( string ), expiry_date ( string ), status ( string ).
Example
Save document update log.
add_filter( "bsk_pdfm_after_document_update", "save_document_update_logs", 10, 5 ); function save_document_update_logs( $pdf_id, $pdf_categories, $pdf_tags, $file_url, $extra_datas ) { if ( $extra_datas['status'] != 'published' ) { return; } update_option( 'bsk_pdfm_document_' . $pdf_id . '_' . wp_date( 'Y-m-d-H-i-s' ), 'The document: ' . $extra_datas['title'] . ' is updated on ' . wp_date( 'Y-m-d H:i:s' ) ); }