Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentesRévision précédente | |||
| webdev:wordpress:backoffice [03/04/2015 01:01] – dolo | webdev:wordpress:backoffice [16/01/2016 21:23] (Version actuelle) – modification externe 127.0.0.1 | ||
|---|---|---|---|
| Ligne 1: | Ligne 1: | ||
| + | ====== Améliorer le backoffice ====== | ||
| + | |||
| + | functions.php : | ||
| + | < | ||
| + | // ----------------------------------------------------------------------------- | ||
| + | // Amélioration du backoffice | ||
| + | // Enlever les menus inutiles | ||
| + | function remove_menus(){ | ||
| + | |||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | // | ||
| + | |||
| + | } | ||
| + | add_action( ' | ||
| + | |||
| + | // Ajouter le style des pages pour le backoffice | ||
| + | add_editor_style(" | ||
| + | |||
| + | // Ajouter les styles personnalisés à TinyMCE | ||
| + | // Callback function to insert ' | ||
| + | function my_mce_buttons_2( $buttons ) { | ||
| + | array_unshift( $buttons, ' | ||
| + | return $buttons; | ||
| + | } | ||
| + | // Register our callback to the appropriate filter | ||
| + | add_filter(' | ||
| + | |||
| + | // Callback function to filter the MCE settings | ||
| + | function my_mce_before_init_insert_formats( $init_array ) { | ||
| + | // Define the style_formats array | ||
| + | $style_formats = array( | ||
| + | // Each array child is a format with it's own settings | ||
| + | array( | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ' | ||
| + | ), | ||
| + | ); | ||
| + | // Insert the array, JSON ENCODED, into ' | ||
| + | $init_array[' | ||
| + | | ||
| + | return $init_array; | ||
| + | |||
| + | } | ||
| + | // Attach callback to ' | ||
| + | add_filter( ' | ||
| + | </ | ||
| + | |||
| + | [[http:// | ||