Re Order Editor pour être après la méta-boîte
-
-
-1pour la restauration.Aucune significationn'a étéperdueet la lisibilité a été améliorée,ne voyez aucune raison d'avoir annulé la question.-1 for the rollback. No meaning was lost, and readability was improved, see no reason to have rolled back the question.
- 0
- 2011-12-03
- t31os
-
vous venez de suivremes réponses - réponsepar réponse unepar uneet les avez changées - **mais un seul caractère .. ** cen'estpasgentil ..je comprends que vous aimez cesbadgesmecmais allez .. Alors .. vous êtes alléet-1toutesmes réponses?- Jene veuxpas êtreimpolimais c'est agir comme unenfant .. J'auraispufaire lamême chosemaisje m'enfiche assez :) - Jen'aipas comprispourquoi vous avez agi comme ça .. vous semblez être ungars qui aide -peuimporte..you just went on my answers - answer by answer one at a time and changed them -** but only one char.. ** thats not nice.. i understand you like those badges man but comeon.. Then.. you went and -1 all my answers? - i dont mean to be rude but thats acting like a child.. i could have done the same but i dont really care enough :) - just didnt understand why you acted like that.. you seem like a guy that helps - whatever..
- 0
- 2011-12-04
- Sagive SEO
-
Quoi??? .. Jemodifie les réponses ou les questions detout lemonde (c'est ainsi quefonctionnent les sites Stack Exchange),je nemodifiepas uniquement vos réponses,même si vouspensez queje ne vousen donnepasTraitement spécial.What???.. I make edits to anyone and everyone's answers or questions(that's how Stack Exchange sites operate), i don't go about making edits to just your answers, despite whatever you may think i'm not giving you any special treatment.
- 0
- 2011-12-04
- t31os
-
c'estprobablement ce que vous cherchez :-) http://wordpress.stackexchange.com/questions/38562/how-to-customize-default-wordpress-editor/48754this is probably what you're looking for :-) http://wordpress.stackexchange.com/questions/38562/how-to-customize-default-wordpress-editor/48754
- 0
- 2012-10-17
- Dipesh KC
-
Une autre questiontrès similaireici: http://wordpress.stackexchange.com/questions/36600/how-can-i-put-a-custom-meta-box-above-the-editor-but-below-the-title-section surAnother very similar question here: http://wordpress.stackexchange.com/questions/36600/how-can-i-put-a-custom-meta-box-above-the-editor-but-below-the-title-section-on
- 0
- 2014-08-29
- Simon East
-
4 réponses
- votes
-
- 2011-12-03
Celapermettra à l'éditeur depublication d'être déplacé comme les autresboîtes aux lettrestriables.
function move_posteditor( $hook ) { if ( $hook == 'post.php' OR $hook == 'post-new.php' ) { wp_enqueue_script( 'jquery' ); add_action('admin_print_footer_scripts', 'move_posteditor_scripts'); } } add_action( 'admin_enqueue_scripts', 'move_posteditor', 10, 1 ); function move_posteditor_scripts() { ?> <script type="text/javascript"> jQuery('#postdiv, #postdivrich').prependTo('#your_meta_box_id .inside' ); </script> <?php }
This will allow the post editor to be moved like the other sortable post boxes.
function move_posteditor( $hook ) { if ( $hook == 'post.php' OR $hook == 'post-new.php' ) { wp_enqueue_script( 'jquery' ); add_action('admin_print_footer_scripts', 'move_posteditor_scripts'); } } add_action( 'admin_enqueue_scripts', 'move_posteditor', 10, 1 ); function move_posteditor_scripts() { ?> <script type="text/javascript"> jQuery('#postdiv, #postdivrich').prependTo('#your_meta_box_id .inside' ); </script> <?php }
-
10xbeaucoupmec ...il afallu unpeu depicotementpourtravailler avecmontype demessagepersonnalisémais cela afait l'affaire - vous l'homme!:)10x a lot man.. it took a little tingeling to work with my custom post type but that did the trick - you the man! :)
- 0
- 2011-12-03
- Sagive SEO
-
C'est un hack assez diaboliquemais celafonctionnebien,n'oubliezpas de remplacer #your_meta_box_idpar lenom de lametabox que vous avez créée avec: add_meta_box ("your_meta_box_id","Editor Title",array (& $this,"editor"),"your_post_type ","normal "," core ");This is a pretty evil hack but it does work well, remember to change #your_meta_box_id to the name of the metabox you created with: add_meta_box("your_meta_box_id", "Editor Title", array(&$this, "editor"), "your_post_type", "normal", "core");
- 1
- 2012-02-10
- Jona
-
- 2014-08-29
C'est laméthode laplus simple quej'aitrouvée.
Lors de la création de votremetabox,définissez simplement le contexte sur "avancé".Ensuite,accrochez-vous au crochet
edit_form_after_title
-imprimez vosméta-boîtes,puis supprimez-lespour qu'ellesn'apparaissentpas deuxfois.// Move all "advanced" metaboxes above the default editor add_action('edit_form_after_title', function() { global $post, $wp_meta_boxes; do_meta_boxes(get_current_screen(), 'advanced', $post); unset($wp_meta_boxes[get_post_type($post)]['advanced']); });
Merci à la solution d'Andrewici .
This is the simplest method I have found.
When creating your metabox, simply set the context to "advanced". Then, latch on to the
edit_form_after_title
hook - print your meta boxes out there, then remove it so it doesn't appear twice.// Move all "advanced" metaboxes above the default editor add_action('edit_form_after_title', function() { global $post, $wp_meta_boxes; do_meta_boxes(get_current_screen(), 'advanced', $post); unset($wp_meta_boxes[get_post_type($post)]['advanced']); });
Thanks to Andrew's solution here.
-
J'aime celui-ci lemeilleur.Moins de code.Merci.I like this one the best. Least amount of code. Thanks.
- 0
- 2016-08-31
- Ralphonz
-
- 2012-12-09
Cette solution de WordPress Lesforums .org fonctionnaientparfaitementpourmoiet sans aucun JS. Je l'aimodifiépourne cibler qu'un seul CPT,donc dans le code ci-dessous,remplacez
{post-type}
par letype depublication que vous souhaitez cibler:post
,page
,my_custom_post_type
,etc ... (Si c'est déroutant,voir le lien référencé vers .orgpour cettepage/exemple d'article standard)add_action( 'add_meta_boxes', 'jb_make_wp_editor_movable', 0 ); function jb_make_wp_editor_movable() { global $_wp_post_type_features; if (isset($_wp_post_type_features['{post-type}']['editor']) && $_wp_post_type_features['{post-type}']['editor']) { unset($_wp_post_type_features['{post-type}']['editor']); add_meta_box( 'description_sectionid', __('Description'), 'jb_inner_custom_box', '{post-type}', 'normal', 'high' ); } } function jb_inner_custom_box( $post ) { the_editor($post->post_content); }
This solution from WordPress.org forums worked perfectly for me and without any JS. I modified it to only target a single CPT, so in the code below replace
{post-type}
with the post type you want to target:post
,page
,my_custom_post_type
, etc... (If that's confusing see the referenced link to .org for that standard page/post example)add_action( 'add_meta_boxes', 'jb_make_wp_editor_movable', 0 ); function jb_make_wp_editor_movable() { global $_wp_post_type_features; if (isset($_wp_post_type_features['{post-type}']['editor']) && $_wp_post_type_features['{post-type}']['editor']) { unset($_wp_post_type_features['{post-type}']['editor']); add_meta_box( 'description_sectionid', __('Description'), 'jb_inner_custom_box', '{post-type}', 'normal', 'high' ); } } function jb_inner_custom_box( $post ) { the_editor($post->post_content); }
-
- 2011-12-03
Avez-vousessayé de définir
$priority
surhigh
et de changer de contexte?Si celan'aidepas -il y a un hack que vouspouvez utiliser - qui consiste à DÉPLACER l'éditeur DANS uneméta-boîteet vouspouvez leplacer comme vous le souhaitez.
Have you tried to set
$priority
tohigh
and change context?If this is not helping - there is a hack you could use - which is to MOVE the editor INSIDE a meta-box and then you can place it as you like.
Je souhaite réorganiser des éléments dans unmessagepersonnalisé. J'aifaittravailler laméta-boîteet l'éditeurensemble,mais actuellement l'éditeurest au-dessus de laméta-boîte
etj'aibesoin que ce soit l'inverse.
Voici le code demametabox:
J'aiessayé de supprimer l'éditeuret de le réinstaller après cettefonction
maisje suppose que c'est une solutiontrop simpliste carellene fonctionnepas.
J'ai supprimé l'éditeuren utilisant ceci:
Puis l'ajouté ànouveauen utilisant
add_post_type_supports
.Avez-vous des suggestions?