: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
* Functions for Theme Portability
* @copyright Copyright (c) 2023, Code Atlantic LLC
* @param array $extra_meta
function pum_install_theme( $name, $settings = null, $extra_meta = [] ) {
if ( ! isset( $settings ) ) {
$settings = PUM_Admin_Themes::defaults();
$new_theme_id = @wp_insert_post(
'post_author' => get_current_user_id(),
'post_status' => 'publish',
'post_type' => 'popup_theme',
'comment_status' => 'closed',
'meta_input' => array_merge(
'popup_theme_settings' => $settings,
function pum_import_theme_from_repo( $hash ) {
'name' => __( 'Imported Theme', 'popup-maker' ),
'settings' => PUM_Admin_Themes::defaults(),
'original_author' => 'Daniel',
return pum_install_theme(
'_pum_theme_repo_hash' => $hash,
'_pum_theme_repo_author' => $theme_data['original_author'],
* Installs a default theme and returns the new theme ID.
function pum_install_default_theme() {
return pum_install_theme(
__( 'Default Theme', 'popup-maker' ),
'_pum_built_in' => 'default-theme',
'_pum_default_theme' => true,
'popup_theme_data_version' => 3,