Skip to:
Content

bbPress.org


Ignore:
Timestamp:
06/04/2017 08:53:43 PM (7 years ago)
Author:
johnjamesjacoby
Message:

Inserts: Only prefix meta keys if not already prefixed when inserting forum/topic/reply.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/includes/replies/functions.php

    r6438 r6477  
    6060    // Insert reply meta
    6161    foreach ( $reply_meta as $meta_key => $meta_value ) {
    62         update_post_meta( $reply_id, '_bbp_' . $meta_key, $meta_value );
     62
     63        // Prefix if not prefixed
     64        if ( '_bbp_' !== substr( $meta_key, 0, 5 ) ) {
     65            $meta_key = '_bbp_' . $meta_key;
     66        }
     67
     68        // Update the meta
     69        update_post_meta( $reply_id, $meta_key, $meta_value );
    6370    }
    6471
Note: See TracChangeset for help on using the changeset viewer.