File manager - Edit - /var/www/wordpress_preproduction/wp-content/mu-plugins/mu-backoffice.php
Back
<?php if (!defined('ABSPATH')) die('Restricted Area'); /* * Plugin Name: Back-Office Enhancements * Description: Tweaks for WordPress (back-office). * Version: 20160612 * Author: AurĂ©lien Denis (Neticpro) * Author URI: https://neticpro.fr/ */ /* Widget 'At a glance' for all content */ function ntp_right_now_content_table_end() { $args = array( 'public' => true, '_builtin' => false ); $output = 'object'; $operator = 'and'; $post_types = get_post_types($args , $output , $operator); foreach($post_types as $post_type) { $num_posts = wp_count_posts($post_type->name); $num = number_format_i18n($num_posts->publish); $text = _n($post_type->labels->name, $post_type->labels->name , intval($num_posts->publish)); if (current_user_can('edit_posts')) { $cpt_name = $post_type->name; } echo '<li><tr><a class="'.$cpt_name.'" href="edit.php?post_type='.$cpt_name.'"><td></td>' . $num . ' <td>' . $text . '</td></a></tr></li>'; } $taxonomies = get_taxonomies($args , $output , $operator); foreach($taxonomies as $taxonomy) { $num_terms = wp_count_terms($taxonomy->name); $num = number_format_i18n($num_terms); $text = _n($taxonomy->labels->name, $taxonomy->labels->name , intval($num_terms)); if (current_user_can('manage_categories')) { $cpt_tax = $taxonomy->name; } echo '<li><tr><a class="'.$cpt_tax.'" href="edit-tags.php?taxonomy='.$cpt_tax.'"><td></td>' . $num . ' <td>' . $text . '</td></a></tr></li>'; } } add_action('dashboard_glance_items', 'ntp_right_now_content_table_end'); /* Removing unnecessary widgets from Dashboard */ function ntp_dashboard_widgets() { // Plugins remove_meta_box('dashboard_recent_comments', 'dashboard', 'normal'); // Recent Comments remove_meta_box('dashboard_incoming_links', 'dashboard', 'normal'); // Incoming Links remove_meta_box('dashboard_plugins', 'dashboard', 'normal'); // Plugins remove_meta_box('dashboard_quick_press', 'dashboard', 'side'); // Quick Press remove_meta_box('dashboard_recent_drafts', 'dashboard', 'side'); // Recent Drafts remove_meta_box('dashboard_primary', 'dashboard', 'side'); // WordPress blog remove_meta_box('dashboard_secondary', 'dashboard', 'side'); // Other WordPress News } add_action('wp_dashboard_setup', 'ntp_dashboard_widgets'); /* Remove Unnecessary Menus */ function ntp_remove_menus() { remove_menu_page('edit.php?post_type=project'); } add_action('admin_init', 'ntp_remove_menus'); /* Remove WordPress Logo */ function ntp_remove_wp_logo($wp_admin_bar) { $wp_admin_bar->remove_node('wp-logo'); } add_action('admin_bar_menu', 'ntp_remove_wp_logo', 999); /* Custom Footer */ function ntp_remove_footer_admin () { $slogan = get_option('blogdescription'); $title = get_option('blogname'); echo '© ' . date('Y') . ' ' . $title . ' - ' . $slogan; } add_filter('admin_footer_text', 'ntp_remove_footer_admin'); /* Remove Items from Admin Bar */ function ntp_remove_from_admin_bar() { global $wp_admin_bar; $wp_admin_bar->remove_menu('comments'); $wp_admin_bar->remove_menu('updates'); } add_action('wp_before_admin_bar_render', 'ntp_remove_from_admin_bar'); /* TinyMCE Large Editor */ function ntp_force_show_large_editor($in) { if(is_array($in)) { $in['wordpress_adv_hidden'] = FALSE; } return $in; } add_filter('tiny_mce_before_init', 'ntp_force_show_large_editor'); /* Remove H1 in headings */ function ntp_remove_headings($arr) { $arr['block_formats'] = 'Paragraphe=p; Titre 2=h2; Titre 3=h3;Titre 4=h4; Titre 5=h5; Titre 6=h6'; return $arr; } add_filter('tiny_mce_before_init', 'ntp_remove_headings');
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.03 |
proxy
|
phpinfo
|
Settings