Skip to content

Commit

Permalink
fix(cs): done
Browse files Browse the repository at this point in the history
  • Loading branch information
Mte90 committed May 19, 2023
1 parent b897c7a commit 82213cf
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions plugin-name/backend/ImpExp.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ public function initialize() {
return;
}

if ( \current_user_can( 'manage_options' ) ) {
// Add the export settings method
\add_action( 'admin_init', array( $this, 'settings_export' ) );
// Add the import settings method
\add_action( 'admin_init', array( $this, 'settings_import' ) );
if ( !\current_user_can( 'manage_options' ) ) {
return;
}

// Add the export settings method
\add_action( 'admin_init', array( $this, 'settings_export' ) );
// Add the import settings method
\add_action( 'admin_init', array( $this, 'settings_import' ) );
}

/**
Expand Down Expand Up @@ -92,7 +94,7 @@ public function settings_import() {
if ( !isset( $_FILES[ 'pn_import_file' ][ 'name' ] ) ) {
return;
}

$file_name_parts = \explode( '.', $_FILES[ 'pn_import_file' ][ 'name' ] ); //phpcs:ignore WordPress.Security.ValidatedSanitizedInput
$extension = \end( $file_name_parts );

Expand Down

0 comments on commit 82213cf

Please sign in to comment.