Поддержка Плагины Пишу плагин: Calling core loading files directly (wp-config.php)

  • Пишу свой плагин, получил письмо при добавлении в репозиторий:

    ## Calling core loading files directly

    Including wp-config.php, wp-blog-header.php, wp-load.php, or pretty much any other WordPress core file that you have to call directly via an include is not a good idea and we cannot approve a plugin that does so unless it has a very good reason to load the file(s). It is prone to failure since not all WordPress installs have the exact same file structure.

    Usually plugins will include wp-config.php or wp-load.php in order to gain access to core WordPress functions, but there are much better ways to do this. It’s best if you tie your processing functions (the ones that need but don’t have access to core functions) into an action hook, such as «init» or «admin_init».

    Please consult the Plugins API reference for more information: http://codex.wordpress.org/Plugin_API

    If you’re trying to use AJAX, please read this: http://codex.wordpress.org/AJAX_in_Plugins

    For other possibilities, or to better understand why we disallow this, read this: http://ottopress.com/2010/dont-include-wp-load-please/

    Видимо ругаются на эту строку в коде?
    include_once('../../../wp-config.php');
    Прошу помочь разобраться, делал по примеру… Нельзя подключать wp-config.php?

Просмотр 6 ответов — с 1 по 6 (всего 6)
Просмотр 6 ответов — с 1 по 6 (всего 6)
  • Тема «Пишу плагин: Calling core loading files directly (wp-config.php)» закрыта для новых ответов.