Renaming a panel’s title in customisation settings

Hi all,

Im creating a child theme. There are some theme customisation settings which the parent theme is generating (so that you can change background colour etc).

The parent theme is creating the panel with

 $wp_customize->add_panel('sparkling_main_options', array(
        'capability' => 'edit_theme_options',
        'theme_supports' => '',
        'title' => __('Sparkling Options', 'sparkling'),
        'description' => __('Panel to update sparkling theme options', 'sparkling'), // Include html tags such as <p>.
        'priority' => 10 // Mixed with top-level-section hierarchy.

How do I change the title of this panel within my child theme’s functions.php file? I want to change ‘Sparkling Options’ to ‘Advanced Options’.

Hi @tufty,

I hope you are well today and thank you for your question.

You can achieve this by adding the following code in the functions.php file of your child theme.

function colorlib_change_translate_text( $translated_text, $text, $domain ) {
	if ( $domain == 'sparkling' && trim($translated_text) == 'Sparkling Options' ) {
		$translated_text = 'Advanced Options';
	return $translated_text;
add_filter( 'gettext', 'colorlib_change_translate_text', 20, 3 );

Best Regards,

Wow! Thanks so much Movin. I tried lots of different stuff, but I never would have got this!

You are most welcome here :slight_smile: