error( array( __( 'Looks like you cannot perform this action (nonce doesn\'t match)', 'advanced-cron-manager' ) ) ); } } /** * Prints success for JS * @param mixed $data anything * @return void */ public function success( $data ) { wp_send_json_success( $data ); } /** * Prints error for JS * @param mixed $data anything * @return void */ public function error( $data ) { wp_send_json_error( $data ); } /** * Responds to JS with message * @param mixed $success if empty, nothing will be passed * @param array $errors if not empty, an error will be returned * @return void */ public function response( $success = null, $errors = array() ) { if ( ! empty( $errors ) ) { $this->error( $errors ); } $this->success( $success ); } }