プラグインを拡張しようとしていますCleverness to do list自分のカスタマイズを別のプラグインに入れて拡張しようとしていますが、私は巧みさからどのメソッドやプロパティにもアクセスできません-todo-listプラグイン。他のプラグインから変数/メソッドへのアクセス
オリジナルのプラグインの中にカスタマイズしたいdisplay()関数があります。 "完成した" todoアイテムも表示したいと思います。元のプラグインをハックするだけであれば、これらの2行のコードをcleverness-to-do-listの表示関数に追加するだけです-frontend.class.php:
$this->list .= '<h1>Completed Todos</h1>';
$this->loop_through_todos(1, $category);
しかし、私は、元に触れることなく独自のカスタムプラグイン内部から$この、ます$ this->リスト、またはます$ this-> loop_through_todosを()にアクセスするかどうかはわかりませんプラグイン。
私は、それらのメソッド/プロパティの元のファイルをインクルードしようとしましたが、通常と同じように関数を呼び出していましたが、機能していません。 $これで
function clever_travel_list()
{
if (! is_admin()) {
//lines 710/711 of cleverness-to-do-list-frontend.class.php
include_once ABSPATH . 'wp-content/plugins/cleverness-to-do-list/includes/cleverness-to-do-list.class.php';
include_once ABSPATH . 'wp-content/plugins/cleverness-to-do-list/includes/cleverness-to-do-list-frontend.class.php';
$this->list .= '<h1>Completed Todos</h1>';
$this->loop_through_todos(1, $category);
die(ClevernessToDoList::$list);
}
}
add_action('ctdl_list_items', clever_travel_list);
私は次のエラーを取得する:私は別のプラグインでプラグインを拡張していたときに
Fatal error: Using $this when not in object context in /Applications/AMPPS/www/wpplugin/wp-content/plugins/clever-extension/clever-extension.php on line 11
は、どのように私は、プロパティ/メソッドにアクセスできますか?