Rename Events to Courses on Sidebar in Admin
-
Is there a way to change the label for Events to Courses in the left sidebar of the admin? I am using this more for courses so that would be great if possible. Thanks!!!
-
yes, under WP Appearance > Widgets > Events widget > Title
Sorry I think you misunderstood, I see I can do this in the widgets and thanks, but I am talking about the left sidebar in the admin, where it say Dashboard, Media, Posts, Pages then for the plugin it says Events with the shield icon. Can I change that to say ‘Courses’ so my client is not confused.
Thanks for the quick responses too, that’s awesome!
Any update on this Geo? Passing the site off to the client shortly. Let me know if I can better explain myself.
maybe this snippet can help you out – https://pastebin.com/84A4NNXe
Awesome this worked and can be used to change many other labels/text within the Admin, thanks!
My apologies this is a more thorough change of ‘Events’ labels/text:
/** * Rename specified Titles/Labels to Courses * Translate Text using gettext filter/hook * As for where to paste this : https://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/ */ function change_where_metabox( $translated_text, $text, $domain ) { switch ( $translated_text ) { case 'Events' : $translated_text = __( 'Courses', 'events-manager' ); break; } switch ( $translated_text ) { case 'Add Event' : $translated_text = __( 'Add Course', 'events-manager' ); break; } switch ( $translated_text ) { case 'Add New Event' : $translated_text = __( 'Add New Course', 'events-manager' ); break; } switch ( $translated_text ) { case 'Event Tags' : $translated_text = __( 'Course Tags', 'events-manager' ); break; } switch ( $translated_text ) { case 'Separate event tags with commas' : $translated_text = __( 'Separate course tags with commas', 'events-manager' ); break; } switch ( $translated_text ) { case 'Event Tag' : $translated_text = __( 'Course Tag', 'events-manager' ); break; } switch ( $translated_text ) { case 'Edit Event Tag' : $translated_text = __( 'Edit Course Tag', 'events-manager' ); break; } switch ( $translated_text ) { case 'Add New Event Tag' : $translated_text = __( 'Add New Course Tag', 'events-manager' ); break; } switch ( $translated_text ) { case 'Popular Event Tags' : $translated_text = __( 'Popular Course Tags', 'events-manager' ); break; } switch ( $translated_text ) { case 'View Event' : $translated_text = __( 'View Course', 'events-manager' ); break; } switch ( $translated_text ) { case 'Edit Event' : $translated_text = __( 'Edit Course', 'events-manager' ); break; } switch ( $translated_text ) { case 'Event Settings' : $translated_text = __( 'Course Settings', 'events-manager' ); break; } return $translated_text; } add_filter( 'gettext', 'change_where_metabox', 20, 3 );
Thanks for sharing; might help someone else.
Not allowing me to update my old comment but below is a leaner version:
/**
* Rename specified Titles/Labels to Courses
* Translate Text using gettext filter/hook
* As for where to paste this : https://wp-events-plugin.com/tutorials/how-to-safely-add-php-code-to-wordpress/
*/
function change_where_metabox( $translated_text, $text, $domain ) {
switch ( $translated_text ) {case ‘Events’ :
$translated_text = __( ‘Courses’, ‘events-manager’ );
break;case ‘Add Event’ :
$translated_text = __( ‘Add Course’, ‘events-manager’ );
break;case ‘Add New Event’ :
$translated_text = __( ‘Add New Course’, ‘events-manager’ );
break;case ‘Event Tags’ :
$translated_text = __( ‘Course Tags’, ‘events-manager’ );
break;case ‘Separate event tags with commas’ :
$translated_text = __( ‘Separate course tags with commas’, ‘events-manager’ );
break;case ‘Event Tag’ :
$translated_text = __( ‘Course Tag’, ‘events-manager’ );
break;case ‘Edit Event Tag’ :
$translated_text = __( ‘Edit Course Tag’, ‘events-manager’ );
break;case ‘Add New Event Tag’ :
$translated_text = __( ‘Add New Course Tag’, ‘events-manager’ );
break;case ‘Popular Event Tags’ :
$translated_text = __( ‘Popular Course Tags’, ‘events-manager’ );
break;case ‘View Event’ :
$translated_text = __( ‘View Course’, ‘events-manager’ );
break;case ‘Edit Event’ :
$translated_text = __( ‘Edit Course’, ‘events-manager’ );
break;
}return $translated_text;
}
add_filter( ‘gettext’, ‘change_where_metabox’, 20, 3 );Thanks for that code, @hanlonwebdevs. You just saved me some time. ??
Great glad to help!
- The topic ‘Rename Events to Courses on Sidebar in Admin’ is closed to new replies.