WordPress.org

Ready to get started?Download WordPress

Forums

Custom Metadata Manager
[resolved] Custom meta fields not appearing (3 posts)

  1. thomhines
    Member
    Posted 3 years ago #

    I've been working with this plugin for several hours now, and it just doesn't seem to be doing anything. It could be that it's not compatible with the latest version of WP, but that seems unlikely since it was released so recently. I've installed and activated the plugin, and I know it's running. Then I've dropped the example code in my functions.php file

    <?php x_add_metadata_field( 'field-1', 'post' ); ?>

    and I know that file is loading correctly, but the fields are not showing up in my add post page.

    When trying to debug the plugin, I've noticed that it tends to hang up when verifying whether or not my objects (I've tried 'post' and 'page') are registered. If I try to bypass that test, I get errors with the array_key_exists function.

    Any help would be greatly appreciated! Thanks!

  2. Jan Fabry
    Member
    Posted 3 years ago #

    I think there is a small omission in the plugin that causes it not to load when you create a new post, only when you edit an existing one.

    If that is the case for you, you can fix it by adding the post-new.php value to the $_pages_whitelist array, as explained in my other forum post.

  3. thomhines
    Member
    Posted 3 years ago #

    Thanks, Jan.

    Actually, the trouble was that I wasn't including the admin_init hook stuff, which I thought was optional. Without including it, though, the metadata array was being filled BEFORE the init() function was called, which clears the array. That is all fixed now, though.

    Nevertheless, I'm really glad you you shared that tip with me. I definitely want the option on the post-new.php pages, so your fix really did save me a lot of time and hassle. Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic