Changeset 2767123
- Timestamp:
- 08/06/2022 04:09:09 AM (4 years ago)
- Location:
- themefarmer-companion/trunk
- Files:
-
- 12 added
- 3 edited
-
inc/class-themefarmer-wc-widget-products.php (added)
-
inc/functions.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
theme-files/demos/storez (added)
-
theme-files/demos/storez/images (added)
-
theme-files/demos/storez/images/banner1.jpg (added)
-
theme-files/demos/storez/images/banner2.jpg (added)
-
theme-files/demos/storez/images/banner3.jpg (added)
-
theme-files/demos/storez/images/logo.png (added)
-
theme-files/demos/storez/images/logo1.png (added)
-
theme-files/demos/storez/images/slide1-left-img.jpg (added)
-
theme-files/demos/storez/images/slide2-left-img.jpg (added)
-
theme-files/demos/storez/images/slide3-left-img.jpg (added)
-
theme-files/storez-functions.php (added)
-
themefarmer-companion.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
themefarmer-companion/trunk/inc/functions.php
r2016334 r2767123 5 5 <div class="themefarmer-basic-icon-panel-overlay" style="display: none;"> 6 6 <div class="themefarmer-basic-icon-panel"> 7 <button type="button" class="media-modal-close"><span class="media-modal-icon"> x<span class="screen-reader-text"><?php esc_html_e('Close media panel', 'themefarmer-companion'); ?></span></span></button>7 <button type="button" class="media-modal-close"><span class="media-modal-icon"><span class="screen-reader-text"><?php esc_html_e('Close media panel', 'themefarmer-companion'); ?></span></span></button> 8 8 <div class="tf-icon-panel-title"><?php esc_html_e('Select Icon', 'themefarmer-companion'); ?></div> 9 9 <div class="tf-icon-search-bar"><input type="search" id="tf-search-menu-icon" placeholder="<?php esc_html_e('Search Icon'); ?>"></div> -
themefarmer-companion/trunk/readme.txt
r2442002 r2767123 3 3 Tags: ThemeFarmer Companion, ThemeFarmer, Slider, Testimonial, Team 4 4 Requires at least: 4.0 5 Tested up to: 5.65 Tested up to: 6.0 6 6 Stable tag: trunk 7 7 Requires PHP: 5.4 -
themefarmer-companion/trunk/themefarmer-companion.php
r2442002 r2767123 6 6 Author URI: https://www.themefarmer.com/ 7 7 Domain Path: /lang/ 8 Version: 1.3. 28 Version: 1.3.3 9 9 Text Domain: themefarmer-companion 10 10 … … 30 30 define('THEMEFARMER_COMPANION_DIR', plugin_dir_path(__FILE__)); 31 31 define('THEMEFARMER_COMPANION_URI', plugin_dir_url(__FILE__)); 32 define('THEMEFARMER_COMPANION_VAR', '1.3. 2');32 define('THEMEFARMER_COMPANION_VAR', '1.3.3'); 33 33 34 34 function themefarmer_companion_init() { … … 38 38 add_action('plugins_loaded', 'themefarmer_companion_init'); 39 39 40 function themefarmer_is_this_themefarmer_theme() {41 $theme = wp_get_theme();40 function themefarmer_is_this_themefarmer_theme() { 41 $theme = wp_get_theme(); 42 42 $tf_themes = array( 43 43 'Scope', … … 51 51 } 52 52 53 function themefarmer_is_this_themefarmer_theme2() {54 $theme = wp_get_theme();53 function themefarmer_is_this_themefarmer_theme2() { 54 $theme = wp_get_theme(); 55 55 $tf_themes = array( 56 56 'NewStore', … … 83 83 } 84 84 85 86 87 function themefarmer_companion_loader() { 85 $theme = wp_get_theme(); 86 if ($theme->name === 'StoreZ' || $theme->parent_theme === 'StoreZ') { 87 if (!class_exists('ThemeFarmer_Load_Fields')) { 88 require_once trailingslashit(THEMEFARMER_COMPANION_DIR) . 'fields/fields-init.php'; 89 } 90 require_once trailingslashit(THEMEFARMER_COMPANION_DIR) . 'theme-files/storez-functions.php'; 91 require_once trailingslashit(THEMEFARMER_COMPANION_DIR) . 'inc/class-themefarmer-menu-icon-walker.php'; 92 if (class_exists('WooCommerce')) { 93 require_once trailingslashit(THEMEFARMER_COMPANION_DIR) . 'inc/class-themefarmer-wc-widget-products.php'; 94 } 95 } 96 97 function themefarmer_companion_loader() { 88 98 require_once trailingslashit(THEMEFARMER_COMPANION_DIR) . 'inc/functions.php'; 89 99 } … … 106 116 } 107 117 118 if ($theme->name === 'StoreZ' || $theme->parent_theme === 'StoreZ') { 119 define('THEMEFARMER_COMPANION_PRO_LINK', 'https://themefarmer.com/product/storez-pro/'); 120 } 121 108 122 } 109 123 add_action('init', 'themefarmer_theme_releted_func_init'); … … 114 128 } 115 129 } 116 117 130 118 131 function themefarmer_companion_front_scripts() { … … 124 137 add_action('wp_enqueue_scripts', 'themefarmer_companion_front_scripts'); 125 138 126 139 function themefarmer_companion_storez_activation() { 140 $imgsDir = trailingslashit(THEMEFARMER_COMPANION_DIR) . 'theme-files/demos/storez/images/'; 141 142 $uploadImgs = array( 143 $imgsDir . 'logo.png', 144 $imgsDir . 'banner1.jpg', 145 $imgsDir . 'banner2.jpg', 146 $imgsDir . 'banner3.jpg', 147 $imgsDir . 'slide1-left-img.jpg', 148 $imgsDir . 'slide2-left-img.jpg', 149 $imgsDir . 'slide3-left-img.jpg', 150 ); 151 152 $parent_id = null; 153 foreach ($uploadImgs as $imgUp) { 154 $filename = basename($imgUp); 155 $upload_file = wp_upload_bits($filename, null, file_get_contents($imgUp)); 156 if (!$upload_file['error']) { 157 $wp_filetype = wp_check_filetype($filename, null); 158 $attachment = array( 159 'post_mime_type' => $wp_filetype['type'], 160 'post_parent' => $parent_id, 161 'post_title' => preg_replace('/\.[^.]+$/', '', $filename), 162 'post_excerpt' => '', 163 'post_status' => 'inherit', 164 ); 165 $ImageId[] = $attachment_id = wp_insert_attachment($attachment, $upload_file['file'], $parent_id); 166 167 if (!is_wp_error($attachment_id)) { 168 require_once ABSPATH . "wp-admin" . '/includes/image.php'; 169 $attachment_data = wp_generate_attachment_metadata($attachment_id, $upload_file['file']); 170 wp_update_attachment_metadata($attachment_id, $attachment_data); 171 } 172 } 173 174 } 175 update_option('storez_media_upload_ids', $ImageId); 176 } 127 177 128 178 function themefarmer_companion_activation() { 129 if (themefarmer_is_this_themefarmer_theme() || themefarmer_is_this_themefarmer_theme2()) { 179 $theme = wp_get_theme(); 180 if (themefarmer_is_this_themefarmer_theme() || themefarmer_is_this_themefarmer_theme2() || $theme->name === 'StoreZ' || $theme->parent_theme === 'StoreZ') { 130 181 131 182 $front_page = get_option('show_on_front'); … … 166 217 } 167 218 168 if (themefarmer_is_this_themefarmer_theme2()){169 $page_home = get_page_by_path('home');170 if ( absint( $page_home) > 0) {171 update_post_meta( $page_home, '_wp_page_template', 'templates/frontpage.php');219 if (themefarmer_is_this_themefarmer_theme2() || $theme->name === 'StoreZ' || $theme->parent_theme === 'StoreZ') { 220 $page_home = get_page_by_path('home'); 221 if (!empty($page_home) && absint($page_home->ID) > 0) { 222 update_post_meta($page_home->ID, '_wp_page_template', 'templates/frontpage.php'); 172 223 } 173 224 } 174 225 226 if ($theme->name === 'StoreZ' || $theme->parent_theme === 'StoreZ') { 227 themefarmer_companion_storez_activation(); 228 } 229 175 230 flush_rewrite_rules(); 176 231 }
Note: See TracChangeset
for help on using the changeset viewer.