<?php
define( 'CCF_PATH', plugin_dir_path( __FILE__ ) );
define( 'CCF_URL', plugin_dir_url( __FILE__ ) );
define( 'CCF_VER', '2.1.2' );
define( 'CCF_CORE', __FILE__ );
add_action( 'init', 'cf_custom_fields_init' );
function cf_custom_fields_init() {
include_once( CCF_PATH . '/includes/metabox.php' );
include_once( CCF_PATH . '/includes/to-post-type.php' );
}
function cf_custom_fields_get_forms() {
if ( class_exists( 'Caldera_Forms_Forms' ) ) {
$forms = Caldera_Forms_Forms::get_forms( true );
} else {
$forms = Caldera_Forms::get_forms();
}
return $forms;
}
function cf_custom_fields_get_form( $id_name ) {
if ( class_exists( 'Caldera_Forms_Forms' ) ) {
$form = Caldera_Forms_Forms::get_form( $id_name );
} else {
$form = Caldera_Forms::get_form( $id_name );
}
if( isset( $form[ 'ID' ] ) && ! isset( $form[ 'id' ] ) ) {
$form[ 'id' ] = $form[ 'ID' ];
}
return $form;
}