You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi ,
I don't know if im doing something wrong, but I edit and installed the pluggin twice, in the same wordpress installation.
I did all the steps in the Documentation, Installing carbon field with composer in both of them.
both have a custom posttype with custom fields created with carbon fields.
but the fields in the second plugin are saved with a wrong prefix . Both custom posts, from two different plugins, get the same prefix for theirs metas.
if I deactivate the first plugin, the other plugin gets fixed, and its custom fields are saved right.
Thanks!
The text was updated successfully, but these errors were encountered:
I have verified and you are correct. This is, indeed, a bug that surfaced at some point. I will have to look into it (it is located in one of my dependencies, not this code).
In the mean time, you can fix it by adding the following function to your app/Plugin.php files:
/** * Append a field prefix as defined in $config * * @param string $field_name The string/field to prefix * @param string $before String to add before the prefix * @param string $after String to add after the prefix * @return string Prefixed string/field value */publicstaticfunctionprefix( $field_name = null, $before = '', $after = '_' ) {
$prefix = $before . self::$config->get( 'prefix' ) . $after;
return$field_name !== null ? $prefix . $field_name : $prefix;
}
Thank you for the report! This is a major bug that needs to be fixed properly.
Hi ,
I don't know if im doing something wrong, but I edit and installed the pluggin twice, in the same wordpress installation.
I did all the steps in the Documentation, Installing carbon field with composer in both of them.
both have a custom posttype with custom fields created with carbon fields.
but the fields in the second plugin are saved with a wrong prefix . Both custom posts, from two different plugins, get the same prefix for theirs metas.
if I deactivate the first plugin, the other plugin gets fixed, and its custom fields are saved right.
Thanks!
The text was updated successfully, but these errors were encountered: