Compare commits

...

3 Commits

Author SHA1 Message Date
fbb2cf142a styling artisan title on cpt page
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-25 11:44:58 +01:00
5ddd977164 spacing tweak on artisan + artisan 2024-11-25 11:44:42 +01:00
037ac6675f custom post status & Fiex title on artisans 2024-11-25 11:44:23 +01:00
3 changed files with 54 additions and 0 deletions

View File

@ -27,3 +27,50 @@ function metiers_remove_meta_boxes()
remove_post_type_support('chantiers', 'comments');
}
add_action('admin_init', 'metiers_remove_meta_boxes');
/* ---------------------------
CUSTOM POST STATUS
---------------------------*/
function metiers_patrimoine_custom_post_status()
{
register_post_status('offline', array(
'label' => _x('Offline', 'post'),
'public' => true,
'exclude_from_search' => false,
'show_in_admin_all_list' => true,
'show_in_admin_status_list' => true,
'label_count' => _n_noop('Unread (%s)', 'Unread (%s)'),
));
}
add_action('init', 'metiers_patrimoine_custom_post_status');
function metiers_patrimoine_add_to_post_status_dropdown()
{
global $post;
// if ($post->post_type != 'pdf_order')
// return false;
$status = ($post->post_statu == 'offline') ? "jQuery( '#post-status-display' ).text( 'Offline' ); jQuery(
'select[name=\"post_status\"]' ).val('completed');" : '';
echo "<script>
jQuery(document).ready( function() {
jQuery( 'select[name=\"post_status\"]' ).append( '<option value=\"completed\">Completed</option>' );
" . $status . "
});
</script>";
}
add_action('post_submitbox_misc_actions', 'metiers_patrimoine_add_to_post_status_dropdown');
add_action('edit_form_after_title', function () {
// Vérifie si on est sur le bon post type
$screen = get_current_screen();
if ($screen && $screen->post_type === 'artisans') { // Remplacez 'votre_cpt' par le slug de votre CPT
echo '<h1 class="admin-artisan-title">' . get_the_title() . '</h1>';
}
});

View File

@ -42,6 +42,10 @@ body.post-type-artisans {
}
}
.admin-artisan-title {
@apply text-patrimoine-sante-securite !font-semibold !text-2xl;
}
.edit-post-visual-editor__post-title-wrapper {
h1 {
font-weight: revert;

View File

@ -94,6 +94,9 @@
}
}
}
.chantier + .chantier {
@apply !mt-16 pt-16 border-t border-solid border-neutral-200;
}
}
}
}