Description

This function applies a new style to the cPanel interface.

In cPanel & WHM version 66 and later, the /scripts/modify_accounts script allows you to modify the style and theme for many or all accounts on the server. For more information, read our The modify_accounts Script documentation. 

Examples 


https://hostname.example.com:2083/cpsess##########/execute/Themes/update?theme=paper_lantern

$cpanel = new CPANEL(); // Connect to cPanel - only do this once.
 
// Set new theme for example.com.
$set_theme = $cpanel->uapi(
    'Styles', 'update',
		array(
		'theme'			=> 'paper_lantern',
	)
 );

 

my $cpliveapi = Cpanel::LiveAPI->new(); # Connect to cPanel - only do this once.
 
# Set new theme on example.com.
my $set_theme = $cpliveapi->uapi(
    'Styles', 'update',
	{
		'theme'			=> 'paper_lantern',

	}
 );

 

<!-- Update the theme. -->
[% execute('Themes', 'update', { theme => 'paper_lantern', } ); %]

uapi --user=username Themes update theme=paper_lantern

{
  "messages": null,
  "errors": null,
  "status": 1,
  "metadata": {
     
  },
  "data": null
}

   

Parameters

ParameterTypeDescriptionPossible valuesExample
themestring

Required

The theme name.

An available cPanel theme.paper_lantern

Returns

ReturnTypeDescriptionPossible valuesExample
statusBoolean

Whether the theme changed.

  • 1 — Changed.
  • 0 — Did not change.
1