Overview, documentation and examples of usage.
This is very useful plugin for those who want manage multiple complex meta fields easily. Imagine you have Companies post type and you need to assign multiple Employees to these Companies somehow without creating new post type for them. Employees can contain different fields as well.
After you setup all your custom fields for existing post types on a Settings page you will be able to add as many custom fields to the post as you need by clicking "Add New" button.
There are some handy functions that help getting access to custom fields on front-end the way similar to standard post loop. See "Functions" below.
Check out "Hooks" section to find some useful things for developers that work with plugin more closer.
List of available functions from built-in API of the plugin.
cmf_have_meta( $fieldset_slug )
An alias of have_posts()
function. Need to use inside have_posts()
loop. Returns true if there are FieldSets left which you can interact with. Accepts one agrument that is FieldSet Slug which you can find when creating new FieldSet.
cmf_the_meta( $fieldset_slug )
An alias of the_post()
function. Need to use inside cmf_have_meta()
loop. Sets current FieldSet. Accepts one agrument that is FieldSet Slug which you can find when creating new FieldSet.
cmf_the_field( $field_slug )
Function that actually prints field's value. Accepts one agrument that is Field Slug which you can find when creating new Field in some of the FieldSets.
Notice! The value for field of type checkbox will be Array, so there is no need to use this function for this kind of type. Use cmf_get_field( $field_slug )
instead.
cmf_get_field( $field_slug )
Function does the same as function above but returns value instead of printing. You are free to get the value of the field and do any manipulations with it before using. Accepts one agrument that is Field Slug which you can find when creating new Field in some of the FieldSets.
cmf_the_image( $field_slug, $size = 'full' )
Function similar to cmf_the_field
but is useful for fields of Image type. It prints image tag with the image of selected size inserted.
cmf_get_image( $field_slug, $size = 'full' )
Returns image tag with image of selected size inserted.
cmf_get_image_src( $slug, $size = 'full' )
Returns the source of the image of selected size with dimensions.
WordPress hooks available list.
wp_cmf_after_save_post
wp_cmf_settings_form_start
wp_cmf_help_before_menu
wp_cmf_help_menu
wp_cmf_help_after_menu
wp_cmf_help_after_sections
wp_cmf_settings_form_end
wp_cmf_metabox_before_content
wp_cmf_metabox_after_content
wp_cmf_plugin_locale
wp_cmf_meta_field_prepare
wp_cmf_js_l10n
wp_cmf_have_meta_prepare
wp_cmf_get_field
wp_cmf_get_image_tag
wp_cmf_get_image_src
wp_cmf_ajax_get_fieldsets
wp_cmf_ajax_get_attachment_thumbnail
wp_cmf_ajax_metabox_get_fieldsets