array( 'WC_Comments', 'exclude_order_comments' ), 10, 1 );
return array_filter( array_map( 'wc_get_order_note', $notes ) );
}
/**
* Create an order note.
*
* @since 3.2.0
* @param int $order_id Order ID.
* @param string $note Note to add.
* @param bool $is_customer_note If is a costumer note.
* @param bool $added_by_user If note is create by an user.
* @return int|WP_Error Integer when created or WP_Error when found an error.
*/
function wc_create_order_note( $order_id, $note, $is_customer_note = false, $added_by_user = false ) {
$order = wc_get_order( $order_id );
if ( ! $order ) {
return new WP_Error( 'invalid_order_id', __( 'Invalid order ID.', 'woocommerce' ), array( 'status' => 400 ) );
}
return $order->add_order_note( $note, (int) $is_customer_note, $added_by_user );
}
/**
* Delete an order note.
*
* @since 3.2.0
* @param int $note_id Order note.
* @return bool True on success, false on failure.
*/
function wc_delete_order_note( $note_id ) {
return wp_delete_comment( $note_id, true );
}
Fatal error: Uncaught Error: Call to undefined function wc_register_order_type() in /var/www/html/acompinformatica.com.br/web/wp-content/plugins/woocommerce/includes/class-wc-post-types.php:387
Stack trace:
#0 /var/www/html/acompinformatica.com.br/web/wp-includes/class-wp-hook.php(324): WC_Post_Types::register_post_types('')
#1 /var/www/html/acompinformatica.com.br/web/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#2 /var/www/html/acompinformatica.com.br/web/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#3 /var/www/html/acompinformatica.com.br/web/wp-settings.php(643): do_action('init')
#4 /var/www/html/acompinformatica.com.br/web/wp-config.php(131): require_once('/var/www/html/a...')
#5 /var/www/html/acompinformatica.com.br/web/wp-load.php(50): require_once('/var/www/html/a...')
#6 /var/www/html/acompinformatica.com.br/web/wp-blog-header.php(13): require_once('/var/www/html/a...')
#7 /var/www/html/acompinformatica.com.br/web/index.php(17): require('/var/www/html/a...')
#8 {main}
throw in /var/www/html/acompinformatica.com.br/web/wp-content/plugins/woocommerce/includes/class-wc-post-types.php on line 387