ในกรณีที่เราอยากจะเขียน php เเยกส่วนการทำงานโดยการเเยกหลายๆ ไฟล์ เเล้วต้องการที่จะ include file เข้ามาใช้งาน ใน WordPress เราสามารถใช้ function plugin_dir_path
ตัวอย่างการใช้งาน
โค้ด: เลือกทั้งหมด
include_once( plugin_dir_path( __FILE__ ) . 'plugin-WordPress-menu.php' );
ในกรณีที่เราอยากจะเขียน php เเยกส่วนการทำงานโดยการเเยกหลายๆ ไฟล์ เเล้วต้องการที่จะ include file เข้ามาใช้งาน ใน WordPress เราสามารถใช้ function plugin_dir_path
[code=php]plugin_dir_path( string $file )[/code]
[b]ตัวอย่างการใช้งาน[/b]
[code=php] include_once( plugin_dir_path( __FILE__ ) . 'plugin-WordPress-menu.php' );
[/code]
[img]http://snap.mindphp.com/index.php?view=2016Oct24_580e1ca35c89e[/img]