Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#44659 new feature request

Display custom fields

Reported by: iantresman's profile iantresman Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Options, Meta APIs Keywords:
Focuses: Cc:

Description

There should be an option to display custom field data without having to acquire a plugin, rely on a theme supporting it, or hack a theme; surely this can be achieved in core, programmatically. Options could/should include (in order of importance):

Global Admin settings to:

  1. Enable/disable the display of raw custom field data in a post
  2. Option to rewrite outputted field data (add wrapper) that may include HTML
  3. Specify where in a post, the field is output, depending of available hooks
  4. Specify optional regex validation
  5. Specify optional data regex replacement on output
  6. Specify which options above, are returned via the API to other plugins
  7. Specify optional CSS for any classes and IDs added in (2) above.
  8. Specify whether a custom field should be a requirement/optional
  9. Specify where the custom field box should appear on the post edit page
  10. Option to rewrite outputted field data using PHP snippet

Even implementing only items 1-3 would provide a powerful and flexible way to manage meta data, and provide WP v5 with a significant improvement over earlier versions.

Change History (6)

#1 @SergeyBiryukov
6 years ago

  • Component changed from General to Options, Meta APIs

#2 @swissspidy
6 years ago

Hey there

This sounds exactly like the Fields API project to me :-)

See https://make.wordpress.org/core/tag/fields-api/ and https://github.com/sc0ttkclark/wordpress-fields-api, as well as the #core-fields Slack channel.

#3 @iantresman
6 years ago

@swissspidy As long as the fields API includes a UI for end-users.

#4 @swissspidy
6 years ago

A UI sounds like plugin territorry to me as it wouldn‘t really align with the WordPress philosophy: https://wordpress.org/about/philosophy/

#5 @iantresman
6 years ago

It depends which part of the Wordpress Philosophy you read. I think the following extracts are relevant:

Great software should work with little configuration and setup
Design for the Majority: Many end users of WordPress are non-technically minded.

I think most people don't use custom fields, because while they are trivial to enter the data, it is difficult to display it. I think this suggestion, with the ability to rewrite custom field data make it very useful, flexible and powerful.

#6 @pento
6 years ago

  • Version trunk deleted
Note: See TracTickets for help on using tickets.