WordPress.org

Ready to get started?Download WordPress

Forums

User Meta Manager
[resolved] Usermeta values with apostrophe returned with backslash (7 posts)

  1. festsoft
    Member
    Posted 1 year ago #

    A custom user meta field value like O'Reilly is stored in wp_usermeta as O\'Reilly [1] and displayed as O\'Reilly [2] in the User Meta Manager table and when I access it with get_user_meta(). This does not happen with the wp-user field values, which are O'Reilly in the database and when accessed. Is there a known work-round for this please?

    Note [1] and [2] in case this post does not display as intended the value I am reporting is: O[backslash][apostrophe]Reilly

    http://wordpress.org/plugins/user-meta-manager/

  2. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    Use PHP function stripslashes($string).

    Example:

    $string = get_user_meta($user_id, 'my_custom_meta', true);
    echo stripslashes($string);
  3. festsoft
    Member
    Posted 1 year ago #

    Yes, I know about stripslashes, but it is complicated for me to edit UMM to apply that fix to the User Meta Manager table. And I do not have to use stripslashes when accessing wp-user values. So is this a bug in UMM?

  4. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    Sorry, I misunderstood the question.

    Yes, it could be a bug. I will have a look.

  5. President McCheese
    Member
    Plugin Author

    Posted 1 year ago #

    This is fixed in version 3.1.1. Thanks!

  6. festsoft
    Member
    Posted 1 year ago #

    Thanks, it is partially fixed. Slashes are removed from the table, but it would be good to remove them from the database insertion code. A UMM custom meta-data field in wp_usermeta table is eg O\'Reilly whereas in the same table the WP 'last_name' field is correctly O'Reilly.

  7. festsoft
    Member
    Posted 1 year ago #

    PS: Sorry if confusing - slashes are removed from the displayed table but not from the MySQL database table wp_usermeta.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic