Skip to content

Testing Custom Fields

This is a test of custom fields. 

  1. Set custom fields on the Edit page
  2. Below demonstrates display of custom fields in text boxes and forms

Additional resources:

Custom Field: using Post Custom Field Wizard in text editor w/ tokens widget Deborah Silver: Split Shed Weaving -------Disadvantage: no granular control of formatting

Custom Field: using a post token a text editor with tokens widget:  Deborah Silver: Split Shed Weaving  -----gives granular control over formatting

Post Custom Field Wizard

Test 1: Post Custom Field Wizard in three HIdden fields, then revealed in LHTML using hidden field values:

Issue: Not sure why the LHTML field shows in editor, but not in frontend.

Issue: 3W1_enrolled when it has a value of zero does not show up.

Test 2: Post Custom Field Wizard in three HIdden fields, then tried update_post_meta to increment enrolled field.

Issue: No luck -update_post_meta maybe won't work in JS, there is some other problem causing it to show value as NaN.

Test 3: Using {-:{post:'3W2_max'} 1} dynamic shortcode in Number field to update the meta.

Issue: Decrement and non-decrement work but the decrement only effects what is shown on the page, doesn't update the custom field value.

Test 4: Post Custom Field in Text Field - works

Using update_post_meta to change value of 3W1_enrolled meta data.To see how it works, comment out with double slash the update_meta_data in the PHP code. Also observe the Custom Fields in the Edit Panel

Issues:
  • It does not appear to update the Custom Field in the Edit panel.
  • It updates all of the values everywhere on the page, so there is no way to see the old value.
  • Not sure if custom fields are for the SESSION or shared across multiple SESSIONS

Test 6: Trying updateSelf as shown on dynamic.ooo help - not sure what this function does or how to use it.

Test 7: Trying implode to see how it works with an array - useful function

PHP JavaScript Python C++ Ruby

PHP, JavaScript, Python, C++, Ruby

PHP-JavaScript-Python-C++-Ruby