ABSPATH or __FILE__?

前端 未结 4 1453
长情又很酷
长情又很酷 2020-12-24 14:42

Can someone tell me if either of these two methods has an advantage over the other and why?

$mydir = ABSPATH.\'/wp-content/themes/mytheme/images\';

4条回答
  •  粉色の甜心
    2020-12-24 15:10

    ABSPATH is defined variable -> define("ABSPATH",__FILE__); if i directly use magic constant __FILE__ .it will produce same result.

    In CMS ABSPATH and framework use BASEPATH is used to get root information in the form of defined variable . In the end with the help of both we get same accurate result.

提交回复
热议问题