How to activate “custom fields” section in WP3

This is probably a stupid question, but I am setting up a finnish WordPress installation. The “custom fields” section in the “write post” section is gone; I gather it is hidden by default.

That is a great step, but my finnish is a bit rusty, it’s my first WP install, and I can’t for the life of me find the switch to turn it on.

Read More

Where do I do this?

Edit: Martin shows a way to do this on a per-post basis, thanks for that. In my case, it would be useful to always show custom fields, so extra brownie points for anybody who can give me a hint on how to do that. I can’t find any documentation on this.

Related posts

Leave a Reply

2 comments

  1. Per default some meta boxes are hidden. These boxes are stored in an array which you can find in wp-admin/includes/template.php#get_hidden_meta_boxes(). There is a filter, and therefore a chance for a plugin:

    <?php # -*- coding: utf-8 -*-
    /*
    Plugin Name: Enable Custom Fields per Default
    Version:     1.0
    Required:    3.1
    Author:      Thomas Scholz
    Author URI:  http://toscho.de
    License:     GPL
    */
    ! defined( 'ABSPATH' ) and exit;
    add_filter( 'default_hidden_meta_boxes', 'enable_custom_fields_per_default', 20, 1 );
    
    /**
     * Removes custom fields from the default hidden elements.
     *
     * The original ( wp-admin/includes/template.php#get_hidden_meta_boxes() ):
     * array(
     *      'slugdiv',
     *      'trackbacksdiv',
     *      'postcustom',      <-- we need this
     *      'postexcerpt',
     *      'commentstatusdiv',
     *      'commentsdiv',
     *      'authordiv',
     *      'revisionsdiv'
     * )
     *
     * It has no effect if the user has decided to hide the box.
     * This option is saved in "metaboxhidden_{$screen->id}"
     *
     * @param  array $hidden
     * @return array $hidden
     */
    function enable_custom_fields_per_default( $hidden )
    {
        foreach ( $hidden as $i => $metabox )
        {
            if ( 'postcustom' == $metabox )
            {
                unset ( $hidden[$i] );
            }
        }
        return $hidden;
    }
    

    As you can see, it is quite simple to enable more fields.