RCCWP_Menu::AttachCustomWritePanelFavoriteActions PHP Method

AttachCustomWritePanelFavoriteActions() public method

    function AttachCustomWritePanelFavoriteActions()
    {
        global $mf_domain;
        require_once 'RCCWP_Options.php';
        $assignToRole = RCCWP_Options::Get('assign-to-role');
        $requiredPostsCap = 'edit_posts';
        $requiredPagesCap = 'edit_pages';
        $actions = array('post-new.php' => array(__('New Post', $mf_domain), 'edit_posts'), 'edit.php?post_status=draft' => array(__('Drafts', $mf_domain), 'edit_posts'), 'page-new.php' => array(__('New Page', $mf_domain), 'edit_pages'), 'media-new.php' => array(__('Upload', $mf_domain), 'upload_files'), 'edit-comments.php' => array(__('Comments', $mf_domain), 'moderate_comments'));
        $customWritePanels = RCCWP_CustomWritePanel::GetCustomWritePanels();
        foreach ($customWritePanels as $panel) {
            if ($assignToRole == 1) {
                $requiredPostsCap = $panel->capability_name;
                $requiredPagesCap = $panel->capability_name;
            }
            if ($panel->type == "post") {
                $actions['post-new.php?custom-write-panel-id=' . $panel->id] = array('New ' . __($panel->name), 'edit_posts');
            } else {
                $actions['page-new.php?custom-write-panel-id=' . $panel->id] = array('New ' . __($panel->name), 'edit_pages');
            }
        }
        return $actions;
    }