• Resolved mgmtcircle

    (@mgmtcircle)


    Hello,
    I tried to find an aswer in the forum before asking this, but I did not find one so please excuse my question.
    I have the weird problem, that in the field mapper not all of my custom fields for a custom post type show up.
    Some do like they should, but others I created new, don’t.
    The custom field in question is filled with content for every post of the content type.
    It just does not show up in the drop down for the field mapping for some reason.
    The content is an alpha-numerical string.
    Do I do somethign wrong?
    Best regards
    Oliver

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jonathan Stegall

    (@jonathanstegall)

    Hi Oliver,

    When it comes to custom fields, there are a few things to consider:

    1. Are you using a plugin to add the fields to the post type? What plugin, if so? There are many methods to add fields in WordPress, and this plugin supports the standard methods, which many plugins use, but if you’re using a non-standard method you may have to write a plugin and use the developer hooks for your additional fields.
    2. Do the fields have at least one value in the database? By that I mean, let’s say you have a field called “test_field” on the user object. If there are no users with a value for “test_field” it won’t appear in the database, and so it won’t appear in the field map dropdown. But if there’s at least one user that has a value, it will show up (after clearing the plugin cache if applicable).

    Hope that helps.

    Thread Starter mgmtcircle

    (@mgmtcircle)

    Hi Jonathan,
    I have added the fields via the WordPress standard method: in the back end I created a new custom field called internalid and added a value.
    I did not use a plugin for that.
    It is a custom post type I created wit CPT PlugIn.
    Each post of this type has this custom field created and a value added. So not a single posz exists where this custom field is empty.

    In your plugin my custom post type is selectable in the drop down but the custom field “internalid” ist not displayed when I try to setup a fieldmapping.

    I can get the values of my custom field via get_post_meta().

    Best regards
    Oliver

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    @mgmtcircle okay, here’s what I did to try to reproduce:

    1. Download the CPT UI plugin and create a new post type. I made sure it supports Custom Fields.
    2. Create a new post for that type. It has an ID of 414. I saved it as a Draft.
    3. In my functions.php, I created a new custom field like this: add_post_meta( 414, 'internalid', 'test', false );. I published the post after this.
    4. Go to the Salesforce plugin settings and clear the cache.
    5. Create a fieldmap for my new custom object.

    At this point, I see internalid in the dropdown. It’s close to the end of the list of choices.

    Thread Starter mgmtcircle

    (@mgmtcircle)

    Wow, the “Clear the Cache” function did the job. I did not find it at first as I was not aware it is there. The Link is so tiny.
    This helped! Thanks a lot for the quick support.

    Best reagrds
    Oliver

    Plugin Author Jonathan Stegall

    (@jonathanstegall)

    Glad to hear it worked. I’ll mark this as resolved, for now.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘My Custom Fields don’t show up’ is closed to new replies.