Last active
December 16, 2015 22:09
-
-
Save davist11/5504970 to your computer and use it in GitHub Desktop.
EE Entry previewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function sessions_end($session) | |
{ | |
if ($session->userdata['can_access_cp'] === 'y') { | |
$new_global_vars['gv_can_preview'] = TRUE; | |
} else { | |
$new_global_vars['gv_can_preview'] = FALSE; | |
} | |
$this->EE->config->_global_vars = array_merge($new_global_vars, $this->EE->config->_global_vars); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{exp:channel:entries | |
channel="press_release" | |
limit="1" | |
require_entry="yes" | |
status="open{if gv_can_preview}|preview{/if}" | |
{gv_channel_disable_most} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment