@ Paul
RE: Has there been any development for displaying custom fields on cMap?
The display of a custom text field is covered in this developer doc. The relevant bit is about halfway through covering how to edit the template file.
This method can be utilized in any of the templates, not just cMap.
RE: was wondering if there have been an easier way to display these fields.
Sorry, no, the display has to be added thru code.
RE: I found the include Custom Fields in the display and that works:
That would only work if you deactivate the code which registered the custom field. To ensure you do not lose data, make sure you code is still running.
The “Custom Fields” metabox is not the same as a “custom field” (even though the data is self is saved in the same place in the database. Sorry if that is confusing but the terminology and functionality originate with WordPress itself. Here is an example which may help… Add a new WordPress Page or Post. Scroll to to the bottom, unless you’ve turned it off in the Screen Options you will find a Custom Fields metabox. This is the same feature in which Connections mimics with its “Custom Fields” metabox. One the WordPress add new page/post you will like find all sorts of other “custom fields” added by other plugins and/or the theme which control and/or change the displayed content for the page or post. It is these “custom fields” which you are adding when you register a custom field in Connections. If you were to disable the theme or plugin which has registered their “custom fields”, the data would display in the “Custom Fields” metabox so the data is not lost on page/post edits. Connections mimics this too.
I hope that help clarify and not causes further confusion!!!
RE: Why doesn’t the standard title show up?
When you register a custom text field? If yes, the title option is the title of the custom field metabox in the admin. If you want a label on the template you add it to the code. eg.
$text = $entry->getMeta(
array(
'key' => 'field_id', // This should match exactly the field id used when registering the custom field.
'single' => TRUE // Do not change this.
)
);
if ( ! empty( $text ) ) echo '<p>LABEL: ' . esc_html( $text ) . '</p>';
Notice I added LABEL to the <p> tag.
RE: can I rename Custom fields to Others?
I’m sorry, but I am not sure what you are asking. Could you give more details?
