Compare commits
7 Commits
0a3721a82a
...
1e0c200466
| Author | SHA1 | Date | |
|---|---|---|---|
| 1e0c200466 | |||
| 5c274b005d | |||
|
|
306c82e04c | ||
|
|
91164cf44f | ||
|
|
5237000699 | ||
|
|
98c2e43f6f | ||
|
|
8e3a12f62a |
|
|
@ -50,7 +50,7 @@ function custom_post_status()
|
|||
{
|
||||
register_post_status('offline', array(
|
||||
'label' => __('Hors ligne', 'metiers-patrimoine-theme'),
|
||||
'public' => true,
|
||||
'public' => false,
|
||||
'exclude_from_search' => false,
|
||||
'show_in_admin_all_list' => true,
|
||||
'show_in_admin_status_list' => true,
|
||||
|
|
@ -59,7 +59,15 @@ 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()
|
||||
{
|
||||
|
|
@ -370,4 +378,4 @@ function hide_chantiers_menu()
|
|||
|
||||
remove_menu_page('edit.php?post_type=chantiers');
|
||||
}
|
||||
add_action('admin_menu', 'hide_chantiers_menu', 999);
|
||||
// add_action('admin_menu', 'hide_chantiers_menu', 999);
|
||||
|
|
|
|||
|
|
@ -67,10 +67,10 @@ function metiers_patrimoine_artisans_handle_posts_custom_columns($column)
|
|||
$conseiller = get_field('conseiller', $post_id);
|
||||
if (!isset($conseiller)) return;
|
||||
|
||||
$conseillerDatas = get_userdata($conseiller);
|
||||
if (!isset($conseillerDatas->display_name)) return;
|
||||
// $conseillerDatas = get_userdata($conseiller);
|
||||
// if (!isset($conseillerDatas->display_name)) return;
|
||||
|
||||
echo $conseillerDatas->display_name;
|
||||
echo $conseiller['display_name'];
|
||||
}
|
||||
if ($column == 'state') {
|
||||
$status = get_post_status($post_id);
|
||||
|
|
|
|||
Binary file not shown.
|
After Width: | Height: | Size: 93 KiB |
|
|
@ -3,7 +3,6 @@ get_header();
|
|||
?>
|
||||
|
||||
<?php
|
||||
get_header();
|
||||
$pageIcon = get_field('page_icon', get_queried_object_id()) ?? null;
|
||||
?>
|
||||
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<?php
|
||||
$postID = $args['post_ID'];
|
||||
$post_thumbnail = get_the_post_thumbnail($postID, 'full', array('class' => 'card-artisans__thumbnail card-post__thumbnail')) ?? null;
|
||||
$postDefautlThumbnail = get_stylesheet_directory_uri() . '/resources/img/photos/default-cover.jpg';
|
||||
$postDefautlThumbnail = get_stylesheet_directory_uri() . '/resources/img/illustrations/Homegrade-metier-du-patrimoine-artisan-vignette.jpg';
|
||||
|
||||
$post_title = $args['post_title'];
|
||||
$post_permalink = get_the_permalink($postID);
|
||||
|
|
@ -27,6 +27,8 @@ write_log($cover_image);
|
|||
<?php echo $post_thumbnail ?>
|
||||
<?php if ($cover_image): ?>
|
||||
<img src="<?php echo $cover_image['url'] ?>" alt="<?php echo $post_title ?>" class="card-artisans__cover-image">
|
||||
<?php else: ?>
|
||||
<img src="<?php echo $postDefautlThumbnail ?>" alt="<?php echo $post_title ?>" class="card-artisans__cover-image">
|
||||
<?php endif; ?>
|
||||
<div class="card-artisans__inner">
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
<?php
|
||||
$postID = $args['post_ID'];
|
||||
$post_thumbnail = get_the_post_thumbnail($postID, 'full', array('class' => 'card-artisans__thumbnail card-post__thumbnail')) ?? null;
|
||||
$postDefautlThumbnail = get_stylesheet_directory_uri() . '/resources/img/illustrations/Homegrade-metier-du-patrimoine-artisan-vignette.jpg';
|
||||
|
||||
$post_title = $args['post_title'];
|
||||
$company_members = get_field('company_members', $postID);
|
||||
|
|
@ -23,6 +24,8 @@ $cover_image = get_field('artisan_cover', $postID);
|
|||
<?php echo $post_thumbnail ?>
|
||||
<?php if ($cover_image): ?>
|
||||
<img src="<?php echo $cover_image['url'] ?>" alt="<?php echo $post_title ?>" class="card-artisans__cover-image">
|
||||
<?php else: ?>
|
||||
<img src="<?php echo $postDefautlThumbnail ?>" alt="<?php echo $post_title ?>" class="card-artisans__cover-image">
|
||||
<?php endif; ?>
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ $not_found_message = $args['not_found_message'] ?? "";
|
|||
$queryAllUnaffectedArtisansByStatus = array(
|
||||
'post_type' => 'artisans',
|
||||
'posts_per_page' => -1,
|
||||
'post_status' => array('publish', 'offline'),
|
||||
'meta_query' => array(
|
||||
'relation' => 'AND',
|
||||
array(
|
||||
|
|
@ -49,6 +50,7 @@ $queryAllUnaffectedArtisansByStatus = array(
|
|||
$queryConseillerRelatedArtisansByStatus = array(
|
||||
'post_type' => 'artisans',
|
||||
'posts_per_page' => -1,
|
||||
'post_status' => array('publish', 'offline'),
|
||||
'meta_key' => 'conseiller',
|
||||
'meta_value' => $current_user_id,
|
||||
'meta_query' => array(
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ $current_user = wp_get_current_user();
|
|||
|
||||
$args = array(
|
||||
'post_type' => 'artisans',
|
||||
'post_status' => array('publish', 'offline'),
|
||||
'meta_key' => 'conseiller',
|
||||
'meta_value' => $current_user->ID,
|
||||
'posts_per_page' => -1
|
||||
|
|
@ -34,7 +35,7 @@ $current_user = wp_get_current_user();
|
|||
<div class="total-attached">
|
||||
<p> Artisans associés : <?php echo count($user_attached_artisans->posts) ?></p>
|
||||
</div>
|
||||
<div class="required-actions">
|
||||
<!-- <div class="required-actions">
|
||||
<?php
|
||||
$total = count($required_actions_artisans->posts);
|
||||
?>
|
||||
|
|
@ -59,7 +60,7 @@ $current_user = wp_get_current_user();
|
|||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<a class="cta cta--button" href="<?php echo home_url('/wp-admin/admin.php?page=gestion-artisans') ?>">Pannel de gestion</a>
|
||||
<a class="cta cta--button" href="<?php echo home_url('/wp-admin/admin.php?page=gestion-artisans') ?>">Panel de gestion</a>
|
||||
<?php
|
||||
Loading…
Reference in New Issue
Block a user