How To Send Custom Persistent & Updateable Admin Notifications to Select Child Sites from MainWP Dashboard

What’s It do?

This snippet will allow you to create persistent & updateable custom admin notifications for select Child Sites & keep the connection so that they may be updated on the fly.

MainWP allows you to block all pages that are on the Front-End, however this doesn’t mean that we can not tap into this in order to send out custom admin notices at will to any Child Site connected to our MainWP Dashboard.

How to do it?

We will be utilizing the WP-json API that is already built into each WP website.
wp-json URL: https://YOUR-MAINWP-DASHBOARD.com/wp-json/wp/v2/pages/XX

  • Replace YOUR-MAINWP-DASHBOARD.com and the XX with your page #.
    ( The page # can be found within the address bar when editing the page )

  • Then replace INSERT_URL_HERE with this custom URL in the snippet below.

Steps to setup

  1. Click “Go To WP Admin” button in MainWP Dashboard
  2. Create a new page that contains the content of your notification
  3. Make note of the page # & build your wp-json URL
  4. Replace URL
  5. Save & Execute on selected Child Site.

Snippet Type

Execute on Child Sites

Snippet
GRAB SNIPPET HERE


Resources: admin_notices | Hook | WordPress Developer Resources

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.