Jason Wiser
|
November 18, 2019 at 11:32 am
Hi,
I have updated EE plugin
and then added my custom functionality to the new version
I have custom field types
It is worked good with prev version
but for latest version, seems not
I can’t save my custom field value in encoded(serialize) version in DB
here is my model class
class EE_Wiser_Post_Dropdown extends EE_Text_Field_Base{
function prepare_for_get( $value_of_field_on_model_object ) {
return unserialize( base64_decode( $value_of_field_on_model_object ) );
}
/**
* removes all tags when setting
* @param string $value_inputted_for_field_on_model_object
* @return string
*/
function prepare_for_set($value_inputted_for_field_on_model_object) {
return wp_strip_all_tags( base64_encode(serialize( $value_inputted_for_field_on_model_object ) ) );
}
}
I also tried to add
function prepare_for_use_in_db($value_of_field_on_model_object)
{
return base64_encode(serialize( $value_of_field_on_model_object ) );
}
but it’s not working too
where I can add my custom prepare function before set the QST value in DB?
what is changed ? and how can I solve this
thanks!
|