There’s a limit of 30 set in wp-admin/includes/template.php, however there is a filter hook postmeta_form_limit available if you wish to change it..
Here’s an example:
add_filter( 'postmeta_form_limit' , 'customfield_limit_increase' );
function customfield_limit_increase( $limit ) {
$limit = 100;
return $limit;
}
Hope that helps..
Cool π
Thanks for the info…
Thanks, t310os_ !!!
This was the reason also in my case.
Bye the way where do I need to add the filter?? I understand these filters can be inserted in plugins. As I’m not working on a plugin, I applied the change directly to template.php file.
In your theme’s functions.php file would have been fine, or alternatively in a plugin like so..
<?php
/*
Plugin Name: Increase Custom Field Limit
*/
add_filter( 'postmeta_form_limit' , 'customfield_limit_increase' );
function customfield_limit_increase( $limit ) {
$limit = 100;
return $limit;
}
I placed this function in my functions.php file but nothing happens… what am I doing wrong?
Assuming you placed the code into wp-content/themes/*yourtheme*/functions.php you didn’t do anything wrong…
..where *yourtheme* will be your theme name…
That’s really weird. I have several custom fields, and none of them are affected.
Are you sure you can see the change, and that you understand what this code does. To clarify, the above code increases the amount of custom fields shown in the dropdown when choosing a custom field in the editor, it’s usually hard-coded to display 40 maximum (if memory serves).
You will not see any difference unless you have lots of custom fields (well more then the current limit)..
If you’re looking for something else, please start a new thread describing what you wish to do (rather then taking this thread off-topic, it’s also resolved already).
my apologies. I misunderstood the code. thanks for clarifying!