Last active
August 29, 2015 14:20
-
-
Save thierrypigot/704267289c927729bd94 to your computer and use it in GitHub Desktop.
Changer le placeholder du chanp titre, en fonction du Custom Post Type
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change le titre par défaut | |
**/ | |
function tp_custom_title_placeholder( $title ) | |
{ | |
$screen = get_current_screen(); | |
switch( $screen->post_type ) | |
{ | |
case 'FAQ': | |
$title = __('Enter question here', 'your_domain_name'); | |
break; | |
case 'Portfolio': | |
$title = __('Enter client name here', 'your_domain_name'); | |
break; | |
// .............. | |
} | |
return $title; | |
} | |
add_filter( 'enter_title_here', 'tp_custom_title_placeholder' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Change le titre du custom post type "Revendeur" | |
**/ | |
function tp_revendeur_change_default_title( $title ) | |
{ | |
$screen = get_current_screen(); | |
if ( 'revendeur' == $screen->post_type ) | |
$title = 'Code revendeur'; | |
return $title; | |
} | |
add_filter( 'enter_title_here', 'tp_revendeur_change_default_title' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment