ACPT Custom Field Settings Explained

  • ACPT

Field Group Settings Once you have successfully created your first field, you will observe four distinct icons. Let's delve into the functionalities each icon represents. These icons are designed to enhance your user experience by offering quick access to various actions you can perform on your field. Activating the first icon allows the values from…

Field Group Settings

Once you have successfully created your first field, you will observe four distinct icons. Let’s delve into the functionalities each icon represents. These icons are designed to enhance your user experience by offering quick access to various actions you can perform on your field.

Screenshot of a webpage interface showing custom field options with tabs such as Basic Options, Validation Rules, and a field for "Slug." A cursor points to the Validation Rules tab.

Activating the first icon allows the values from custom fields to be displayed within the list of posts on the WordPress backend. When you access the Custom Post Types (CPT), posts, or pages from the WordPress dashboard, a table presents these entries with standard details like the title, author, categories, tags, and date. Although WordPress typically does not show custom field values in this overview, enabling this feature grants you the ability to showcase these values as extra columns in the table.

A WordPress Recipe plugin screen showing a table with recipe titles, publication dates, and durations. A column labeled "Recipe duration" is highlighted.

The second icon grants you the power to filter posts according to the data entered into these fields

The Third icon enables you to incorporate the field into the ‘Quick Edit’ options for your posts. By doing so, you can conveniently adjust the field’s value directly from the main post list. There’s no need to navigate to the full ‘Edit’ page for each individual post.

Screenshot of a recipe editor interface showing an entry for "Salmon Fish" with a recipe duration of 30 minutes highlighted.

Moving on to the fourth icon in our walkthrough, this one plays a crucial role in the integrity of your data input process. When activated, this icon enforces a mandatory status on the field it corresponds to. What this means is that, as you go about populating your fields, this particular field will not permit a save or submission if left blank

Screenshot of a WordPress dashboard showing settings and plugins. A cursor points to an empty field labeled "Recipe Duration" in the Recipe Metabox section.

the red asterisk indicates that the field it accompanies is a required one.

Tab settings

This is where the core management of your fields takes place. Within these tabs, you have the capability to assign a field label, generate a field slug, and select the desired field type for each of your fields, and much more , We will explore each tab, one by one, to ensure you understand.

Basic Options

Screenshot of a WordPress admin panel showing recipe field group settings with options for text, slug, and validation rules. A cursor is hovering over a help icon.
  1. The field label is where you give your field a name that will be displayed within the backend editor. It serves as an identifier, making it easier to recognize.
  2. The Auto Slug which by default is active, it automatically creates a slug a URL version of the field label. However, you can simply deactivate Auto Slug with a click and manually enter a custom slug that fits your needs.
  3. Field Type:  This is where you determine the kind of data your field will handle. Options range from text, to date, to number, among others provided by ACPT. Selecting the correct field type is crucial as it dictates the input and storage of your field’s data.
  4. The Description Field, While it doesn’t appear on the front end, this section is invaluable in the admin panel. It allows you to add detailed instructions or explanations about the field’s purpose.
  5. the default value fills the field with a pre-set value. While this value can be overwritten in the editor, it serves as a starting point or placeholder content for the field, saving time and ensuring consistency where applicable.

Note: Please note that, for the purpose of this tutorial, we’re using a text field as an example. As we can’t go through every possible field option, be aware that settings and options may vary depending on the type of field you are working with

Advanced Option

Screenshot of a software settings page titled "Advanced Options," featuring input fields for customization, text directives, CSS entries, numerical limits, and pattern validation boxes.
  1. Headline Location: This setting controls where the field name will be displayed relative to the custom field. You can opt to have it at the top, which is the default setting, or alternatively position it to the left, right, or choose to not display it at all
  2. Vertical Alignment: This adjusts the vertical position of the field name in relation to the custom field. The default alignment is centered, but you have the option to align it to the top or bottom as per your requirements.
  3. Field Width: Here, you set the width of the custom field. It defaults to 100%, but this can be customized to any percentage you need, as long as you input a numeric value. For instance, entering ’20’ will convert to 20%, and ’50’ will become 50%.
  4. Text Before/After: This field accepts HTML content and will place the specified text directly before or after the field.
  5. CSS Class: Use this function to add custom CSS classes to your field in the backend editor, allowing for personal styling and an override of default styles.
  6. Minimum Value: Set the lowest possible number/text that can be inputted in the field (Used only for numeric or textual field).
  7. Maximum Value: Cap the highest number/text that can be inputted in the field to maintain data integrity (Used only for numeric or textual field).
  8. Step Value: Particularly useful for range fields, this setting lets you dictate the increment values for the input.
  9. Pattern Value: This offers the capability to define a specific pattern for the field, restricting input to certain characters, letters, or numbers only.

