add(
'cf',
$this->__( 'MailPoet Custom field' ),
array( $this, 'mailpoetsignup_cf' )
);
} //End of admin_init
/**
* Get Mailpoet Custom fields
*/
public function mailpoetsignup_cf() {
$fields = CustomField::findMany();
$results = array();
foreach ( $fields as $field ) {
$results[ 'cf_' . $field->id ] = $field->name;
}
if ( ! empty( $results ) ) {
foreach ( $results as $key => $value ) {
echo $this->__('MailPoet Custom field name: ' . $value . "
");
echo $this->__('Custom field ID (which should be used as contact form\'s field name): ' . '' . $key . '');
echo "
";
echo "
";
}
} else {
echo $this->__("No mailpoet custom field available.");
}
} //End of mailpoetsignup_cf
}
MailpoetCustomField::init();