Skip to content

save_term_fields() does not check the term ID, can result in data corruption #831

@johnbillion

Description

@johnbillion

The save_fields_for_post() method in the post context has a guard condition where it checks the post ID before saving data to it. This is for the situation where another post gets updated when a post is saved and prevents meta data being saved to another post. Ref:

// Make sure this hook fired on the post being saved, not a side-effect post for which the $_POST context is invalid.

This was introduced in #147.

There is no such protection for terms. If a term gets saved and some code updates another term, Fieldmanager will write its term meta to that term too. Ref:

public function save_term_fields( $term_id, $tt_id, $taxonomy ) {

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