Available on: Newsmag V1.8+, Newspaper V5+
This api call is used to update the parameters of an existing category top section template.
Usage:
<?php td_api_category_template::update( $id, $params_array ) ?>
Parameters:
$id (string) (required)
- the category top section template id – has to match with one of the category top section templates which are already registered in the theme
$params_array (array) (required)
- an array which contains the parameters of the category top section template
Key name
|
Type
|
Description
|
---|---|---|
file | string | the path of the template file |
img | string | the icon path, it appears in Theme Panel -> Categories |
text | string | the title of the category top section template, it appears in Theme Panel -> Categories |
Examples:
In the following example we’ll update Category Template 1, you can see how the code looks on plugin, you have to modify the file path to match with the plugin current folder, ex:
td_api_category_template::update('td_category_template_1', array ( 'file' => $this->plugin_path . '/includes/category_templates/td_category_template_1.php', 'img' => $this->plugin_url . '/images/panel/category_templates/icon-category-1.png', 'text' => 'Style 1' ) );