uawdijnntqw1x1x1
IP : 216.73.217.174
Hostname : mailtech.lifestyleretreats.com
Kernel : Linux mailtech.lifestyleretreats.com 3.10.0-1160.119.1.vz7.224.4 #1 SMP Mon Sep 30 15:36:27 MSK 2024 x86_64
Disable Function : exec,passthru,shell_exec,system
OS : Linux
PATH:
/
home
/
lrindo5
/
pelican.lrindo.com
/
wp-content
/
themes
/
ize_master_theme
/
inc
/
extras.php
/
/
<?php /** * Custom functions that act independently of the theme templates * * Eventually, some of the functionality here could be replaced by core features. * * @package IZE_Master_Theme */ /** * Adds custom classes to the array of body classes. * * @param array $classes Classes for the body element. * @return array */ function ize_master_theme_body_classes( $classes ) { // Adds a class of group-blog to blogs with more than 1 published author. if ( is_multi_author() ) { $classes[] = 'group-blog'; } // Adds a class of hfeed to non-singular pages. if ( ! is_singular() ) { $classes[] = 'hfeed'; } return $classes; } add_filter( 'body_class', 'ize_master_theme_body_classes' ); /** * Add a pingback url auto-discovery header for singularly identifiable articles. */ function ize_master_theme_pingback_header() { if ( is_singular() && pings_open() ) { echo '<link rel="pingback" href="', esc_url( get_bloginfo( 'pingback_url' ) ), '">'; } } add_action( 'wp_head', 'ize_master_theme_pingback_header' ); /** * Customize Post Table */ function bs_event_table_head( $defaults ) { $new = array(); $new['thumbnail'] = 'Thumbnail'; $new['title_image'] = 'Title'; $new['category'] = 'Category'; $new['type'] = 'Type'; return $new; } add_filter('manage_ize_gallery_posts_columns', 'bs_event_table_head'); /** * Add Content to Custom Column */ function bs_event_table_content( $column_name, $post_id ) { $just = CFS()->get('type', $post_id, array('format' => 'raw')); $image_id = get_post_thumbnail_id( $post_id ); if ($column_name == 'thumbnail') { $image_url = get_template_directory_uri() . '/assets/images/placeholder.jpg'; if($just[0] == 'video'){ $thumbnail = CFS()->get('video_thumbnail', $post_id ); if( $thumbnail !== ''){ $image_url = $thumbnail; } else { $url = CFS()->get('video_link', $post_id ); parse_str( parse_url( $url, PHP_URL_QUERY ), $my_array_of_vars ); $id = $my_array_of_vars['v']; echo $id; $field_data = array( 'video_thumbnail' => 'https://i1.ytimg.com/vi/'.$id.'/0.jpg', 'id_video' => $id ); $post_data = array( 'ID' => $post_id ); // the ID is required CFS()->save( $field_data, $post_data); $image_url = 'https://i1.ytimg.com/vi/'.$id.'/0.jpg'; } } elseif ($just[0] == 'html') { $image_url = get_template_directory_uri() . '/assets/images/placeholder.jpg'; } else { if( (int)$image_id != 0 ) { $image_url = wp_get_attachment_image_src( (int)$image_id, 'thumbnail' )[0]; } } echo '<img src="'.$image_url.'" width="75" height="75" />'; } if ($column_name == 'title_image') { echo (get_the_title($post_id) != '' ) ? get_the_title($post_id) : get_the_title($image_id); } if( $column_name == 'category' ) { echo get_the_terms( $post_id, 'gallery_cat' ) ? get_the_terms( $post_id, 'gallery_cat' )[0]->name : '-'; } if ($column_name == 'type') { foreach ( $just as $key => $label ) { echo $label; } } // if($column_name == 'image_size') { // $image_size = '-'; // if( (int)$image_id != 0 ) { // $image_size = wp_get_attachment_image_src( (int)$image_id, 'full' )[1].'x'.wp_get_attachment_image_src( (int)$image_id, 'full' )[2]; // } // echo $image_size; // } } add_action( 'manage_ize_gallery_posts_custom_column', 'bs_event_table_content', 10, 2 ); // To make column sortable add_filter( 'manage_ize_gallery_sortable_columns', 'bs_event_table_sorting' ); function bs_event_table_sorting( $columns ) { $columns['category'] = 'Category'; return $columns; } function custom_ize_group($tabs) { $tabs[] = array( 'title' => __('IZE Widget', 'ize'), 'filter' => array( 'groups' => array('ize') ) ); return $tabs; } add_filter('siteorigin_panels_widget_dialog_tabs', 'custom_ize_group', 20); // Function that outputs the contents of the dashboard widget function dashboard_widget_function( $post, $callback_args ) { ob_start(); ?> <p> Setting up the THEME </p> <ol> <li>Make sure wordpress instalation is fresh / delete all post, page, menu before doing setup</li> <li>Make sure you have installed all plugin required by the theme</li> <li>install manualy plugin WPML, we can't do this automatically because of pro version plugin and need license</li> <li>Click <a href="#" class="import-cfs-button">this</a> once, and wait an alert say "Succesfull Import" <input type="hidden" name="importCFS" value="[{"post_title":"Page Images","post_name":"page-images","cfs_extras":{"order":"0","context":"normal","hide_editor":"0"},"cfs_fields":[{"id":14,"name":"show_header_image","label":"Show Header Image","type":"true_false","notes":"","parent_id":0,"weight":0,"options":{"message":"Check this to show header image","required":"0"}},{"id":"1","name":"images","label":"Images","type":"loop","notes":"","parent_id":0,"weight":1,"options":{"row_display":"0","row_label":"Image","button_label":"Add an Image","limit_min":"0","limit_max":"10"}},{"id":"2","name":"image","label":"Image","type":"file","notes":"","parent_id":1,"weight":2,"options":{"file_type":"image","return_value":"id","required":"0"}},{"id":15,"name":"image_text","label":"Image Text","type":"text","notes":"Leave this empty to not showing any text into the header image, only worked on homepage.","parent_id":1,"weight":3,"options":{"default_value":"","required":"0"}}],"cfs_rules":{"post_types":{"operator":"==","values":["post","page","room","special_offer"]}}},{"post_title":"Room Fields","post_name":"room-fields","cfs_extras":{"order":"-1","context":"normal","hide_editor":"0"},"cfs_fields":[{"id":"3","name":"room_size","label":"Room Size","type":"text","notes":"*40sqm","parent_id":0,"weight":0,"options":{"default_value":"","required":"0"}},{"id":"9","name":"floor_plan","label":"Floor Plan","type":"file","notes":"","parent_id":0,"weight":1,"options":{"file_type":"image","return_value":"url","required":"0"}},{"id":"10","name":"gallery_select","label":"Gallery Select","type":"term","notes":"","parent_id":0,"weight":2,"options":{"taxonomies":["gallery_cat"],"limit_min":"","limit_max":""}},{"id":"6","name":"special_offer","label":"Special Offer","type":"wysiwyg","notes":"","parent_id":0,"weight":3,"options":{"formatting":"default","required":"0"}},{"id":"13","name":"booking_button","label":"Booking Button","type":"hyperlink","notes":"leave empty to not showing this button","parent_id":0,"weight":4,"options":{"format":"php"}},{"id":"4","name":"room_features","label":"Room Features","type":"loop","notes":"","parent_id":0,"weight":5,"options":{"row_display":"0","row_label":"Room Features","button_label":"Add New","limit_min":"","limit_max":""}},{"id":"11","name":"icon","label":"icon","type":"file","notes":"","parent_id":4,"weight":6,"options":{"file_type":"image","return_value":"id","required":"0"}},{"id":"12","name":"text","label":"text","type":"text","notes":"","parent_id":4,"weight":7,"options":{"default_value":"","required":"0"}},{"id":"5","name":"amenities","label":"Amenities","type":"loop","notes":"","parent_id":0,"weight":8,"options":{"row_display":"0","row_label":"Amenities Content","button_label":"Add New","limit_min":"","limit_max":""}},{"id":"7","name":"icon","label":"icon","type":"file","notes":"","parent_id":5,"weight":9,"options":{"file_type":"image","return_value":"id","required":"0"}},{"id":"8","name":"text","label":"text","type":"text","notes":"","parent_id":5,"weight":10,"options":{"default_value":"","required":"0"}}],"cfs_rules":{"post_types":{"operator":"==","values":["room"]}}},{"post_title":"special offer link","post_name":"special-offer-link","cfs_extras":{"order":"0","context":"normal","hide_editor":"0"},"cfs_fields":[{"id":"16","name":"special_offer_link","label":"Special Offer Link","type":"hyperlink","notes":"","parent_id":0,"weight":0,"options":{"format":"php"}}],"cfs_rules":{"post_types":{"operator":"==","values":["special_offer"]}}},{"post_title":"Location","post_name":"location","cfs_extras":{"order":"0","context":"normal","hide_editor":"0"},"cfs_fields":[{"id":17,"name":"place_name","label":"Place Name","type":"text","notes":"","parent_id":0,"weight":0,"options":{"default_value":"","required":"0"}},{"id":18,"name":"latitude","label":"Latitude","type":"text","notes":"","parent_id":0,"weight":1,"options":{"default_value":"","required":"0"}},{"id":19,"name":"longtitude","label":"longtitude","type":"text","notes":"","parent_id":0,"weight":2,"options":{"default_value":"","required":"0"}},{"id":20,"name":"place_description","label":"Place Description","type":"wysiwyg","notes":"","parent_id":0,"weight":3,"options":{"formatting":"default","required":"0"}},{"id":21,"name":"get_direction","label":"Get Direction Link","type":"text","notes":"","parent_id":0,"weight":4,"options":{"default_value":"","required":"0"}}],"cfs_rules":{"post_types":{"operator":"==","values":["location_custom"]}}},{"post_title":"gallery","post_name":"gallery","cfs_extras":{"order":"0","context":"normal","hide_editor":"0"},"cfs_fields":[{"id":"22","name":"alt_image","label":"alt","type":"text","notes":"","parent_id":0,"weight":0,"options":{"default_value":"","required":"0"}},{"id":"23","name":"description_image","label":"description","type":"textarea","notes":"","parent_id":0,"weight":1,"options":{"default_value":"","formatting":"auto_br","required":"0"}},{"id":"24","name":"type","label":"type","type":"select","notes":"","parent_id":0,"weight":2,"options":{"choices":{"image":"Image","video":"Video","html":"HTML"},"multiple":"0","select2":"0","required":"0"}},{"id":"25","name":"video_link","label":"Video Link","type":"text","notes":"make sure the video source is from youtube, just insert the link.\r\nexample : https:\/\/www.youtube.com\/watch?v=3tmd-ClpJxA","parent_id":0,"weight":3,"options":{"default_value":"","required":"0"}},{"id":"27","name":"video_thumbnail","label":"Video Thumbnail","type":"text","notes":"leave this empty, it will generate thumbnail automatically after this item is published","parent_id":0,"weight":4,"options":{"default_value":"","required":"0"}},{"id":28,"name":"id_video","label":"ID Video","type":"text","notes":"keep this empty, it will generate automatically","parent_id":0,"weight":5,"options":{"default_value":"","required":"0"}},{"id":"26","name":"html","label":"HTML","type":"textarea","notes":"you can insert html here, like iframe or custom html element.","parent_id":0,"weight":6,"options":{"default_value":"","formatting":"none","required":"0"}}],"cfs_rules":{"post_types":{"operator":"==","values":["ize_gallery"]}}}]"> </li> <li>Download <a href="/wp-content/themes/ize_master_theme/plugins/import.xml" class="import-xml-button">this</a> file, and go to Tools -> Import -> wordpress importer -> run import -> upload the file -> check "Download Media and Attachment" </li> <li> Copy this code below to Theme Option -> Export Import -> import from file, and fill the field with the code. *make sure you copy all of the code below <textarea readonly style="width:100%;height:200px;resize:none;">{"last_tab":"1","opt-navbar-logo":{"url":"/wp-content/uploads/2017/08/logo-ize.png","id":"28","height":"543","width":"800","thumbnail":"/wp-content/uploads/2017/08/logo-ize-150x150.png"},"opt-navbar-logo-loader":{"url":"/wp-content/uploads/2017/09/ize-seminyak.jpeg","id":"410","height":"300","width":"300","thumbnail":"/wp-content/uploads/2017/09/ize-seminyak-150x150.jpeg"},"opt-favicon":{"url":"/wp-content/uploads/2017/08/favicon-ize.png","id":"30","height":"27","width":"50","thumbnail":"/wp-content/uploads/2017/08/favicon-ize-10x10.png"},"opt-btnbook-color":"#00a1da","opt-btnbook-backcolor":"transparent","opt-use-custom-body-paragrap-font":"","opt-typography-body":{"font-family":"Open Sans","font-options":"","google":"1","font-weight":"Normal 400","font-style":"","subsets":"","text-align":"","font-size":"15px","color":"#464646"},"opt-use-custom-body-heading-font":"","opt-typography-heading":{"font-family":"Open Sans","font-options":"","google":"1","font-weight":"Normal 400","font-style":"","subsets":"","color":"#464646"},"opt-use-custom-body-link-font":"","opt-typography-link":{"font-family":"Open Sans","font-options":"","google":"1","font-weight":"Normal 400","font-style":"","subsets":""},"opt-enable-facebook":"1","opt-facebook-url":"https://www.facebook.com/IzeSeminyak","opt-enable-twitter":"","opt-twitter-url":"https://twitter.com","opt-enable-google-plus":"","opt-google-plus-url":"https://plus.google.com","opt-enable-instagram":"1","opt-instagram-url":"https://www.instagram.com/lifestyleretreats/","opt-enable-youtube":"1","opt-youtube-url":"https://youtube.com","opt-enable-linkedin":"","opt-linkedin-url":"https://linkedin.com","opt-enable-pinterest":"","opt-pinterest-url":"https://pinterest.com","opt-intro-text":"","opt-booking-title":"Book Now","opt-booking-btntext":"CHECK AVAILABILITY","opt-booking-btnsubtext":"BEST PRICE GUARANTEED","opt-booking-childvalid":"Valid for age > 16","opt-booking-check-special-offer-link":"#specialoffer","opt-booking-check-special-offer-link-text":"Check Special Offers","opt-company-name":"IZE SEMINYAK","opt-email":"bliss@ize-seminyak.com","opt-phone":"+62-361 84 66 999","opt-address":"Jalan Kayu Aya (Laksmana - Oberoi) No. 68\r\nSeminyak, Bali - Indonesia","opt-menu-list":"<ul class=\"menu-footer\">\r\n<li><a href=\"/about-us/\">ABOUT</a></li>\r\n<li><a href=\"#\">REWARDS</a></li>\r\n<li><a href=\"#\">CAREERS</a></li>\r\n<li><a href=\"/contact\">CONTACT US</a></li>\r\n</ul>","opt-custom-css":"","opt-head-code":"","opt-footer-code":"","opt-enable-bootstrap":"1","opt-enable-font-awesome":"1","opt-enable-lazy-load":"","opt-lazy-load-blur":"1","opt-enable-pace-js":"1","opt-enable-animate-css":"1","opt-enable-owl-carousel":"1","opt-owl-carousel":"","opt-enable-js-match-height":"enable","opt-js-match-height-selector":[""],"opt-location-title-content":"Our Location","opt-location-desc-content":"Lorem ipsum dolor sit amet, quaeque aliquid vim ex. Eu doming dolorem vel, te corpora dignissim interesset pri. Mea ut vidisse labores intellegebat, qui everti urbanitas intellegam ei","opt-location-discover-title":"Discover Bali","opt-loc-lat":"-8.684196","opt-loc-long":"115.1584383","opt-loc-title":"IZE SEMINYAK","opt-loc-description":"Jalan Kayu Aya (Laksmana – Oberoi) No. 68 Seminyak, Bali – Indonesia","opt-loc-link":"https://goo.gl/maps/EWRvDzgMtx12","opt-location-icon":{"url":"/wp-content/uploads/2017/10/ize-map-pin-small.png","id":"487","height":"64","width":"45","thumbnail":"/wp-content/uploads/2017/10/ize-map-pin-small-10x10.png"},"opt-footer-logo":{"url":"/wp-content/uploads/2017/08/logo-ize.png","id":"28","height":"543","width":"800","thumbnail":"/wp-content/uploads/2017/08/logo-ize-150x150.png"},"opt-copyright-text":"©[current-year] Lifestyle Retreats Pte Ltd. All rights reserved.","opt-developer-signature":"2017","opt-footer-logo-1":{"url":"/wp-content/uploads/2017/09/logo-lifestyle.png","id":"248","height":"23","width":"152","thumbnail":"/wp-content/uploads/2017/09/logo-lifestyle-150x23.png"},"opt-footer-logo-link-1":"http://www.lifestyleretreats.com","opt-footer-logo-2":{"url":"/wp-content/uploads/2017/09/logo-thebale.png","id":"247","height":"26","width":"101","thumbnail":"/wp-content/uploads/2017/09/logo-thebale-10x10.png"},"opt-footer-logo-link-2":"http://www.thebale.com","opt-footer-logo-3":{"url":"/wp-content/uploads/2017/09/logo-theamalia.png","id":"246","height":"25","width":"128","thumbnail":"/wp-content/uploads/2017/09/logo-theamalia-10x10.png"},"opt-footer-logo-link-3":"http://www.theamala.com/","opt-footer-logo-4":{"url":"/wp-content/uploads/2017/09/logo-themenjangan.png","id":"245","height":"25","width":"185","thumbnail":"/wp-content/uploads/2017/09/logo-themenjangan-150x25.png"},"opt-footer-logo-link-4":"http://www.themenjangan.com/","opt-footer-logo-5":{"url":"/wp-content/uploads/2017/09/logo-ize.png","id":"244","height":"30","width":"44","thumbnail":"/wp-content/uploads/2017/09/logo-ize-10x10.png"},"opt-footer-logo-link-5":"http://www.ize-seminyak.com/","opt-footer-logo-6":{"url":"/wp-content/uploads/2017/09/logo-thesantai.png","id":"243","height":"24","width":"123","thumbnail":"/wp-content/uploads/2017/09/logo-thesantai-10x10.png"},"opt-footer-logo-link-6":"http://www.thesantai.com/","opt-footer-logo-7":{"url":"/wp-content/uploads/2017/09/logo-thesamata.png","id":"242","height":"24","width":"137","thumbnail":"/wp-content/uploads/2017/09/logo-thesamata-10x10.png"},"opt-footer-logo-link-7":"http://www.thesamata.com/","opt-owl-carousel-page":"","opt-owl-carousel-custom-post":"","redux_import_export":"","redux-backup":1}</textarea> </li> </ol> <?php echo ob_get_clean(); } // Function used in the action hook function add_dashboard_widgets() { wp_add_dashboard_widget('dashboard_widget', 'SETUP THEME', 'dashboard_widget_function'); } // Register the new dashboard widget with the 'wp_dashboard_setup' action add_action('wp_dashboard_setup', 'add_dashboard_widgets' );
/home/lrindo5/pelican.lrindo.com/wp-content/themes/ize_master_theme/inc/extras.php