![]() Server : Apache/2 System : Linux server-15-235-50-60 5.15.0-164-generic #174-Ubuntu SMP Fri Nov 14 20:25:16 UTC 2025 x86_64 User : gositeme ( 1004) PHP Version : 8.2.29 Disable Function : exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname Directory : /home/gositeme/domains/gositeme.com/hdinvoice3/includes/functions/ |
<?php
/*
HDInvoice functions admin
Functions required for backend admin are here
*/
/* Add admin menu pages
------------------------------------------------------- */
function hdv_register_menu_page()
{
if (current_user_can('edit_others_pages')) {
add_menu_page('HDInvoice', 'HDInvoice', 'edit_posts', 'hdv_options', 'hdv_create_options_page', plugins_url('../../images/logo-16.png', __FILE__), 10);
}
}
add_action('admin_menu', 'hdv_register_menu_page', 1);
/* Redirect the menu page to the Dashboard
------------------------------------------------------- */
function hdv_create_options_page()
{
// NOTE: because we cannot resend headers at this point, we cannot use
// wp_redirect(). Feels too hacky to hook into this earlier
// ATTN WP PLUGIN REVIEWER: Is there a clean way to use wp_redirect() instead?
$hdv_dashboard = intval(get_option('hdv_dashboard'));
$perm = get_permalink($hdv_dashboard);
echo '<meta http-equiv="refresh" content="0;URL=\''.$perm.'\'" />';
}
/* Add custom page subtitle/post status to
* HDInvoice Dashboard page so users easily know
* that the new page is because of this plugin
------------------------------------------------------- */
function hdv_filter_display_post_states($post_states, $post)
{
$hdv_dashboard = get_option('hdv_dashboard');
if ($hdv_dashboard == $post->ID) {
echo ' - HDInvoice Dashboard';
}
return $post_states;
};
add_filter('display_post_states', 'hdv_filter_display_post_states', 10, 2);