Hi Simon,
That works!. Thanks so much for the reply.
Here are the changes that I made to the intercom-for-wordpress.php file in case some of it may be useful to you.
Here is a pastebin of the file.
https://pastebin.com/286ZK8CV
1 – line 99) Added the action to create the support menu page
add_action( 'admin_menu', array( $this, 'create_support_menu' ) );
2 – line 383) Created a function that adds the activator filter, sets the activator, and adds a menu page if the “Create Menu Page” option is checked on the plugin settings page.
/**
* create the support menu link
*
* @return null
*/
function create_support_menu() {
add_filter( 'll_intercom_activator', 'pl_intercom_activator' );
function pl_intercom_activator( $activator ) {
return '.toplevel_page_support';
}
$opts = self::get_settings();
if ($opts['create-support-menu']){
add_menu_page(
'Support',
'Support',
'edit_posts',
'support', //the slug
'', //the function
'', //the icon location
29
);
}
}
3 – line 488) Added a check box to the plugin settings page for users to choose whether or not they want the plugin to create a support menu.
<tr valign="top">
<th scope="row">Create support menu link?</th>
<td>
<input name="ll-intercom[create-support-menu]" type="checkbox" value="1" <?php checked( $opts['create-support-menu'] ); ?>>
</td>
</tr>
4 – line 588) Added input validation for the new “create-support-menu” checkbox.
$new['create-support-menu'] = absint( $input['create-support-menu'] );
Please let me know if any of this code needs correction.
Cheers,
John.