Changeset 1902269
- Timestamp:
- 07/02/2018 03:25:14 AM (8 years ago)
- Location:
- vela-companion/trunk
- Files:
-
- 5 edited
-
assets/js/site-importer.js (modified) (1 diff)
-
inc/pageMetabox/options.php (modified) (1 diff)
-
inc/templates-importer/templates-importer.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
-
vela-companion.php (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vela-companion/trunk/assets/js/site-importer.js
r1902195 r1902269 33 33 dataType: 'json', 34 34 data : { 35 action : ' astra-sites-import-customizer-settings',35 action : 'vela-sites-import-customizer-settings', 36 36 customizer_data : VelaImporter.customizer_data, 37 37 }, -
vela-companion/trunk/inc/pageMetabox/options.php
r1902195 r1902269 10 10 function vela_page_metaboxes( array $meta_boxes ) { 11 11 12 $theme = get_option('stylesheet');12 $theme = VELA_THEME_OPTION_NAME; 13 13 $prefix = '_vela_'; 14 14 if( $theme == 'cactus' || strstr($theme,'cactus') ) -
vela-companion/trunk/inc/templates-importer/templates-importer.php
r1902195 r1902269 26 26 ); 27 27 28 $theme = get_option('stylesheet');28 $theme = VELA_THEME_OPTION_NAME; 29 29 30 30 // Get a SimplePie feed object from the specified feed source. … … 116 116 117 117 } 118 119 /**120 * sites list121 */122 public static function sites(){123 124 $defaults_if_empty = array(125 126 );127 128 $sites_list = array(129 130 131 );132 133 $theme = get_option('stylesheet');134 135 // Get a SimplePie feed object from the specified feed source.136 $options = get_option('vela_companion_options',VelaCompanion::default_options());137 $license_key = isset($options['license_key'])?$options['license_key']:'';138 139 $feed_url = 'https://velathemes.com/api/sites-importer-api/?license_key='.$license_key.'&theme='.$theme;140 141 142 delete_transient('feed_' . md5($feed_url));143 delete_transient('feed_mod_' . md5($feed_url));144 145 $rss = fetch_feed( $feed_url );146 147 $maxitems = 0;148 149 if ( ! is_wp_error( $rss ) ) :150 151 $maxitems = $rss->get_item_quantity( 50 );152 153 $rss_items = $rss->get_items( 0, $maxitems );154 155 endif;156 157 if ( $maxitems == 0 ) :158 159 else :160 161 foreach ( $rss_items as $item ) :162 163 $template = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'template');164 $title = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'title');165 $description = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'description');166 $image = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'image');167 $siteid = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'siteid');168 $demo = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'demo');169 $plugins = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'plugins');170 $pro = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'pro');171 $options = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'options');172 $wxr = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'wxr');173 $widgets = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'widgets');174 $customizer = $item->get_item_tags(SIMPLEPIE_NAMESPACE_RSS_20, 'customizer');175 176 $required_plugins = array('name' => __( 'Elementor Page Builder', 'vela-companion' ),'slug' => 'elementor', "init" => "elementor/elementor.php");177 178 179 if(isset($plugins[0]['data']) && $plugins[0]['data']!=''){180 $my_plugins = @json_decode($plugins[0]['data'], true);181 if( is_array($my_plugins) ){182 $required_plugins = $my_plugins;183 }184 185 }186 187 if(!($siteid)){188 $siteid = sanitize_title($title[0]['data']);189 }else{190 $siteid = sanitize_title($siteid[0]['data']);191 }192 if(isset($title[0]['data'])){193 $sites_list[$siteid] = array(194 'title' => $title[0]['data'],195 'description' => $description[0]['data'],196 'demo' => urldecode($demo[0]['data']),197 'screenshot' => urldecode($image[0]['data']),198 'wxr' => urldecode($wxr[0]['data']),199 'required_plugins' => $required_plugins,200 'pro' => $pro[0]['data'],201 'options' => $options[0]['data'],202 'widgets' => $widgets[0]['data'],203 'customizer' => $customizer[0]['data'],204 );205 }206 207 endforeach;208 endif;209 210 211 return apply_filters( 'vela_elementor_sites_list', $sites_list );212 213 }214 215 /**216 * Import wxr217 */218 private static function import_wxr($xml_file){219 220 include(dirname(__FILE__).'/wordpress-importer.php');221 if ( file_exists($xml_file) && class_exists( 'Vela_Import' ) ) {222 $importer = new Vela_Import();223 $importer->fetch_attachments = false;224 ob_start();225 $importer->import($xml_file);226 ob_end_clean();227 228 flush_rewrite_rules();229 230 }231 232 }233 118 234 119 /** … … 240 125 include 'template-directory-tpl.php'; 241 126 } 242 243 public static function render_sites_page() {244 245 $sites_array = VelaTemplater::sites();246 include 'sites-directory-tpl.php';247 }248 249 250 127 251 128 /** -
vela-companion/trunk/readme.txt
r1902195 r1902269 12 12 == Description == 13 13 14 Theme options for Vela theme s.14 Theme options for Vela theme. 15 15 16 16 == Installation == … … 33 33 == Changelog == 34 34 35 = 1.0.1 = 35 = 1.0.5 = 36 * Fixed plugin Active button issue 37 38 = 1.0.4 = 39 * Added License Key option 40 41 = 1.0.3 = 42 * Added template > Vela Frontpage 2 36 43 37 44 == Upgrade Notice == -
vela-companion/trunk/vela-companion.php
r1902195 r1902269 28 28 { 29 29 30 $theme = get_option('stylesheet');30 $theme = wp_get_theme(); 31 31 $prefix = 'vela_'; 32 if( $theme == 'cactus' || strstr($theme,'cactus') ) 32 33 $option_name = $theme->get( 'Template' ); 34 if( $option_name == '' ) 35 $option_name = $theme->get( 'TextDomain' ); 36 37 define( 'VELA_THEME_OPTION_NAME', sanitize_title($option_name) ); 38 39 if( VELA_THEME_OPTION_NAME == 'cactus' || strstr(VELA_THEME_OPTION_NAME,'cactus') ){ 33 40 $prefix = 'cactus_'; 34 if( $theme == 'astore' || strstr($theme,'astore') ) 41 } 42 if( VELA_THEME_OPTION_NAME == 'astore' || strstr(VELA_THEME_OPTION_NAME,'astore') ){ 35 43 $prefix = 'astore_'; 44 45 } 46 47 36 48 37 49 register_activation_hook( __FILE__, array(&$this ,'plugin_activate') ); … … 317 329 wp_enqueue_style( 'wp-color-picker' ); 318 330 319 $theme = get_option('stylesheet');331 $theme = VELA_THEME_OPTION_NAME; 320 332 321 333 if(isset($_GET['page']) && $_GET['page']=='vela-template'){ … … 407 419 408 420 global $post; 409 $theme = get_option('stylesheet');421 $theme = VELA_THEME_OPTION_NAME; 410 422 $prefix = '_vela_'; 411 423 $prefix2 = 'vela_'; … … 461 473 } 462 474 463 $theme = get_option('stylesheet');475 $theme = VELA_THEME_OPTION_NAME; 464 476 $prefix = '_vela_'; 465 477 $prefix2 = 'vela_'; … … 678 690 global $post; 679 691 680 $theme = get_option('stylesheet');692 $theme = VELA_THEME_OPTION_NAME; 681 693 $prefix = '_vela_'; 682 694 if( $theme == 'cactus' || strstr($theme,'cactus') ) … … 703 715 global $post; 704 716 705 $theme = get_option('stylesheet');717 $theme = VELA_THEME_OPTION_NAME; 706 718 $prefix = '_vela_'; 707 719 if( $theme == 'cactus' || strstr($theme,'cactus') ) … … 732 744 global $post; 733 745 734 $theme = get_option('stylesheet');746 $theme = VELA_THEME_OPTION_NAME; 735 747 $prefix = '_vela_'; 736 748 if( $theme == 'cactus' || strstr($theme,'cactus') )
Note: See TracChangeset
for help on using the changeset viewer.