This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.
postmeta_form_limit filter
Filters the number of custom fields to retrieve for the drop-down in the Custom Fields meta box.
apply_filters( 'postmeta_form_limit', int $limit )
Description
This is filter hook , its filter the number of custom fields to retrieve for the drop-down in the Custom Fields meta box.
Its consists of one parameter, that is $limit Object.
Parameters
- $limit : (int) Number of custom fields to retrieve. Default 30.
Live Example
To run the hook, copy the example below.
$int = apply_filters( 'postmeta_form_limit', $int ); if ( !empty( $int ) ) { // everything has led up to this point... }
// define the postmeta_form_limit callback
function filter_postmeta_form_limit( $int ) { // make filter magic happen here... return $int; }; // add the filter add_filter( 'postmeta_form_limit', 'filter_postmeta_form_limit', 10, 1 );
To remove a hook callback, use the example below.
// remove the filter remove_filter( 'postmeta_form_limit', 'filter_postmeta_form_limit', 10, 1 );
Explore the latest in WordPress
Trying to stay on top of it all? Get the best tools, resources and inspiration sent to your inbox every Wednesday.