坚信科学,分享技术

Tag Archives: 开源

解读PHP开源项目中列表和hook方法:while(has_items()): thme_ite();和apply_filters

在wordpress,lilina等开源项目中,常常会看到一些莫名的代码,来无影去无踪,看上去很有意味,特地拿来分析分析,看看一般的作法。 part 1  列表 循环显示 先看代码: <?php $num = 0; if(has_items()) { while(has_items()): the_item(); } ?> 以上代码,出自某开源项目。。。 再进入the_item()函数内部,可以看到一个关键的函数: * Returns the current item * * @since 1.0 * * @return bool|stdClass False if item doesn't exist, otherwise returns the specified …

Continue reading

Posted in php | Tagged , , | Leave a comment