How do I read values (PHP defined constants) from wp-config.php?

后端 未结 7 1052
悲哀的现实
悲哀的现实 2021-02-07 03:40

I need to get username, password etc from the wp-config file to connect to a custom PDO database.

Currently I have another file where I have this info, but

7条回答
  •  旧巷少年郎
    2021-02-07 04:11

    Just add required wp-load.php file. you can use all wordpress functionality like get_recent_posts() and many more...

提交回复
热议问题