SubmissionMetabox.php 739 B

123456789101112131415161718192021222324252627282930
  1. <?php if ( ! defined( 'ABSPATH' ) ) exit;
  2. abstract class NF_Abstracts_SubmissionMetabox extends NF_Abstracts_Metabox
  3. {
  4. /**
  5. * @var array
  6. */
  7. protected $_post_types = array( 'nf_sub' );
  8. /**
  9. * @var NF_Database_Models_Submission
  10. */
  11. protected $sub;
  12. public function __construct()
  13. {
  14. parent::__construct();
  15. if( ! isset( $_GET[ 'post' ] ) ) return;
  16. $this->_title = __( 'Submission Metabox', 'ninja-forms' );
  17. $post_id = absint( $_GET[ 'post' ] );
  18. $this->sub = Ninja_Forms()->form()->get_sub( $post_id );
  19. add_action( 'add_meta_boxes', array( $this, 'add_meta_boxes' ) );
  20. add_action( 'save_post', array( $this, '_save_post' ) );
  21. }
  22. }