Skip to content

Commit

Permalink
Rename $args
Browse files Browse the repository at this point in the history
  • Loading branch information
takayukister committed Jun 16, 2024
1 parent 73ab83c commit 25a1e1a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions includes/submission.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ class WPCF7_Submission {
/**
* Returns the singleton instance of this class.
*/
public static function get_instance( $contact_form = null, $args = '' ) {
public static function get_instance( $contact_form = null, $options = '' ) {
if ( $contact_form instanceof WPCF7_ContactForm ) {
if ( empty( self::$instance ) ) {
self::$instance = new self( $contact_form, $args );
self::$instance = new self( $contact_form, $options );
self::$instance->proceed();
return self::$instance;
} else {
Expand All @@ -58,13 +58,13 @@ public static function is_restful() {
/**
* Constructor.
*/
private function __construct( WPCF7_ContactForm $contact_form, $args = '' ) {
$args = wp_parse_args( $args, array(
private function __construct( WPCF7_ContactForm $contact_form, $options = '' ) {
$options = wp_parse_args( $options, array(
'skip_mail' => false,
) );

$this->contact_form = $contact_form;
$this->skip_mail = (bool) $args['skip_mail'];
$this->skip_mail = (bool) $options['skip_mail'];
}


Expand Down Expand Up @@ -208,15 +208,15 @@ public function get_result() {
/**
* Adds items to the array of submission result properties.
*
* @param string|array|object $args Value to add to result properties.
* @param string|array|object $data Value to add to result properties.
* @return array Added result properties.
*/
public function add_result_props( $args = '' ) {
$args = wp_parse_args( $args, array() );
public function add_result_props( $data = '' ) {
$data = wp_parse_args( $data, array() );

$this->result_props = array_merge( $this->result_props, $args );
$this->result_props = array_merge( $this->result_props, $data );

return $args;
return $data;
}


Expand Down Expand Up @@ -667,13 +667,13 @@ private function spam() {
*
* @link https://contactform7.com/2019/05/31/why-is-this-message-marked-spam/
*/
public function add_spam_log( $args = '' ) {
$args = wp_parse_args( $args, array(
public function add_spam_log( $data = '' ) {
$data = wp_parse_args( $data, array(
'agent' => '',
'reason' => '',
) );

$this->spam_log[] = $args;
$this->spam_log[] = $data;
}


Expand Down Expand Up @@ -834,7 +834,7 @@ private function unship_uploaded_files() {

$file = $_FILES[$tag->name];

$args = array(
$options = array(
'tag' => $tag,
'name' => $tag->name,
'required' => $tag->is_required(),
Expand All @@ -843,7 +843,7 @@ private function unship_uploaded_files() {
'schema' => $this->contact_form->get_schema(),
);

$new_files = wpcf7_unship_uploaded_file( $file, $args );
$new_files = wpcf7_unship_uploaded_file( $file, $options );

if ( is_wp_error( $new_files ) ) {
$result->invalidate( $tag, $new_files );
Expand Down

0 comments on commit 25a1e1a

Please sign in to comment.