bp_group_extension :: parse_legacy_properties()
解析遗留属性。
描述
旧标准bp_group_extension.是插件,用于在构造函数中注册其设置作为属性。新方法是将Config数组传递给init()方法。为了支持旧版插件,我们啜饮了遗留属性,稍后会将它们解析为新init()阵列。
来源
文件:bp-groups / classes / class-bp-group-extension.php
受保护的函数parse_legacy_properties(){//只运行这个时间。if(!空($ this-> letacacy_properties_converted)){return;$ properties = $ this-> get_legacy_property_list();//为方便起见,逐个参考变量。$ lpc =&$ this-> letacy_properties_converted;foreach($属性为$ property){// no regacy configs存在此密钥。if(!isset($ this - > {$ property})){继续;} //抓住该值并根据需要录制它。$ value = $ this - > {$ property};切换($ property){case'enable_create_step':$ lpc ['screens'] ['create'] ['已启用'] =(bool)$ value; break; case 'enable_edit_item' : $lpc['screens']['edit']['enabled'] = (bool) $value; break; case 'enable_admin_item' : $lpc['screens']['admin']['enabled'] = (bool) $value; break; case 'create_step_position' : $lpc['screens']['create']['position'] = $value; break; // Note: 'admin' becomes 'edit' to distinguish from Dashboard 'admin'. case 'admin_name' : $lpc['screens']['edit']['name'] = $value; break; case 'admin_slug' : $lpc['screens']['edit']['slug'] = $value; break; case 'create_name' : $lpc['screens']['create']['name'] = $value; break; case 'create_slug' : $lpc['screens']['create']['slug'] = $value; break; case 'admin_metabox_context' : $lpc['screens']['admin']['metabox_context'] = $value; break; case 'admin_metabox_priority' : $lpc['screens']['admin']['metabox_priority'] = $value; break; default : $lpc[ $property ] = $value; break; } } }
变更乐
版本 | 描述 |
---|---|
BuddyPress 1.8.0. | 介绍。 |