Editor::after_save( array $args = array() )
Description #
Action to do after post is saved.
Add uploaded images to post meta and delete post meta on delete.
Parameters #
- $argsarray (Optional) Array of arguments. Default value: array()
Source #
File: lib/form/class-editor.php
public function after_save( $args = array() ) { parent::after_save(); if ( empty( $args ) || empty( $args['post_id'] ) || empty( $this->images ) ) { return; } // Add images to post meta. foreach ( $this->images as $img ) { add_post_meta( $args['post_id'], 'anspress-image', $img ); } // Delete file from session. anspress()->session->delete( 'files' ); }
Expand full source code Collapse full source code View on GitHub: lib/form/class-editor.php:275
Add your comment