Adding to Existing Array

ساخت وبلاگ
Hi there,
I have some options from wordpress that i need to update programatically. I can get the existing option by using the get_option($option_name);
now it returns something like this:

a:1:{s:8:"category";a:3:
s:36:"bob-gunntest-org-uk_user_cats";a:2:{i:0;s:11:"robert-gunn";i:1;s:25:"RestrictCategoriesDefault";}
s:27:"infotest-co-uk_user_cats";a:2:{i:0;s:22:"kieran-jones";i:1;s:25:"RestrictCategoriesDefault";}
s:15:"admin_user_cats";a:2:{i:0;s:19:"my-nursery";i:1;s:25:"RestrictCategoriesDefault";}
}
}
How do i add a new entry to above say: "jamie-new-test-co-uk_user_cats", "john-smith", "RestrictedCategoriesDefault"

Once i have updated the array i can then update the option in wordpress by using the update_option( $option_name, $new_value );
thanks
jamie
CodingForums...
ما را در سایت CodingForums دنبال می کنید

برچسب : نویسنده : codingforums بازدید : 170 تاريخ : سه شنبه 25 مهر 1396 ساعت: 22:45