A bit of help needed with PHP functions
Error:
Fatal error:Call to undefined function everything_loop()
Is there anyway around this? It gets an error before it even gets called for...
<?php
function EG204_2nd_Edition_to_Menu()
{
add_menu_page( 'EG-20开发者_StackOverflow4', 'EG-204 Ver. 2', '7', 'EG', 'EG204_ExoSkel' , '' , '4.2' );
}
function EG204_ExoSkel() {
everything_loop();
function everything_loop() {
echo 'Everything!';
}
}
add_action('admin_menu', 'EG204_2nd_Edition_to_Menu');
?>
Your brackets aren't right:
<?php
function EG204_2nd_Edition_to_Menu()
{
add_menu_page( 'EG-204', 'EG-204 Ver. 2', '7', 'EG', 'EG204_ExoSkel' , '' , '4.2' );
}
function EG204_ExoSkel() {
everything_loop();
}
function everything_loop() {
echo 'Everything!';
}
add_action('admin_menu', 'EG204_2nd_Edition_to_Menu');
?>
It is inside another function because you have bracket at the wrong place.
精彩评论