跳到内容

List More Custom Field Names

v1.5

Scott Reilly · 2009年6月30日 上架

Allows for more existing custom field names to be listed in the dropdown selection field when writing a post.

正在使用
70+
评分
5.0 / 5
累计下载
1 万
最近更新
2026年6月13日
4 条评价需要 WordPress 2.6+已测试到 7.0.9PHP 5.5+

贡献者

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’, function ( $limit ) { return 100; } );

Notes:
* The constant, if defined and truthy, takes precedence over the filter.
* If either the constant is defined or the filter is hooked but the value configured or returned is not an integer (or an integer string), then the plugin’s default will be used.
* The limit specified must be equal to or greater than the WordPress default of 30.

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

Plums

按场景查找 WordPress 插件。安装量、评分和兼容版本来自官方目录。

导航

说明

WordPress 是 WordPress Foundation 的商标。本站与 WordPress Foundation、Automattic 没有隶属关系。这里不托管插件文件,下载和安装以 WordPress.org 上的页面为准。

© 2026 Plums