Skip to content

Documentation for product properties incomplete #30

@ad-on-is

Description

@ad-on-is

In the file class-wc-api-products.php there's this code at line 330

// Product name (slug).
if ( isset( $data['name'] ) ) {
    wp_update_post( array( 'ID' => $id, 'post_name' => sanitize_title( $data['name'] ) ) );
}

It's nowhere in the official documentation that 'name' is a property for a product and that it can be used to set the post_name, that's responsible for the product's url.

IMHO it's definitely worth mentioning in the docs, since modifying the post_name is an urgent feature, and I accidentally found it in the code.

btw. maybe it should also be implemented in the product create function

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions