woocommerce_rest_insert_{$this->post_type}_object

woocommerce_rest_insert_{$this->post_type}_object

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: woocommerce.8.7.0

do_action('woocommerce_rest_insert_{$this->post_type}_object') is found 2 times:

  • /includes/rest-api/Controllers/Version3/class-wc-rest-crud-controller.php line 207
    			 * @param WC_Data         $object    Inserted object.
    			 * @param WP_REST_Request $request   Request object.
    			 * @param boolean         $creating  True when creating object, false when updating.
    			 */
    			do_action( "woocommerce_rest_insert_{$this->post_type}_object", $object, $request, true );
    		} catch ( WC_Data_Exception $e ) {
    			$object->delete();
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
    		} catch ( WC_REST_Exception $e ) {
    			$object->delete();
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
    
  • /includes/rest-api/Controllers/Version3/class-wc-rest-crud-controller.php line 254
    			 * @param WC_Data         $object    Inserted object.
    			 * @param WP_REST_Request $request   Request object.
    			 * @param boolean         $creating  True when creating object, false when updating.
    			 */
    			do_action( "woocommerce_rest_insert_{$this->post_type}_object", $object, $request, false );
    		} catch ( WC_Data_Exception $e ) {
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), $e->getErrorData() );
    		} catch ( WC_REST_Exception $e ) {
    			return new WP_Error( $e->getErrorCode(), $e->getMessage(), array( 'status' => $e->getCode() ) );
    		}
    
    

See this hook used in plugins: