ode() );
return new WP_Error( 'woocommerce_rest_' . $error_code, __( 'Product review field exceeds maximum length allowed.', 'woocommerce' ), array( 'status' => 400 ) );
}
$updated = wp_update_comment( wp_slash( (array) $prepared_args ) );
if ( false === $updated ) {
return new WP_Error( 'woocommerce_rest_comment_failed_edit', __( 'Updating review failed.', 'woocommerce' ), array( 'status' => 500 ) );
}
if ( isset( $request['status'] ) ) {
$this->handle_status_param( $request['status'], $id );
}
}
if ( ! empty( $request['rating'] ) ) {
update_comment_meta( $id, 'rating', $request['rating'] );
}
if ( isset( $request['verified'] ) && ! empty( $request['verified'] ) ) {
update_comment_meta( $id, 'verified', $request['verified'] );
}
$review = get_comment( $id );
/** This action is documented in includes/api/class-wc-rest-product-reviews-controller.php */
do_action( 'woocommerce_rest_insert_product_review', $review, $request, false );
$fields_update = $this->update_additional_fields_for_object( $review, $request );
if ( is_wp_error( $fields_update ) ) {
return $fields_update;
}
$request->set_param( 'context', 'edit' );
$response = $this->prepare_item_for_response( $review, $request );
return rest_ensure_response( $response );
}
/**
* Deletes a review.
*
* @param WP_REST_Request $request Full details about the request.
* @return WP_Error|WP_REST_Response Response object on success, or error object on failure.
*/
public function delete_item( $request ) {
$review = $this->get_review( $request['id'] );
if ( is_wp_error( $review ) ) {
return $review;
}
$force = isset( $request['force'] ) ? (bool) $request['force'] : false;
/**
* Filters whether a review can be trashed.
*
* Return false to disable trash support for the post.
*
* @since 3.5.0
* @param bool $supports_trash Whether the post type support trashing.
* @param WP_Comment $review The review object being considered for trashing support.
*/
$supports_trash = apply_filters( 'woocommerce_rest_product_review_trashable', ( EMPTY_TRASH_DAYS > 0 ), $review );
$request->set_param( 'context', 'edit' );
if ( $force ) {
$previous = $this->prepare_item_for_response( $review, $request );
$result = wp_delete_comment( $review->comment_ID, true );
$response = new WP_REST_Response();
$response->set_data(
array(
'deleted' => true,
'previous' => $previous->get_data(),
)
);
} else {
// If this type doesn't support trashing, error out.
if ( ! $supports_trash ) {
/* translators: %s: force=true */
return new WP_Error( 'woocommerce_rest_trash_not_supported', sprintf( __( "The object does not support trashing. Set '%s' to delete.", 'woocommerce' ), 'force=true' ), array( 'status' => 501 ) );
}
if ( 'trash' === $review->comment_approved ) {
return new WP_Error( 'woocommerce_rest_already_trashed', __( 'The object has already been trashed.', 'woocommerce' ), array( 'status' => 410 ) );
}
$result = wp_trash_comment( $review->comment_ID );
$review = get_comment( $review->comment_ID );
$response = $this->prepare_item_for_response( $review, $request );
}
if ( ! $result ) {
return new WP_Error( 'woocommerce_rest_cannot_delete', __( 'The object cannot be deleted.', 'woocommerce' ), array( 'status' => 500 ) );
}
/**
* Fires after a review is deleted via the REST API.
*
* @param WP_Comment $review The deleted review data.
* @param WP_REST_Response $response The response returned from the API.
* @param WP_REST_Request $request The request sent to the API.
*/
do_action( 'woocommerce_rest_delete_review', $revi
Premium Custom Metalwork & Fabrication Services
Large Range of Standard Products Choose from a variety of gates, railings, bollards, staircases and shelters to meet your needs.
Expert Fabrication Our highly skilled team ensures consistently high quality in every piece we create.
Onsite Maintenance and Repair We also offer maintenance and repair services for automatic gate systems.
Experience and Expertise We have years of experience in iron and steel manufacturing
Quality Assurance Our products undergo rigorous quality checks to ensure customer satisfaction
Bespoke Services We offer custom solutions to meet your unique needs
Custom Metalwork Services Our experienced team can create unique and stunning bespoke metalwork, tailored to your exact specifications.
Expert Craftmanship Our skilled craftsman use the finest materials and techniques to produce exceptional pieces of custom metalwork.
Innovative Design We take a creative approach to metalwork, using the latest design techniques and ideas to bring your vision to life.
Cost-Effective Solutions Our bespoke service allows you to get exactly what you want, without breaking the bank.
Quality Assurance We stand behind our work and ensure that every piece of custom metalwork meets the highest quality standards.
Testimonials See what our satisfied clients have to say about our services.
We hired Mulhollands Contracts for a staircase and railing project and were blown away by their craftsmanship and attention to detail. They truly exceeded our expectations.
Mulhollands Contracts provided us with a beautiful bespoke gate for our property. They were professional and efficient, making the whole process stress-free. We highly recommend them.
Get In Touch With Us Today