Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajax #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Ajax #2

wants to merge 4 commits into from

Conversation

cmachu
Copy link
Contributor

@cmachu cmachu commented Jan 8, 2021

No description provided.

@MariuszT MariuszT requested review from Malin88 and mtyc January 9, 2021 00:18
);
}

public function handleRoute(\WP_REST_Request $request)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move WP_REST_Request to uses

$errors = $this->form_instance->form->getErrors();

if(!empty($errors)){
$response = new \WP_REST_Response([
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move WP_REST_Response to uses

}

$customResponse = [];
if($this->custom_handler){
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use instance of

@@ -0,0 +1,93 @@
<?php
/**
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless comment

use Develtio\WP\Hoya\Handlers\Step1FormHandleRequest;

/**
* Class RestApi
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless comments

*/
public $form_instance;

private $custom_handler = null;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe you are able to add @var CustomHandlerInterface|null here

p.s.
I do not know what class it should be so I put there CustomHandlerInterface

'create_cpt' => false, // enables / disables creation of CPT
];

$instance = new \Develtio\WP\Forms\Modules\Forms\CreateForm('StepFirst', $options);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$options has one tab and here is 2 tabs in the same if statement

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants