Support

Home Forums Community Forum Problem with new version about Custom field save

Problem with new version about Custom field save

Posted: November 18, 2019 at 11:32 am


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!

The support post ‘Problem with new version about Custom field save’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso