/**
 * Gets the path for a given Channel page.
 *
 * @param int $page_id The ID of the page we are retrieving the path for.
 * @return string|false The name of the remote forum registered to the page or false if it is not a forum page.
 * @author Paul Hughes
 * @since 3.0
 */
function muut_get_channel_remote_path($page_id = null)
{
    if (is_null($page_id)) {
        $page_id = get_the_ID();
    }
    return Muut_Post_Utility::getChannelRemotePathForPage($page_id);
}
<?php

/**
 * The markup for the Muut page editor metabox.
 *
 * @package   Muut
 * @copyright 2014 Muut Inc
 */
global $post;
$is_forum = Muut_Post_Utility::isMuutPost($post->ID);
$forum_show_class = '';
if ($is_forum != '1') {
    $forum_show_class = 'hidden';
}
$remote_path = '/' . rawurldecode(Muut_Post_Utility::getChannelRemotePathForPage(get_the_ID(), true));
$tabs = Muut_Admin_Post_Editor::instance()->getMetaBoxTabsForCurrentPostType();
$tab_names = array();
foreach ($tabs as $tab) {
    $tab_names[] = $tab['name'];
}
$last_active_tab = get_post_meta(get_the_ID(), 'muut_last_active_tab', true);
$post_type_object = get_post_type_object(get_post_type());
?>
<div id="muut_metabox_tabs">
	<div class="wp-tab-bar">
		<ul id="muut_metabox_tabs_list" class="category-tabs">
			<?php 
$first_tab = true;
$active_tab = $last_active_tab;
foreach ($tabs as $slug => $tab) {
    $class = '';
 /**
  * Filters the Channel embed content to render the index content rather than the JS anchor.
  *
  * @param string $content The current embed content (anchor).
  * @param int $page_id The page for which we are filtering the embed.
  * @return string The filtered content.
  * @author Paul Hughes
  * @since 3.0.1
  */
 public function filterChannelIndexContent($content, $page_id)
 {
     if ($this->isUsingEscapedFragments() && apply_filters('muut_index_channels_on_channel_pages', true)) {
         $this->context = 'channel';
         if ($_GET['_escaped_fragment_']) {
             $remote_path = $_GET['_escaped_fragment_'][0] == '/' ? substr($_GET['_escaped_fragment_'], 1) : $_GET['_escaped_fragment_'];
         } else {
             $remote_path = Muut_Post_Utility::getChannelRemotePathForPage($page_id);
         }
         $content = $this->getIndexContentForPath($remote_path);
     }
     return $content;
 }
 /**
  * Saves the settings on a given tab.
  *
  * @param array $tab The tab we are saving.
  * @param int $post_id The ID of the post we are saving.
  * @param WP_Post $post The post (or page) object that is being saved.
  * @return void
  * @author Paul Hughes
  * @since 3.0
  */
 public function saveMuutPostTab($tab, $post_id, $post)
 {
     $muut_tabs_to_save = array();
     foreach ($this->defaultTabs as $default_tab) {
         $muut_tabs_to_save[] = $default_tab['name'];
     }
     if (!in_array($tab['name'], $muut_tabs_to_save) || !empty($tab['post_types']) && !in_array($post->post_type, (array) $tab['post_types'])) {
         return;
     }
     switch ($tab['name']) {
         case 'commenting-tab':
             $tab_options = array();
             if (isset($_POST[$tab['meta_name']])) {
                 $tab_options = $_POST[$tab['meta_name']];
             }
             $boolean_values = array('disable_uploads');
             foreach ($boolean_values as $boolean_value) {
                 $tab_options[$boolean_value] = isset($tab_options[$boolean_value]) ? $tab_options[$boolean_value] : '0';
             }
             Muut_Post_Utility::setPostOption($post_id, $tab['meta_name'], $tab_options);
             break;
         case 'channel-tab':
             $tab_options = array();
             if (isset($_POST[$tab['meta_name']])) {
                 $tab_options = $_POST[$tab['meta_name']];
                 $tab_current_options = Muut_Post_Utility::getPostOption($post_id, $tab['meta_name']);
             }
             $boolean_values = array('hide_online', 'disable_uploads');
             foreach ($boolean_values as $boolean_value) {
                 $tab_options[$boolean_value] = isset($tab_options[$boolean_value]) ? $tab_options[$boolean_value] : '0';
             }
             $channel_path = isset($tab_options['channel_path']) ? $tab_options['channel_path'] : '';
             if (!isset($tab_options['channel_path']) || $tab_options['channel_path'] == '' || !$tab_options['channel_path']) {
                 // If no path is saved yet, let's generate one and save it.
                 $path = sanitize_title($post->post_name);
                 $ancestors = get_post_ancestors($post);
                 foreach ($ancestors as $ancestor) {
                     if (Muut_Post_Utility::isMuutChannelPage($ancestor) && Muut_Post_Utility::getChannelRemotePathForPage($ancestor, true)) {
                         $path = Muut_Post_Utility::getChannelRemotePathForPage($ancestor, true) . '/' . $path;
                     }
                 }
                 $channel_path = $path;
             } elseif (isset($tab_options['channel_path']) && $tab_options['channel_path'] != '') {
                 $channel_path = Muut_Post_Utility::sanitizeMuutPath($tab_options['channel_path']);
             }
             $tab_options['channel_path'] = $channel_path;
             Muut_Post_Utility::setPostOption($post_id, $tab['meta_name'], $tab_options);
             break;
         case 'forum-tab':
             $tab_options = array();
             if (isset($_POST[$tab['meta_name']])) {
                 $tab_options = $_POST[$tab['meta_name']];
             }
             $boolean_values = array('hide_online', 'disable_uploads', 'show_comments_in_forum');
             foreach ($boolean_values as $boolean_value) {
                 $tab_options[$boolean_value] = isset($tab_options[$boolean_value]) ? $tab_options[$boolean_value] : '0';
             }
             // Remove the default setting for showing comments in forum, if it was copied
             // over from an older version of the plugin.
             if (muut()->getOption('show_comments_in_forum_default')) {
                 muut()->setOption('show_comments_in_forum_default', null);
             }
             Muut_Post_Utility::setPostOption($post_id, $tab['meta_name'], $tab_options);
             Muut_Post_Utility::setAsForumPage($post_id);
             break;
     }
 }