revision pret et mis a jour
This commit is contained in:
+1
-2
@@ -99,8 +99,7 @@ collect(['setup', 'filters'])
|
|||||||
|
|
||||||
}
|
}
|
||||||
add_action('admin_footer', 'cacher_bloc_foot_admin');
|
add_action('admin_footer', 'cacher_bloc_foot_admin');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody class="w-full lg:w-2/3 block bg-jlg-dark-blue">
|
<tbody class="w-full lg:w-2/3 block bg-jlg-dark-blue">
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
$args = array(
|
$args = array(
|
||||||
'post_type' => 'post',
|
'post_type' => 'post',
|
||||||
'posts_per_page' => -1,
|
'posts_per_page' => -1,
|
||||||
@@ -37,37 +38,31 @@
|
|||||||
);
|
);
|
||||||
$query = new WP_Query($args);
|
$query = new WP_Query($args);
|
||||||
if ($query->have_posts()) :
|
if ($query->have_posts()) :
|
||||||
if(is_user_logged_in()){ // verifier si l'utilisateur est connecté
|
|
||||||
while ($query->have_posts()) : $query->the_post();
|
|
||||||
$edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
|
|
||||||
?>
|
|
||||||
<tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
|
|
||||||
<td class="block text-sm pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Minutage', true) }}</td>
|
|
||||||
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Images', true) }}</td>
|
|
||||||
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'VoixOffIn', true) }}</td>
|
|
||||||
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'BandeSon', true) }}</td>
|
|
||||||
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Ecrits', true) }}</td>
|
|
||||||
<td class="block text-sm pl-0 pr-6"><?php echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">🖉</a>';?></td>
|
|
||||||
</tr>
|
|
||||||
<?php
|
|
||||||
endwhile;
|
|
||||||
}
|
|
||||||
|
|
||||||
elseif (!is_user_logged_in()) { // si l'utilsateur n'est pas connecté alors le bouton edit a un shortcode qui appelle le plugin user Login
|
|
||||||
while ($query->have_posts()) : $query->the_post();
|
while ($query->have_posts()) : $query->the_post();
|
||||||
$edit_link = $edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
|
$contenu = get_the_content();
|
||||||
|
$infosArray = explode("---", $contenu); // Divise le contenu en fonction des séparateurs
|
||||||
|
|
||||||
|
// Initialisez des variables pour stocker les informations
|
||||||
|
$images = isset($infosArray[0]) ? $infosArray[0] : '';
|
||||||
|
$voixOffIn = isset($infosArray[1]) ? $infosArray[1] : '';
|
||||||
|
$bandeson = isset($infosArray[2]) ? $infosArray[2] : '';
|
||||||
|
$ecrits = isset($infosArray[3]) ? $infosArray[3] : '';
|
||||||
|
|
||||||
|
//lien pour le crayon
|
||||||
|
$edit_link = 'https://localhost/wp/wp-admin/admin.php?page=rvy-revisions&post='. get_the_ID() .'&action=revise';
|
||||||
?>
|
?>
|
||||||
<tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
|
<tr class="border-jlg-white font-authentic-60 w-full flex flex-row py-6">
|
||||||
<td class="block text-sm pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Minutage', true) }}</td>
|
<td class="block text-sm pl-0 pr-6">{{ the_title()}}</td>
|
||||||
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Images', true) }}</td>
|
<td class="block pl-0 pr-6"><?php echo $images; ?></td>
|
||||||
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'VoixOffIn', true) }}</td>
|
<td class="block pl-0 pr-6"><?php echo $voixOffIn; ?></td>
|
||||||
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'BandeSon', true) }}</td>
|
<td class="block pl-0 pr-6"><?php echo $bandeson; ?></td>
|
||||||
<td class="block pl-0 pr-6">{{ get_post_meta(get_the_ID(), 'Ecrits', true) }}</td>
|
<td class="block pl-0 pr-6"><?php echo $ecrits; ?></td>
|
||||||
<td class="block text-sm pl-0 pr-6"><?php echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">🖉</a>';?></td>
|
<td class="block text-sm pl-0 pr-6"><?php if(is_user_logged_in()){ echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button">🖉</a>';} elseif (!is_user_logged_in()) { echo '<a href="' . esc_url( $edit_link ) . '" class="edit-button xoo-el-login-tgr ">🖉</a>';}?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php
|
<?php
|
||||||
endwhile;
|
endwhile;
|
||||||
}
|
|
||||||
endif;
|
endif;
|
||||||
wp_reset_postdata();
|
wp_reset_postdata();
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user