false, 'option_key' => 'agnet_branding', 'page_slug' => 'agnet_branding', 'template' => $tmpl_opt, 'menu_page' => 'options-general.php', 'use_auto_group_naming' => true, 'use_util_menu' => true, 'minimum_role' => 'edit_theme_options', 'layout' => 'fixed', 'page_title' => __('WP Branding', 'wp_branding_textdomain'), 'menu_label' => __('WP Branding', 'wp_branding_textdomain'),));
//-------------------------------------------------------
// ADD "Settings" link under the plugin name
add_filter('plugin_action_links_' . plugin_basename(__FILE__), 'add_action_links');
function add_action_links($links) {
$nivijah_plugin_links = array('Settings',);
return array_merge($links, $nivijah_plugin_links);
}
// ADD STYLESHEET TO LOGIN PAGE
function agenti_my_login_stylesheet() {
wp_enqueue_style('custom-login', plugins_url('css/login-styles.css', __FILE__));
}
add_action('login_enqueue_scripts', 'agenti_my_login_stylesheet');
// ADD CUSTOM STYLESHEET TO ADMIN AREA
function agenti_customAdmin() {
?>
roles) || in_array('editor', $current_user->roles)) {
unset($wp_meta_boxes['dashboard']['normal ']['core']['dashboard_incoming_links']);
}
//Right Now - Comments, Posts, Pages at a glance
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']);
//Recent Comments
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']);
//Incoming Links
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']);
//Plugins - Popular, New and Recently updated Wordpress Plugins
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']);
unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_activity']);
unset($wp_meta_boxes['dashboard']['normal']['core']['icl_dashboard_widget']);
//Wordpress Development Blog Feed
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']);
//Other Wordpress News Feed
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']);
//Quick Press Form
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_quick_press']);
//Recent Drafts List
unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_recent_drafts']);
}
//add our function to the dashboard setup hook
add_action('wp_dashboard_setup', 'tidy_dashboard');
}
// add new dashboard widgets
function agenti_add_dashboard_widgets() {
$custom_title = vp_option('agnet_branding.meta_box_title');
wp_add_dashboard_widget('agenti_dashboard_welcome', $custom_title, 'agenti_add_welcome_widget');
}
// ADD CONTENT TO THE NEW DASHBOAD WIDGET
function agenti_add_welcome_widget() {
$custom_meta_box = vp_option('agnet_branding.custom_meta_box');
echo $custom_meta_box;
}
if (vp_option('agnet_branding.custom_meta_box')) {
add_action('wp_dashboard_setup', 'agenti_add_dashboard_widgets');
}
// ADD A "CREATE PAGE" WIDGET/SHORTCUT
$add_shortcuts = vp_option('agnet_branding.add_meta_page_creation');
if ($add_shortcuts == true) {
function dashboard_widget_function($post, $callback_args) {
$args = array('public' => true, '_builtin' => false);
$output = 'names';
// names or objects, note names is the default
$operator = 'and';
// 'and' or 'or'
$base_url = admin_url();
$post_types = get_post_types($args, $output, $operator);
foreach ($post_types as $post_type) { ?>