Skip to content

Commit

Permalink
removing demo content
Browse files Browse the repository at this point in the history
  • Loading branch information
ciorici committed Oct 24, 2022
1 parent 4647236 commit b671f62
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 9,450 deletions.
222 changes: 1 addition & 221 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,224 +236,4 @@ function uniblock_get_fonts_url() {
);

return apply_filters( 'uniblock_get_fonts_url', add_query_arg( $query_args, 'https://fonts.googleapis.com/css' ) );
}



/**
* Recommended Plugins
*/
require_once get_template_directory() . '/inc/classes/class-tgm-plugin-activation.php';
add_action( 'tgmpa_register', 'uniblock_register_required_plugins' );



/**
* Register the required plugins for this theme.
*/
function uniblock_register_required_plugins() {
/*
* Array of plugin arrays. Required keys are name and slug.
*/
$plugins = array(

array(
'name' => 'One Click Demo Import',
'slug' => 'one-click-demo-import',
'required' => false,
),
);

/*
* Array of configuration settings. Amend each line as needed.
*/
$config = array(
'id' => 'uniblock_wporg', // Unique ID for hashing notices for multiple instances of TGMPA.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => false, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.

);

tgmpa( $plugins, $config );
}




if ( ! class_exists( 'Uniblock_After_Setup_Theme' ) ) {
/**
* Inspiro_After_Setup_Theme initial setup
*
* @since 1.0.0
*/
class UniBlock_After_Setup_Theme {
/**
* Instance
*
* @var $instance
*/
private static $instance;

/**
* Initiator
*
* @since 1.0.0
* @return object
*/
public static function get_instance() {
if ( ! isset( self::$instance ) ) {
self::$instance = new self();
}
return self::$instance;
}

/**
* Constructor
*/
public function __construct() {
add_action( 'tgmpa_register', array( $this, 'register_required_plugins' ) );
add_action( 'tgmpa_register', array( $this, 'register_required_plugins' ) );
add_filter( 'ocdi/register_plugins', array( $this,'ocdi_register_plugins' ) );
add_filter( 'ocdi/import_files', array( $this,'ocdi_import_files' ) );
add_action( 'ocdi/after_import', array( $this,'ocdi_after_import_setup' ));

}


public function ocdi_register_plugins( $plugins ) {
$theme_plugins = [
[
'name' => 'Video Popup Block by WPZOOM',
'slug' => 'wpzoom-video-popup-block',
'required' => false,
],
[
'name' => 'Map Block for Google Maps',
'slug' => 'map-block-gutenberg',
'required' => false,
],
];

return array_merge( $plugins, $theme_plugins );
}


public function ocdi_import_files() {
return [
[
'import_file_name' => 'UniBlock',
'import_file_url' => get_template_directory_uri() . '/inc/demo-content/uniblock.xml',
'import_preview_image_url' => get_template_directory_uri() . '/screenshot.png',
'preview_url' => 'https://demo.wpzoom.com/uniblock/',
]
];
}


public function ocdi_after_import_setup() {
// Assign menus to their locations.
$main_menu = get_term_by( 'name', 'Primary', 'nav_menu' );

set_theme_mod( 'nav_menu_locations', [
'primary' => $main_menu->term_id, // replace 'main-menu' here with the menu location identifier from register_nav_menu() function in your theme.
]
);

// Assign front page and posts page (blog page).
$front_page_id = get_page_by_title( 'Homepage' );
$blog_page_id = get_page_by_title( 'Blog' );

update_option( 'show_on_front', 'page' );
update_option( 'page_on_front', $front_page_id->ID );
update_option( 'page_for_posts', $blog_page_id->ID );

}


/**
* Register the required plugins for this theme.
*
* In this example, we register five plugins:
* - one included with the TGMPA library
* - two from an external source, one from an arbitrary source, one from a GitHub repository
* - two from the .org repo, where one demonstrates the use of the `is_callable` argument
*
* The variables passed to the `tgmpa()` function should be:
* - an array of plugin arrays;
* - optionally a configuration array.
* If you are not changing anything in the configuration array, you can remove the array and remove the
* variable from the function call: `tgmpa( $plugins );`.
* In that case, the TGMPA default settings will be used.
*
* This function is hooked into `tgmpa_register`, which is fired on the WP `init` action on priority 10.
*
* @since 1.2.3
* @return void
*/
public function register_required_plugins() {
/*
* Array of plugin arrays. Required keys are name and slug.
* If the source is NOT from the .org repo, then source is also required.
*/

$plugins = array(

array(
'name' => 'One Click Demo Import',
'slug' => 'one-click-demo-import',
'required' => false,
),

array(
'name' => 'WPZOOM Portfolio',
'slug' => 'wpzoom-portfolio',
'required' => false,
),

array(
'name' => 'Instagram Widget by WPZOOM',
'slug' => 'instagram-widget-by-wpzoom',
'required' => false,
),

array(
'name' => 'Social Icons Widget by WPZOOM',
'slug' => 'social-icons-widget-by-wpzoom',
'required' => false,
),

);

/*
* Array of configuration settings. Amend each line as needed.
*
* TGMPA will start providing localized text strings soon. If you already have translations of our standard
* strings available, please help us make TGMPA even better by giving us access to these translations or by
* sending in a pull-request with .po file(s) with the translations.
*
* Only uncomment the strings in the config array if you want to customize the strings.
*/
$config = array(
'id' => 'uniblock_wporg', // Unique ID for hashing notices for multiple instances of TGMPA.
'default_path' => '', // Default absolute path to bundled plugins.
'menu' => 'tgmpa-install-plugins', // Menu slug.
'has_notices' => true, // Show admin notices or not.
'dismissable' => true, // If false, a user cannot dismiss the nag message.
'dismiss_msg' => '', // If 'dismissable' is false, this message will be output at top of nag.
'is_automatic' => false, // Automatically activate plugins after installation or not.
'message' => '', // Message to output right before the plugins table.
);

tgmpa( $plugins, $config );
}

}

}

Uniblock_After_Setup_Theme::get_instance();
}
Loading

0 comments on commit b671f62

Please sign in to comment.