rAthus

[WordPress] add content to wp-admin post edit page

Nov 17th, 2021 (edited)
326
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.56 KB | None | 0 0
  1. <?php
  2.  
  3. add_action('edit_form_after_editor', 'callback__edit_form_top');
  4. function callback__edit_form_top($post) {
  5.     ?>
  6.         <div style="margin-top: 10px; padding: 15px; color: #fff; background: #673AB7; clear: both;">
  7.             Exemple d'un contenu placé sur le hook <b>edit_form_after_editor</b>.<br />
  8.             Liste des hooks disponibles et leurs positions <a href="https://wp-kama.com/123/hooks-on-the-edit-post-admin-page" style="color: #ff0000;">par ici</a>.<br />
  9.             On peut cibler un CPT spécifique en contrôlant la valeur de <i>$post->post_type</i>.
  10.         </div>
  11.     <?php
  12. }
  13.  
Add Comment
Please, Sign In to add comment