FEAT handling return to button
This commit is contained in:
parent
1773c57871
commit
51312bf17a
|
|
@ -96,8 +96,6 @@ add_action('edit_form_after_title', function () {
|
|||
jQuery(function($) {
|
||||
$('#set-offline-status').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
// Mettre à jour le champ caché du statut du post
|
||||
$('#post_status').val('offline');
|
||||
$('#post-status-display').text('Hors ligne');
|
||||
$('#publish').trigger('click');
|
||||
|
|
@ -161,6 +159,10 @@ function render_custom_chantier_box_content($post)
|
|||
|
||||
if ($chantiers->have_posts()) {
|
||||
|
||||
$artisan_id = get_the_ID();
|
||||
$return_to = get_edit_post_link($artisan_id);
|
||||
|
||||
|
||||
echo '<h3> Chantiers réalisé par l\'entreprise </h3>';
|
||||
echo '<ul>';
|
||||
while ($chantiers->have_posts()) {
|
||||
|
|
@ -169,11 +171,11 @@ function render_custom_chantier_box_content($post)
|
|||
echo '<li><a href="' . get_edit_post_link() . '"> <img src=' . get_stylesheet_directory_uri() . '/resources/img/icons/document-inspect.svg' . ' /> ' . $chantier_name . '</a></li>';
|
||||
}
|
||||
echo '</ul>';
|
||||
echo '<a href="' . admin_url('post-new.php?post_type=chantiers') . '" class="new-chantier">Ajouter un chantier</a>';
|
||||
echo '<a href="' . admin_url('post-new.php?post_type=chantiers&return_to=' . urlencode($return_to)) . '" class="new-chantier">Ajouter un chantier</a>';
|
||||
} else {
|
||||
echo '<h3> Chantiers réalisés</h3>';
|
||||
echo '<p class="no-results">Aucun chantier pour cette entreprise</p>';
|
||||
echo '<a href="' . admin_url('post-new.php?post_type=chantiers') . '" class="new-chantier">Ajouter un chantier</a>';
|
||||
echo '<a href="' . admin_url('post-new.php?post_type=chantiers&return_to=' . urlencode($return_to)) . '" class="new-chantier">Ajouter un chantier</a>';
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user