Categories

List More Custom Field Names

Author: Scott Reilly
Version: 1.3.7
First released: 2009-06-30
Last update: 2021-04-10
Compatibility: WP 2.6 – 5.7.2
Download: [ zip ]
Description:

Allows for more existing custom field names to be listed in the dropdown selection field…

Extended Description

By default, WordPress only allows 30 custom field names/keys to be listed in the dropdown selection ‘Name’ field when writing a post or page. If you, or the plugins you use, make use of a lot of custom field key names, you may surpass the default limit resulting in some custom field keys not being listed. This may force post authors to manually type in custom field key names if they aren’t listed, which increases the chances for naming errors (typos, or not using the precise key name that is needed). This may also cause some authors concern wondering where previously used custom field keys have gone since they aren’t listed.

This plugin increases the limit to 200 custom field key names.

There is no settings page to customize the default value. If you’d like to list some number of custom field key names other than 200 (say, for example, 100), you can do so in either of two ways:

  1. By editing your wp-config.php file and at the end adding a line such as:
    define( ‘CUSTOM_FIELD_NAMES_LIMIT’, 100 );
    -or-
  2. Somewhere — ideally in a mu-plugin or site-specific plugin, or less ideally your active theme’s functions.php file — hook the ‘c2c_list_more_custom_field_names’ filter and return the number you’d like to use:
    add_filter( ‘c2c_list_more_custom_field_names’, create_function( ‘$limit’, ‘return 100;’ ) );

Note: This plugin has no effect for users who make use of the block editor (aka Gutenberg) introduced in WordPress v5.0 because that editor does not directly expose custom fields in the interface.

Links: Plugin Homepage | Plugin Directory Page | GitHub | Author Homepage

Find out more at the plugin’s WordPress Plugin Repository page.

Installation

  1. Install via the built-in WordPress plugin installer. Or download and unzip list-more-custom-field-names.zip inside the plugins directory for your site (typically wp-content/plugins/)
  2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
  3. (Optional) In wp-config.php, customize the number of custom fields you want shown. The default of 200 can be changed by adding a line like:
    define( ‘CUSTOM_FIELD_NAMES_LIMIT’, 100 );

Release Log

1.3.7 (2021-04-10)

  • Change: Note compatibility through WP 5.7+
  • Change: Update copyright date (2021)

1.3.6 (2020-08-21)

  • New: Add TODO.md for newly added potential TODO item
  • Change: Restructure unit test file structure
    • New: Create new subdirectory phpunit/ to house all files related to unit testing
    • Change: Move bin/ to phpunit/bin/
    • Change: Move tests/bootstrap.php to phpunit/
    • Change: Move tests/ to phpunit/tests/
    • Change: Rename phpunit.xml to phpunit.xml.dist per best practices
  • Change: Note compatibility through WP 5.5+
  • Unit tests:
    • New: Add unit test to verify filter return value is cast as integer
    • Change: Remove unnecessary unregistering of hooks, and thusly delete tearDown()

1.3.5 (2020-05-02)

  • Change: Use HTTPS for link to WP SVN repository in bin script for configuring unit tests
  • Change: Note compatibility through WP 5.4+
  • Change: Update links to coffee2code.com to be HTTPS

Copyright & Disclaimer

Copyright © 2009-2021 by Scott Reilly (aka coffee2code)

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Discussion / Support

Have any questions, comments, or suggestions? Please provide them via the plugin’s WordPress.org support forum. I’ll do my best to reply in a timely fashion and help as best I can.

Unfortunately, I cannot provide guaranteed support, nor do I provide support via any other means.

Was this plugin useful useful to you? Consider giving it a rating. If you’re inclined to give it a poor rating, please first post to the support forum to give me a chance to address or explain the situation.