WordPress.org

Forums

Trouble with Custom Fields in 2.0 (22 posts)

  1. wblogan
    Member
    Posted 9 years ago #

    Just upgraded to 2.0. (Nice!) I went to add some custom fields to my post and the keys "_encloseme" and "_pingme" appeared without my permission. I attempted to edit the custom fields and they do not appear in the edit area. I deleted the post and started over. The unwanted fields are still there and I can't get rid of them.

  2. wblogan
    Member
    Posted 9 years ago #

    By-the-way, I was using custom fields successfully under 1.5 with the Letterhead theme. I tried the default and several other themes and the problem exists regardless of the theme.

  3. wblogan
    Member
    Posted 9 years ago #

    My son created a temporary fix by adding a few lines to the wp-includes/template-functions-post.php file which supresses the printing of the "_encloseme" and "_pingme" custom field entries in the post.

  4. ozskry
    Member
    Posted 9 years ago #

    I have exactly the same problem here. How did you fix the problem?

  5. thesi
    Member
    Posted 9 years ago #

    Sigh, exactly the same here, is there a solution for it yet? What did your son change, wblogan?

  6. cnc137
    Member
    Posted 9 years ago #

    I notice this same problem in my WordPress 2.0 database too. I noticed that some of my custom fields also won't stay for some reason. They display in the database, but in the drop-down menu they don't exist. I am using the "rc:custom_field_gui" ( http://rhymedcode.net/projects/custom-field-gui ) plugin, so maybe that is the problem, but it seems to be working for most of my custom fields except for one here or there that gets entered into the database, but doesn't display in the normal custom field drop-down list at the bottom. I was researching this bug when I saw all the "_encloseme" and "_pingme" entries in the database.

    Any solution yet? How do we report this as a bug?

    cnc137.

  7. moshu
    Member
    Posted 9 years ago #

    Bugs should be reported here: http://trac.wordpress.org/
    Try searching before posting a bug, maybe it has already been reported.

  8. cnc137
    Member
    Posted 9 years ago #

    I submitted this to the http://trac.wordpress.org site after searching on the site and not finding anything related to this.

    The support ticket can be viewed here for everyone's reference:

    - http://trac.wordpress.org/ticket/2316

    I hope this helps bring the problem to someone's attention that knows more than us and can fix the problem for all of us.

    cnc137.

  9. cow6oy
    Member
    Posted 9 years ago #

    I have a similar problem: custom fields do show up with "the_meta" on the blog. But I can't see them in the admin area. I can add new fields and values, but existing ones just don't show up in the list. This makes it impossible to edit or delete them.

  10. Huck
    Member
    Posted 9 years ago #

    FWIW, if I click the "edit" link on a problematic post (at least when logged in as admin), it fixes the problem without me making any other changes.

    I don't even have to save after clicking edit. Simply going to the "edit post" screen does the trick.

  11. thesi
    Member
    Posted 9 years ago #

    I updated to 2.0.1 and it seems to be fixed now.

  12. logista
    Member
    Posted 9 years ago #

    I'm using 2.0.1 on a brand new blog with a brand new install, and I get the _encloseme field on my page. I also see the _encloseme and _wp_page_template in the drop-down list on the edit page.

    I don't use any custom field plugins, though I do use Ultimate Tag Warrior (if that's any help to know).

    It's not a show-stopper, as I have my post-meta hidden to all but the highest-level users, but it's kind of annoying to see it there ;)

  13. wblogan
    Member
    Posted 9 years ago #

    I have just upgraded to 2.0.2 and found the same problem with which I began this thread. I can't tell what if any progress has been made to address the problem, but I modified the wp-includes/template-functions-post.php as I did in 2.0 and it works to suppress the printing of the unwanted data. I don't understand what's causing the problem, and don't think this is a permanent solution. But it works for now.

    To the wp-includes/template-functions-post.php file add the following line after line 260 (so that it is line 261):

    if($key != "_pingme" and $key != "_encloseme") {

    Then after line 264 add a line with a closing curly brace ("}") (so that it is line 265).

    This will suppress printing of "_pingme" and "_encloseme" in posts with custom field entries.

  14. seluna
    Member
    Posted 9 years ago #

    I have the same problem on two seperate blogs and it's driving me nuts editting them out of my db.

    wblogan, thanks for the temporary fix. I wish it's permanent though, because my postmeta table sure is getting crowded.

  15. Morgaine
    Member
    Posted 9 years ago #

    I can report I have the same problem. "_pingme" isn't in the drop down menu for custom fields though. I do have "_wp_page_template" there, which I suppose shouldn't be visible either. I use version 2.0.2, with a couple of plugins that didn't cause any trouble before, and where indicated as compatible.

    It is annoying to me even though some told me the "_encloseme: 1, 1" showing on my blog, looks kind of geeky.

  16. Dgold
    Member
    Posted 9 years ago #

    I have the same problem, that everyone said above, in my WP 2.0.3. The line _encloseme: 1 is printing where I print my custom fields. The related plugins I use are Custom Fields GUI, and GetCustomFields. I never saw _encloseme: 1 in WP 1.5.

    Has a solution been found?

    Can the author of the "WordPress 2.0.3 Tune-up Plugin" please include this fix?

  17. syncbox
    Member
    Posted 9 years ago #

    I've noticed that I don't see those odd custom fields (_encloseme, _wp_pagetemplate, etc) until I add a new custom field or type what I believe to be the existing field into the middle textfield.... then those others show up in the menu after clicking add new field.

    Is there no way to hard-code the available meta field keys into the menu? It sucks to have to write a complete manual for someone because the WP one either doesn't explain "yeah, but, it's broken and buggy, so you may not see the right meta key listed... so here's a list of existing keys and you can just type them in, but get them correct or else they won't display in your page..."

    I'd like to just hard code in the list of keys to display in the Write/Edit post form.

    Anyone know how?

  18. kex
    Member
    Posted 9 years ago #

    I run in the same problem - but i found out how can fix it :-)

    First, you need in your wp-admin.css a definition for the class hidden. Like this:

    .hidden {
    display: none;
    }

    This will hide all rows with the class hidden.

    To hide the _enclose and _pingme entries in the selectbox for the customfields, you must edit the file /wp-admin/admin-functions.php.

    Go to line 878. Near this line you must found
    foreach ($keys as $key) {
    echo "\n\t<option value='$key'>$key</option>";
    }

    Replace this with the following code:
    foreach ($keys as $key) {
    if ((0 !== strpos(trim($key), '_')) {
    echo "\n\t<option value='$key'>$key</option>";
    }
    }

    Ok, thats all

  19. anonymousse
    Member
    Posted 9 years ago #

    I'm afraid Kex's solution doesn't work for me - I've tried it a dozen times and it just gives me: "parse error, unexpected {, line 878"

  20. marysorens
    Member
    Posted 8 years ago #

    i have been having this problem ever since i upgraded to 2.0.4. i see that there is a ticket but no fix? this is what happens to me:

    i write a post (not using custom fields), publish the post, and then encloseme1 and pingme1 appear underneath my public post. it is UGLY! i have learned to work around it by going into the post and choosing pingme_1 as a custom field, leaving the text in it blank, and publishing the post again.

    what is interesting is that when i initially write a post, encloseme and pingme are not options in the custom fields drop-down list. after the post is written and the fields appear on the published post, when i go back in to edit it, pingme and encloseme are part of the custom field drop-down menu.

    so i came around here and have implemented wblogan's fix. it works just fine. thank you!!!

  21. jennifleac
    Member
    Posted 8 years ago #

    Hi everyone,

    First, I just recently also came across this problem. I found kex's solution worked best for me, though I implemented it differently. I am using 2.0.5.

    Here's my fix:

    1. open /wp-admin/admin-functions.php
    2. in that file search for the phrase "$keys as $key"
    that should bring you to code that looks like:

    foreach ($keys as $key) {
    $key = wp_specialchars($key, 1);
    echo "nt<option value='$key'>$key</option>";

    }

    3. Replace the code above with this code:


    foreach ($keys as $key) {
    $key = wp_specialchars($key, 1);
    if (substr($key, 0,1) != '_' ) {
    echo "nt<option value='$key'>$key</option>";
    }
    }

    If the first character of the custom field isn't an underscore, it gets displayed, otherwise it doesn't.

    Second, if you'd like to display all your custom fields at one time, rather than the most recent 10, do the following

    1. Open up that same file as in step one above
    2. Find this code

    $keys = $wpdb->get_col("
    SELECT meta_key
    FROM $wpdb->postmeta
    GROUP BY meta_key
    ORDER BY meta_id DESC
    LIMIT 10");

    3. Replace the number 10 with a number that accomodates your additional fields. It's probably a good idea to go with your custom fields rounded up a little rather than something arbitrarily large since this is hitting your database.

    That's all...hope that helped someone!

    Jen

  22. waydomatic
    Member
    Posted 8 years ago #

    Thanks Jen - completely fixed both bugs I was experiencing :)

Topic Closed

This topic has been closed to new replies.

About this Topic