Example code

Step 1
XTRA

Using WordPress action add content or PHP codes

In the following example you can see how to modify imported theme options array.

<?php
/**
* With this function you can modify imported theme options and change any options you want.
*
* @var $options = imported theme options array
*/
function my_prefix_after_import_theme_options( $options ) {
// Replace website logo after importing demo.
$options[ 'logo' ] = 'https://yoursite.com/new_logo.png';
// Update new options.
update_option( 'codevz_theme_options', $options );
}
add_action( 'codevz/importer/after_import_theme_options', 'my_prefix_after_import_theme_options' );
XTRA

How and where should I add this PHP codes?

Best solution is to add custom actions and filters in Child Theme functions.php file. But also you can create your own plugin and use this codes in your plugin.

No comment

Leave a Reply

Your email address will not be published. Required fields are marked *