The functionality provided by this add-on is now included in Advanced Custom Fields. This plugin will no longer be maintained and it is recommended that everyone discontinue its use.
Mark fields as Required in Advanced Custom Fields. A post can not be published with empty required fields.
This is an add-on for the Advanced Custom Fields WordPress plugin and will not provide any functionality to WordPress unless Advanced Custom Fields is installed and activated.
The required field provides the ability to create fields that must be filled out before a post can be published. Required field is a wrapper for other field types, meaning that you can use this field with any other field in Advanced Custom Fields to make it required. Some complex field types may not function properly if marked as required (required field may think it has content when it really does not).
https://github.com/GCX/acf-required-field
https://github.com/GCX/acf-required-field/issues
The Required Field plugin can be used as WordPress plugin or included in other plugins or themes.
There is no need to call the Advanced Custom Fields register_field()
method for this field.
- WordPress plugin
- Download the plugin and extract it to
/wp-content/plugins/
directory. - Activate the plugin through the
Plugins
menu in WordPress.
- Download the plugin and extract it to
- Added to Theme or Plugin
- Download the plugin and extract it to your theme or plugin directory.
- Include the
required-field.php
file in you theme'sfunctions.php
or plugin file.
include_once( rtrim( dirname( __FILE__ ), '/' ) . '/acf-required-field/required-field.php' );
Make sure you have Advanced Custom Fields installed and activated. This is not a standalone plugin for WordPress, it only adds additional functionality to Advanced Custom Fields.