Exemplo n.º 1
0
<?php

jr_resumes_are_disabled();
global $post;
### Publish
if (isset($_GET['publish']) && $_GET['publish'] && $post->post_author == get_current_user_id()) {
    $post_id = $post->ID;
    $post_to_edit = get_post($post_id);
    global $user_ID;
    if ($post_to_edit->ID == $post_id && $post_to_edit->post_author == $user_ID) {
        $update_resume = array();
        $update_resume['ID'] = $post_to_edit->ID;
        if ($post_to_edit->post_status == 'private') {
            $update_resume['post_status'] = 'publish';
        } else {
            $update_resume['post_status'] = 'private';
        }
        wp_update_post($update_resume);
        wp_safe_redirect(get_permalink($post_to_edit->ID));
    }
}
get_header();
?>

	<div class="section single">
	
	<?php 
appthemes_before_loop();
?>
		
		<?php 
Exemplo n.º 2
0
/**
 * Check if resumes are disabled/visible and redirect
 */
function jr_resume_page_auth()
{
    ## Enabled/Disabled
    if (jr_resumes_are_disabled()) {
        wp_redirect(get_bloginfo('url'));
        exit;
    }
}