开发者

Wordpress Update Option is setting value as Simple XML Help

开发者 https://www.devze.com 2023-04-04 12:16 出处:网络
I am trying to store an option value in the wp_options table by using update_option, however it goes in as SimpleXML Object when all I want is a normal string of numbers/letters...

I am trying to store an option value in the wp_options table by using update_option, however it goes in as SimpleXML Object when all I want is a normal string of numbers/letters...

I have this:

$id = '1f84705816652deccc97a开发者_开发知识库53acd21b86bcf91f264';

update_option('box_id', $id);

So now I can't pull this value out by using $id = get_option('box_id'); because it is a simpleXML object...

Anyone know?


Ok I just fixed it by type casting it like so: update_option('box_id'(string)$id);

0

精彩评论

暂无评论...
验证码 换一张
取 消