Conditional Logic Tab

The Conditional Tab is the place where you can set up rules for your fields based on what is entered in other fields, or in relation to the type of post. This means you can make certain fields show up only when they’re needed, depending on the choices or information that someone enters elsewhere. It’s a useful feature to keep your forms neat and only show the options that are relevant at that time.

If there are no existing conditions, you will notice a message stating, “No conditions are present, click on ‘Add condition’ button to add the first one.” 

Screenshot of a WordPress plugin interface showing options for setting a condition with a highlighted message prompting to add a condition.

Once you’ve clicked the “Add condition” button, you’ll be presented with a dropdown menu filled with options. This list may include values related to the current field, the post, categories, or even other fields within the same meta box. Select the relevant field to which you want to apply a condition

WordPress interface showing a "Recipe Duration" field setup with conditional logic options and a cursor pointing to a dropdown menu.

Following that, you’ll need to choose the logical operator that defines your condition. These operators could be ‘is equal to,’ ‘is not equal to,’ ‘is included in,’ ‘is not included in,’ ‘is empty,’ or ‘is not empty.’

Screenshot of a WordPress plugin interface showing a "recipe-duration" select-field editor. The interface includes options for conditional logic, validation rules, and permissions.

After setting up your condition and logical operator, next the value field is where you’ll specify the value that must be met for the condition to be true.

Example

in this example i’ve created

  1. A text field with the label of text field
  2. A number field with a label of number field
  3. and a select field with a label of select field
Screenshot of a WordPress interface showing settings for a recipe metabox with fields for text, number, and select inputs, along with options for conditional logic and permissions.

In this example, we’ll be demonstrating how to add a conditional rule to our ‘Recipe Duration’ field. To begin, locate the first dropdown menu and select ‘text field’ , this choice will determine which field’s value will be used for the comparison.

Next, define the logic behind the condition. Click on the dropdown menu that lists logical operators and select ‘is equal to.’ This operator will set the foundation for the comparison you are about to make.

The next step is deciding the specific value that your ‘text field’ should match for the rule to apply. In our case, let’s assume we want it to match the word “test” Proceed to the input area labeled with ‘Value’ and type in “test”

With these settings, you’ve instructed the system to display the ‘Recipe Duration’ field only when the ‘text field’ contains the word “test”

Validation Rule Tab

the validation tab is where you are able to set the rules for a certain field, by enforcing consistent and correct entries for your custom field.

Currently, there are no validation rules set, as indicated by the message “No rules created yet. To create a new rule, click on the ‘Add rule’ button.

Screenshot of a recipe field groups editor interface showing sections for text, number, and select fields with options for validation rules and permissions.

After selecting ‘Add rule,’ you’ll have access to a range of validation options for your field. Logical choices may include ‘is equal to,’ ‘is not equal to,’ ‘is greater than,’ among others. Determine the criteria that best suit your field’s requirements.

Screenshot of a form builder interface showing options like text fields, number fields, and validation rules. A dropdown menu displays conditions for field value validation.

Next, input the value for comparison in the designated field. In the final step, you can keep the default error message or customize your own. If you opt for a custom message, remember to insert {{v}} at the position where the expected value should be displayed in case the validation fails. This placeholder will ensure the user sees the specific value that was anticipated.

Example

In this example, we will configure the validation for our phone number field so that it requires a minimum of 12 digits. Should the entered number contain fewer than 12 digits, an error message will be displayed to the user. This step ensures that all data entered meets the necessary criteria for the our phone number field.

Permission Rule

 The Permissions tab main function is to assign read and edit permissions to different user roles. You can set these permissions to determine whether a user can view a field, or edit the content.

Screenshot of a WordPress admin panel showing recipe field groups settings, with options for phone number input and user role permissions.

Step 1: Select the user role you wish to configure from the list of available roles. Your available roles include ‘Administrator’, ‘Editor’, ‘Subscriber’, ‘Author’, and ‘Contributor’, among others.

Step 2: Determine whether the chosen user role should have the ability to ‘read’ or ‘edit’ the field, or both.

Summary

This tutorial covers the essential fields and settings you need to understand when creating custom fields. It is crucial to grasp these concepts when working with custom fields and custom post types. This knowledge will provide you with a deeper understanding of how to configure them and determine the appropriate settings.

ACPT Version :

LogoCreated with Sketch.

Bricks Version :

If you haven't purchased ACPT yet and are planning to, we'd appreciate it if you use our affiliate link. It costs you nothing extra and helps us continue to deliver quality content. if you already have ACPT And this tutorial helped you Buy Me A Coffee