Submit
Path:
~
/
home
/
getwphos
/
public_html
/
giulianos
/
wp-content
/
themes
/
mechano
/
admin
/
File Content:
admin--demo-import.php
<?php // TGM Plugin Activation. require_once get_template_directory() . '/admin/admin--class-tgm-plugin-activation.php'; /* ============================================================================================================================================= */ function mechano__admin_head__tgmpa_notice() { $current_screen = get_current_screen(); if ('dashboard' !== $current_screen->id) { ?> <style> #setting-error-tgmpa { display: none !important; } </style> <?php } } add_action('admin_head', 'mechano__admin_head__tgmpa_notice', 1); /* ============================================================================================================================================= */ function mechano_plugins() { $message = ""; if (isset($_GET['plugin'])) { if ($_GET['plugin'] == 'one-click-demo-import') { // Plugin activated. $message .= '<div class="notice notice-info pixelwars-tgmpa-notice">'; $message .= '<h3>' . esc_html__('One Click Demo Import', 'mechano') . ' </h3>'; $message .= '<p>' . esc_html__('Importing demo data is the quickest and easiest way to set up your new theme.', 'mechano') . ' </p>'; $message .= '<p><a class="button button-primary" href="' . esc_url(admin_url('themes.php?page=mechano-import-theme-demos')) . '">' . esc_html__('Run Importer', 'mechano') . '</a></p>'; $message .= '</div>'; } } else { $message .= '<div class="notice notice-warning pixelwars-tgmpa-notice">'; $message .= '<h3>' . esc_html__('Important', 'mechano') . ' </h3>'; $message .= '<p>' . esc_html__('Install/Activate ', 'mechano') . ' <b><u>' . esc_html__('One Click Demo Import', 'mechano') . '</u></b> ' . esc_html__('plugin to import theme demos.', 'mechano') . '</p>'; $message .= '</div>'; } $config = array( 'id' => 'mechano_tgmpa', 'default_path' => "", 'menu' => 'mechano-install-update-theme-plugins', 'parent_slug' => 'themes.php', 'capability' => 'edit_theme_options', 'is_automatic' => true, 'has_notices' => true, 'dismissable' => true, 'dismiss_msg' => '<h2>' . esc_html__('Theme Plugins', 'mechano') . '</h2>', 'message' => $message, 'strings' => array( 'menu_title' => esc_html__('Install Theme Plugins', 'mechano'), 'page_title' => esc_html__('Install/Update Theme Plugins', 'mechano'), ) ); $plugins = array( array( 'name' => esc_html__('Pixelwars Core', 'mechano'), 'slug' => 'pixelwars-core', 'source' => get_template_directory() . '/admin/plugins/pixelwars-core.zip', 'version' => '6.8.5', 'required' => false, 'force_activation' => false, 'force_deactivation' => false, 'external_url' => "", 'is_callable' => "" ), array( 'name' => esc_html__('One Click Demo Import', 'mechano'), 'slug' => 'one-click-demo-import', 'required' => false ), array( 'name' => esc_html__('Elementor - Drag & Drop Page Builder', 'mechano'), 'slug' => 'elementor', 'required' => false ), array( 'name' => esc_html__('Prime Slider - Addon for Elementor', 'mechano'), 'slug' => 'bdthemes-prime-slider-lite', 'required' => false ) ); tgmpa($plugins, $config); } add_action('tgmpa_register', 'mechano_plugins'); /* ============================================================================================================================================= */ /* ============================================================================================================================================= */ // Plugin: "One Click Demo Import". function mechano_ocdi_plugin_page_setup($default_settings) { $default_settings['capability'] = 'import'; $default_settings['parent_slug'] = 'themes.php'; $default_settings['menu_slug'] = 'mechano-import-theme-demos'; $default_settings['menu_title'] = esc_html__('Import Theme Demo' , 'mechano'); $default_settings['page_title'] = esc_html__('One Click Demo Import' , 'mechano'); return $default_settings; } add_filter('ocdi/plugin_page_setup', 'mechano_ocdi_plugin_page_setup'); /* ============================================================================================================================================= */ function mechano_ocdi_plugin_intro_text($default_text) { $default_text .= '<div class="notice notice-warning">'; $default_text .= '<p>'; $default_text .= '<b>' . esc_html__('Warning: ', 'mechano') . '<a target="_blank" href="https://elementor.com/help/requirements/">' . esc_html__('Please check out here for the system requirements you need in order to import demo data.', 'mechano') . '</a> ' . esc_html__('(If you are not sure whether or not your server support this, contact your host.)', 'mechano') . '</b>'; $default_text .= '</p>'; $default_text .= '</div>'; return $default_text; } add_filter('ocdi/plugin_intro_text', 'mechano_ocdi_plugin_intro_text'); /* ============================================================================================================================================= */ function mechano_ocdi_register_plugins($plugins) { $theme_plugins = array( array( 'name' => esc_html__('Pixelwars Core', 'mechano'), 'slug' => 'pixelwars-core', 'description' => esc_html__('Advanced features for Pixelwars themes.', 'mechano'), 'source' => get_template_directory_uri() . '/admin/plugins/pixelwars-core.zip', 'required' => false, 'preselected' => true, ), array( 'name' => esc_html__('Elementor - Drag & Drop Page Builder', 'mechano'), 'slug' => 'elementor', 'description' => esc_html__('Instant drag & drop lets you easily place every element on the page.', 'mechano'), 'required' => false, 'preselected' => true, ), array( 'name' => esc_html__('Prime Slider - Addon for Elementor', 'mechano'), 'slug' => 'bdthemes-prime-slider-lite', 'description' => esc_html__('A fast, fully customizable, functional slider builder.', 'mechano'), 'required' => false, 'preselected' => true, ), array( 'name' => esc_html__('Qi - Addon for Elementor', 'mechano'), 'slug' => 'qi-addons-for-elementor', 'description' => esc_html__('The largest free library of custom and fully flexible Elementor widgets.', 'mechano'), 'required' => false, 'preselected' => true, ), array( 'name' => esc_html__('WPForms Lite - Drag & Drop Form Builder', 'mechano'), 'slug' => 'wpforms-lite', 'description' => esc_html__('Allows you to create beautiful contact forms for your site in minutes.', 'mechano'), 'required' => false, 'preselected' => true, ), array( 'name' => esc_html__('SVG Support', 'mechano'), 'slug' => 'svg-support', 'description' => esc_html__('Safely upload SVG files to your media library and use them like any other image.', 'mechano'), 'required' => false, 'preselected' => true, ), array( 'name' => esc_html__('Envato Market', 'mechano'), 'slug' => 'envato-market', 'description' => esc_html__('This plugin will periodically check for updates, so keeping your theme up to date is as simple as a few clicks.', 'mechano'), 'source' => get_template_directory_uri() . '/admin/plugins/envato-market.zip', 'required' => false, 'preselected' => true, ) ); return array_merge($plugins, $theme_plugins); } add_filter('ocdi/register_plugins', 'mechano_ocdi_register_plugins'); /* ============================================================================================================================================= */ function mechano_ocdi_before_content_import($selected_import) { add_filter('ocdi/regenerate_thumbnails_in_content_import', '__return_false'); } add_action('ocdi/before_content_import', 'mechano_ocdi_before_content_import'); /* ============================================================================================================================================= */ function mechano_ocdi_import_files() { $theme_directory = trailingslashit(get_template_directory()); $theme_directory_url = trailingslashit(get_template_directory_uri()); return array( array( 'import_file_name' => esc_html__('Theme Demo', 'mechano'), 'local_import_file' => $theme_directory . 'admin/demo-data/01/content.xml', 'local_import_widget_file' => $theme_directory . 'admin/demo-data/01/widgets.wie', 'local_import_customizer_file' => $theme_directory . 'admin/demo-data/01/customizer.dat', 'import_preview_image_url' => $theme_directory_url . 'admin/demo-data/01/screenshot.jpg', 'preview_url' => 'https://themes.pixelwars.org/mechano/demo-01/' ), array( 'import_file_name' => esc_html__('Theme Demo Helper', 'mechano'), 'local_import_file' => $theme_directory . 'admin/demo-data/01/content.xml', 'local_import_widget_file' => $theme_directory . 'admin/demo-data/01/widgets.wie', 'local_import_customizer_file' => $theme_directory . 'admin/demo-data/01/customizer.dat', 'import_preview_image_url' => $theme_directory_url . 'admin/demo-data/01/screenshot.jpg', 'preview_url' => 'https://themes.pixelwars.org/mechano/demo-01/' ) ); } add_filter('ocdi/import_files', 'mechano_ocdi_import_files'); /* ============================================================================================================================================= */ function mechano_ocdi_after_import() { // Assign menus to their locations. $main_menu = get_term_by('name', 'MyMenu', 'nav_menu'); set_theme_mod( 'nav_menu_locations', array( 'mechano_theme_menu_location' => $main_menu->term_id, ) ); // Assign Homepage and Blog page. $homepage = get_page_by_title('Home'); // Get homepage. $blog_page = get_page_by_title('News'); // Get blog page. update_option('show_on_front', 'page'); update_option('page_on_front', $homepage->ID); // Set homepage. update_option('page_for_posts', $blog_page->ID); // Set blog page. } add_action('ocdi/after_import', 'mechano_ocdi_after_import');
Submit
FILE
FOLDER
Name
Size
Permission
Action
css
---
0755
demo-data
---
0755
js
---
0755
plugins
---
0755
about-author.php
1412 bytes
0644
admin--class-tgm-plugin-activation.php
126853 bytes
0644
admin--demo-import.php
10565 bytes
0644
admin--help-tab.php
2049 bytes
0644
admin--notice.php
9889 bytes
0644
ajax-loader.gif
4203 bytes
0644
archive-title.php
3072 bytes
0644
automatic-excerpt.php
3257 bytes
0644
content-none.php
1105 bytes
0644
customizer-default-values.php
3280 bytes
0644
customizer-sections.php
8509 bytes
0644
customizer-settings.php
262878 bytes
0644
enqueue-inline-script.php
2601 bytes
0644
enqueue-inline-style.php
66490 bytes
0644
enqueue-styles-scripts.php
13122 bytes
0644
functions-core.php
8160 bytes
0644
functions-layout-grid.php
1082 bytes
0644
functions-layout-regular.php
802 bytes
0644
functions-portfolio.php
2917 bytes
0644
functions-singular.php
13678 bytes
0644
functions-woocommerce.php
4674 bytes
0644
html-attributes.php
18503 bytes
0644
image-sizes.php
1986 bytes
0644
index.php
30 bytes
0644
navigation-archive.php
1231 bytes
0644
navigation-single.php
4441 bytes
0644
override-post-class.php
1447 bytes
0644
override-post-gallery.php
7368 bytes
0644
post-meta.php
7608 bytes
0644
pre-get-posts.php
353 bytes
0644
theme-options.php
11646 bytes
0644
widget_area-register.php
10228 bytes
0644
widget_area-sidebar-archive.php
4224 bytes
0644
widget_area-sidebar-singular.php
7161 bytes
0644
N4ST4R_ID | Naxtarrr