Private messaging on backend only

Hi,

I am wondering if it's possible to utlize the private messaging in wp-admin only -- with the inbox sitting in a page inside wp-admin, and nothing being added to the frontend?

Also, using the "capabilities" add-on, I tried to limit the users to only be able to send emails to the 'editor' role, but it does not seem to work.

I'd like to use this plugin as a way to allow authors to communicate with the editor(s) of the site via private messaging in the backend. Is this possible?

Thank you,

Bira

  • Adam Czajczyk

    Hello bira,

    I hope you're well today and thank you for your question!

    I think that Private Messaging should do the trick. The "Front-end" part of it would be only active if user has access to the little "envelope" icon in toolbar so we could probably remove it from the toolbar with a little bit of additional code. Let's start with this.

    Please create an empty file called "pm-no-front-end.php" and paste this code inside:

    <?php 
    
    add_action('wp_footer','wpmu_no_front_pm');
    add_action('admin_head','wpmu_no_front_pm');
    function wpmu_no_front_pm() {
    	?>
    	<style>
    		#wp-admin-bar-mm-button {display:none;}
    	</style>
    	<?php
    }

    Access your site via FTP and go to "/wp-content" folder. Check if there's a "mu-plugins" folder inside. If not, then please create it and then upload that file to it.

    This will remove the "envelope" icon (and message counter) from toolbar and Private Messaging shouldn't be then available from front end.

    As for capabilities. First step (to make it easier) would be to disable sending capability for everybody. To do this, please go to your "Messaging -> Settings" page in your dashboard, switch to "Capability Settings" tab and then:

    (let's skip "Administrator" as it would be better to let admins message everybody)
    - click on "Editor" tab
    - un-check all checkboxes

    repeat above to steps for all "User role" tabs that you see and save changes

    Let's now assume that we want only "Subscribers" to be able to message "Editors" and that's all:

    - click on "Subscriber" tab
    - check the checkbox for "User from this role can send to Editor" option and save changes.

    This should do the trick.

    In case you had any further questions on this, please let me know and I'll be happy to assist.

    Best regards,
    Adam

  • bira

    Hi Adam,

    Many thanks for your detailed response. However, it doesn't solve my problems:

    1) Simply removing the message icon from the admin bar doesn't move the inbox and the messaging popup to the backend (to wp-admin). ALL the scripts and files (and there are a LOT) are still enqueued on the frontend, and there is nowhere to access the inbox on the backend. Am I missing something here?

    2) Regarding the capabilities, I actually did exactly as you stated - I removed all roles from ALL user types (except for Administrator). It did not help - every single user is still available on the auto-complete list.

    I think for now I'm giving up on this plugin. Which is a shame. But it does not seem to suit what I need.

    Many thanks,

    Bira

  • Predrag Dubajic

    Hi Bira,

    You can use plugin like this for adding custom CSS code that will be called only on front end:
    https://wordpress.org/plugins/simple-custom-css/
    So if you add this CSS code using that plugin it will hide messaging button only on front end of your site:

    #wp-admin-bar-mm-button {
    	display: none;
    }

    2) Regarding the capabilities, I actually did exactly as you stated - I removed all roles from ALL user types (except for Administrator). It did not help - every single user is still available on the auto-complete list.

    I did some further testing on this and it looks like the capabilities are indeed having issues currently, I have created bug report for plugin developer to have a look at.

    Thank you,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.