Does includes/admin.php have special status I don't understand?
This is my dash widget code:
add_action('wp_dashboard_setup', 'custom_dashboard_widgets');
function custom_dashboard_widgets() {
global $wp_meta_boxes;
error_log("I love testing!");
wp_add_dashboard_widget('test_dash', 'Test Dash', 'test_dash');
}
function test_dash(){
echo "Test";
}
?>
If I put that code in includes/dash.php
it works perfectly. If I put it in includes/admin.php
nothing happens. Both files are included in the plugin using the same method:
require_once('includes/admin.php');
require_once('includes/dash.php');