WordPress.org

Ready to get started?Download WordPress

Forums

Custom Metadata Manager
[resolved] Not Working for users in WP 3.3 (4 posts)

  1. FolioVision
    Member
    Posted 2 years ago #

    Hello,

    this is a nice plugin, however it has some issues in latest WordPress versions.

    Using the following simple declaration from plugin examples doesn't work, the column is not added for users:

    x_add_metadata_field('x_userField1', 'user', array(
    	'display_column' => true
    	, 'description' => 'This is a field for a user. Enter information in here!'
    ));

    If I change "user" to "post", it appears for the posts just fine.

    Please get this fixed in next release.

    Thanks,
    Martin

    http://wordpress.org/extend/plugins/custom-metadata/

  2. FolioVision
    Member
    Posted 2 years ago #

    Hello,

    I figured out that I used a wrong tag for this question, so it was not showing up for the plugin: http://wordpress.org/tags/custom-metadata?forum_id=10

    Now it shows up so hopefully it catches your attention.

    Thanks,
    Martin

  3. FolioVision
    Member
    Posted 2 years ago #

    Hello again,

    1. I had a look into the plugin. Here's a quick fix for custom fields not showing up when editing users and in user columns:

    Change this at line 707 or around:

    // This is a hack!
    if( $pagenow == 'profile.php' ) {
    	return 'user';
    }

    To this:

    // This is a hack!
    if( $pagenow == 'profile.php' || $pagenow == 'user-edit.php' || $pagenow == 'users.php' ) {
    	return 'user';
    }

    Looks like the name of the PHP file used for user editing has changed in WP 3.3.

    2. Also the display_callback and display_column_callback is not getting the value of the custom meta field in its 4th argument. I only put in a quick fix in the callback:

    $value = get_user_meta( $object_id, $field_slug, true );

    Thanks,
    Martin

  4. Joey Kudish
    Member
    Plugin Author

    Posted 2 years ago #

    Hi FolioVision,

    Thanks for reporting the issue and for providing a solution! I am going to incorporate your changes as well as a few other WP 3.3 compatibility fixes in an upcoming release probably later this week.

    Thanks again and keep an eye out on the update in a few days!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic