screens as $screen ) { add_meta_box( 'coupon_preview', __( 'Coupon Preview', 'affcoupon' ), array( $this, 'add_meta_box_callback' ), $screen, 'normal', 'low' ); } } /** * Generates the HTML for the meta box * * @param object $post WordPress post object * * @since 1.0 */ public function add_meta_box_callback( $post ) { wp_nonce_field( 'coupon_preview_data', 'coupon_preview_nonce' ); $this->generate_fields( $post ); } /** * Generates the field's HTML for the meta box. * * @since 1.0 */ public function generate_fields( $post ) { // Preview template self-escapes its dynamic values and prints directly; no buffer needed. include WPAF_Plugin::instance()->plugin_includes . 'functions/admin/wpaf-preview-metabox.php'; } }