td_api_header_style::update

Available on: Newsmag V1.8+, Newspaper V5+
This api call is used to update the parameters of an existing header style.

Usage:

<?php td_api_header_style::update( $id, $params_array ) ?>

Parameters:

$id (string) (required)

  • the header style id – has to match with one of the header styles which are already registered in the theme

$params_array (array) (required)

  • an array which contains the parameters of the header style:
Key name
Type
Description
text string the title of the header style, it appears in Theme Panel -> Header -> Header Style
file string the path of the template file

Examples:

In the following example we’ll update the existing Header Style 1 , you can see how the code looks on plugin, you have to modify the file path to match with the plugin current folder, we use the variables which were introduced in the Plugin Method section:

td_api_header_style::update('1',
    array(
        'text' => '<strong>Style 1 - </strong> default',
        'file' => $this->plugin_path . '/parts/header/header-style-1.php'
    )
);