Skip to content

Instantly share code, notes, and snippets.

@rachelmccollin
Last active March 16, 2018 01:03
Show Gist options
  • Save rachelmccollin/748be30ab38eeb117acf8474cb907642 to your computer and use it in GitHub Desktop.
Save rachelmccollin/748be30ab38eeb117acf8474cb907642 to your computer and use it in GitHub Desktop.
WPMU DEV Admin Messages
function rmcc_add_dashboard_widget() {
wp_add_dashboard_widget( 'rmcc_dashboard_welcome', 'Welcome', 'rmcc_welcome_widget_callback' );
}
add_action( 'wp_dashboard_setup', 'rmcc_add_dashboard_widget' );
<?php
/*
Plugin Name: Customize Dashboard
Plugin URI: https://gist.github.com/rachelmccollin/748be30ab38eeb117acf8474cb907642
Description: Plugin to customize the dashboard and admin screens.
Version: 1.0
Author: Rachel McCollin
Author URI: http://rachelmccollin.com
License: GPLv2
*/
function rmcc_add_product_help_text() {
add_meta_box( 'rmcc_product_help_text', 'Using this screen', 'rmcc_product_help_text_callback', 'product', 'side', 'high' );
}
add_action( 'add_meta_boxes', 'rmcc_add_product_help_text' );
// callback function defining content of meta box
function rmcc_product_help_text_callback() { ?>
<p>Use this screen to edit and add products.</p>
<p>For each product you must specify:</p>
<ul>
<li>- The kind of product (simple product is the default)</li>
<li>- Price, shipping and tax if applicable</li>
<li>- For downloads, a link to the download file</li>
<li>- Linked products where relevant</li>
<li>- A product category</li>
<li>- One or more topics and applications where relevant</li>
<li>- A featured image for the product</li>
</ul>
<p>To add text which will be displayed next to the image, type it in the 'Product short description' box below. To add text below the product image and price etc. add it to the main editing box to the left.</p>
<p>To save a product, click 'Publish'. To save changes to a product, click 'Update'. You can also preview before saving by clicking 'Preview changes'.</p>
<?php }
function rmcc_promotion_message(){ ?>
<div class="notice is-dismissible">
<p><strong>New Hosting Package</strong></p>
<p>We've launched a new hosting service for clients with more than one website. It brings all your sites togather and will save you money compared to hosting all your sites separately.</p>
<p>Contact Rachel McCollin on [contact details] to find out more.</p>
</div>
<?php }
add_action( 'admin_notices', 'rmcc_promotion_message' );
function rmcc_remove_dashboard_widgets() {
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' );
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' );
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' );
remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' );
}
add_action( 'wp_dashboard_setup', 'rmcc_remove_dashboard_widgets' );
function rmcc_welcome_widget_callback(){ ?>
<p>This content management system lets you edit the pages and posts on your website.</p>
<h4>Editing and adding content</h4>
<p>Your site consists of the following content, which you can access via the menu on the left:</p>
<ul>
<li><strong>Posts</strong> - blog posts - you can edit these and add more.</li>
<li><strong>Media</strong> - images and documents which you can upload via the Media menu on the left or within each post or page. Most media is uploaded into a post, page or resource except articles which you upload using the Media page.</li>
<li><strong>Pages</strong> - static pages which you can edit.</li>
<li><strong>Comments</strong> - manage comments posted by your members here or in each post's editing screen.
<li><strong>Products</strong> - everything you sell via this website or via an affiliate link.</li>
<li><strong>Users</strong> - here you can see the details of all of the people who have registered for the Type Academy.</li>
</ul>
<p>On each editing screen there are instructions to help you add and edit content.</p>
<h4>Configuring settings</h4>
<p>There are also a number of screens which let you configure various options. Ones you may sometimes need to use are:</p>
<ul>
<li><strong>WooCommerce</strong> - here you can amend your shop settings, such as PayPal details, the email notifications sent to customers, shipping, tax and more.</li>
<li><strong>Appearance</strong> - add new pages to the navigation menu or add widgets to the sidebar or footer. It's unlikely you'll need to use any of these.</li>
<li><strong>Settings</strong> - here you can change settings for your site such as the way urls are displayed and the size of media. Again it's unlikely you'll need to use this.</li>
</ul>
<p>At the bottom of the menu to the left, the 'Manuals' link takes you to a set of video guides which will help you learn how to use WordPress.</p>
<p>Below these instructions are some more widgets which give you access to information on purchases made via your e-commerce system, which is called WooCommerce.</p>
<?php }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment