• wp_set_object_terms() works by calling wp_get_object_terms($object_id, $taxonomy, array(‘fields’ => ‘tt_ids’, ‘orderby’ => ‘none’)), comparing to the given terms, and then deleting any that have been removed. It assumes that the call to wp_get_object_terms($object_id, $taxonomy, array(‘fields’ => ‘tt_ids’, ‘orderby’ => ‘none’) will return an array of IDs, which it does by default.

    Role Scoper adds a get_terms filter to flt_get_tags in hardway/hardway-front_rs.php which turns this array of IDs into an array of objects, breaking wp_set_object_terms().

    I have worked around this by adding tt_ids to the line:
    if ( ( ‘ids’ == $fields ) || ! $hide_empty )
    but I don’t think this is necessarily complete. e.g. looking at the “Standard WP post-processing” section of terms-interceptor_rs.php and comparing against wp-includes/class-wp-term-query.php shows a number of things missing, including tt_ids but others too.

  • The topic ‘Role scoper breaks e.g. wp_set_object_terms’ is closed to new replies.