私はPHPファイル(html、css、javascript)を入手し、下記のcontent
セクションに読み込む方法を考えています。file_get_contentsの内容を出力する方法
次は、私は次のことを試みたが、失敗してきた元...
function wpse_124979_add_help_tabs() {
if ($screen = get_current_screen()) {
$help_tabs = $screen->get_help_tabs();
$screen->remove_help_tabs();
$screen->add_help_tab(array(
'id' => 'my_help_tab',
'title' => 'Help',
'content' => 'HTML CONTENT',
です。私は、次は何が間違って私の改正のコード...
$adminhelp = file_get_contents('admin-help.php');
function wpse_124979_add_help_tabs() {
if ($screen = get_current_screen()) {
$help_tabs = $screen->get_help_tabs();
$screen->remove_help_tabs();
$screen->add_help_tab(array(
'id' => 'my_help_tab',
'title' => 'WTV Help',
'content' => $adminhelp,
で任意のアイデアです
、file_get_contents
(最初の行)を加え、次いで'content' => $adminhelp
でそれを引っ張ってみましたか?
あなたの '$ adminhelp'変数は関数のスコープ内にありません。あなたはそれを渡すか、関数内でその行を動かす必要があります。 http://php.net/manual/en/language.variables.scope.php – iainn
@iainnと同様に、スコープ外から '$ adminhelp'を呼び出しています。 '$ adminhelp = file_get_contents( 'admin-help.php');に移動します。あなたの機能の中で。 – AndyWarren
ありがとう、これは働いた。 – Jane