Skip to content

Commit 62f7e12

Browse files
committed
Updating the nonce location and the help section triggers
1 parent e15ed3e commit 62f7e12

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

includes/classes/class-forms-update.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ function insertSelectCountries() {
251251
*/
252252
public function metabox_action( $post ) {
253253
$this->parse_meta_values( $post );
254-
do_meta_boxes( null, 'pff-paystack-metabox-holder', $post );
254+
do_meta_boxes( 'paystack_form', 'pff', $post );
255255
}
256256

257257
/**
@@ -262,9 +262,9 @@ public function metabox_action( $post ) {
262262
public function register_meta_boxes() {
263263
// Register the information boxes.
264264
if ( isset( $_GET['action'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
265-
add_meta_box( 'pff_paystack_editor_details_box', __( 'Paste shortcode on preferred page', 'paystack_form' ), [ $this, 'shortcode_details' ], 'paystack_form', 'pff-paystack-metabox-holder' );
265+
add_meta_box( 'pff_paystack_editor_details_box', __( 'Paste shortcode on preferred page', 'paystack_form' ), [ $this, 'shortcode_details' ], 'paystack_form', 'pff' );
266266
}
267-
add_meta_box( 'pff_paystack_editor_help_box', __( 'Help Section', 'pff-paystack' ), [ $this, 'help_details' ], 'paystack_form', 'pff-paystack-metabox-holder' );
267+
add_meta_box( 'pff_paystack_editor_help_box', __( 'Help Section', 'pff-paystack' ), [ $this, 'help_details' ], 'paystack_form', 'pff' );
268268

269269
// Add in our "normal" meta boxes
270270
add_meta_box( 'form_data', __( 'Extra Form Description', 'pff-paystack' ), [ $this, 'form_data' ], 'paystack_form', 'normal', 'default' );
@@ -303,8 +303,6 @@ public function shortcode_details( $post ) {
303303
* @return void
304304
*/
305305
public function help_details( $post ) {
306-
// We shall output 1 Nonce Field for all of our metaboxes.
307-
wp_nonce_field( 'pff-paystack-save-form', 'pff_paystack_save' );
308306
?>
309307
<div class="awesome-meta-admin">
310308
<?php echo wp_kses_post( __( 'Email and Full Name field is added automatically, no need to include that.<br /><br />
@@ -335,6 +333,9 @@ public function parse_meta_values( $post ) {
335333
public function form_data() {
336334
$html = [];
337335

336+
// We shall output 1 Nonce Field for all of our metaboxes.
337+
$html[] = wp_nonce_field( 'pff-paystack-save-form', 'pff_paystack_save', true, false );
338+
338339
if ($this->meta['hidetitle'] == 1) {
339340
$html[] = '<label><input name="_hidetitle" type="checkbox" value="1" checked> ' . __('Hide the form title', 'pff-paystack') . ' </label>';
340341
} else {

0 commit comments

Comments
 (0)