__( 'Enter a Service title.', 'booking' ) ), 400 ); } $result = $provider->save( $payload ); if ( is_wp_error( $result ) || empty( $result ) ) { wpbc_appointment_services_send_provider_error( $result, __( 'The Service could not be saved.', 'booking' ) ); } wp_send_json_success( array( 'service' => wpbc_appointment_services_normalize_item( $result ), 'message' => __( 'Service saved.', 'booking' ) ) ); } add_action( 'wp_ajax_WPBC_AJX_APPOINTMENT_SERVICE_SAVE', 'wpbc_appointment_services_ajax_save' );