postmeta_form_keys WordPress Filter Hook

The postmeta_form_keys hook is a great way to add custom fields to your WordPress posts. This hook allows you to add new form fields to the post editing screen, which can be used to add extra data to your posts. You can use this hook to add text fields, checkboxes, select boxes, and more. This hook is perfect for adding custom fields to your posts, and can be used to add any type of data to your posts.

apply_filters( 'postmeta_form_keys', array|null $keys, WP_Post $post ) #

Filters values for the meta key dropdown in the Custom Fields meta box.


Description

Returning a non-null value will effectively short-circuit and avoid a potentially expensive query against postmeta.


Top ↑

Parameters

$keys

(array|null)Pre-defined meta keys to be used in place of a postmeta query. Default null.

$post

(WP_Post)The current post object.


Top ↑

Source

File: wp-admin/includes/template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.