0
편집기에 새 글을 삽입하는 데 도움이되는 새 플러그인을 만듭니다.
add_action('media_buttons', 'jgames_button', 20);
function jgames_button()
{
$url = plugins_url().'/j_games_uploads/j_games_uploads.php?page=add&TB_iframe=true&height=500&width=640';
echo '<a href="'.$url.'" class="thickbox" title="Add new game"><img src="'.admin_url('images/media-button-other.gif').'" alt="Add new game"></a>';
}
if(isset($_GET['page']) && $_GET['page'] == 'add'){
?>
<div class="wrap">
<h2>Add new game:</h2>
<form method="post" action="j_games_uploads.php" enctype="multipart/form-data">
<p>
<label for="publisher">publisher:</labe>
<input type="text" name="publisher" />
</p>
...Here is more forms...
<p class="submit">
<input type="submit" name="submit" value="Save Changes" class="button-primary" />
</p>
</form>
</div>
<?php
} elseif (isset($_POST['submit'])){
print_r($_POST['submit']);
}
내가 오류와 팝업 창이 표시 편집기에 새로운 버튼을 클릭 때 "치명적인 오류 : 정의되지 않은 함수 ADD_ACTION()를 호출" 어떻게 그 문제를 해결하기 위해?
어디에서이 코드를 사용합니까? 메인 플러그인 파일에? 오류가이 add_action과 동일한 줄을 제공합니까? – janw