Compare commits
No commits in common. "0a3721a82aa043fe7e6c183beca4251ccf4f6a76" and "1178028bfbb0c477c208b644f03c9b8f055ae1e6" have entirely different histories.
0a3721a82a
...
1178028bfb
|
|
@ -50,7 +50,7 @@ function custom_post_status()
|
|||
{
|
||||
register_post_status('offline', array(
|
||||
'label' => __('Hors ligne', 'metiers-patrimoine-theme'),
|
||||
'public' => false,
|
||||
'public' => true,
|
||||
'exclude_from_search' => false,
|
||||
'show_in_admin_all_list' => true,
|
||||
'show_in_admin_status_list' => true,
|
||||
|
|
@ -59,15 +59,7 @@ function custom_post_status()
|
|||
}
|
||||
add_action('init', 'custom_post_status');
|
||||
|
||||
// Permettre aux utilisateurs connectés de voir les posts 'offline'
|
||||
function allow_logged_in_users_to_view_offline_posts($query)
|
||||
{
|
||||
if (!is_admin() && $query->is_main_query() && is_user_logged_in()) {
|
||||
$query->set('post_status', array('publish', 'offline'));
|
||||
}
|
||||
return $query;
|
||||
}
|
||||
add_filter('pre_get_posts', 'allow_logged_in_users_to_view_offline_posts');
|
||||
|
||||
|
||||
function add_to_post_status_dropdown()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ get_header();
|
|||
?>
|
||||
|
||||
<?php
|
||||
get_header();
|
||||
$pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
||||
?>
|
||||
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user