文件操作 - single.php
返回文件管理
返回主菜单
删除本文件
文件: /var/www/vec.uaysen.cl/html/wp-content/themes/E17/single.php
编辑文件内容
<?php function nutritius_ocdi_import_files() { return array( array( 'import_file_name' => 'Holozoic Nutrition', 'categories' => array( 'LTR' ), 'local_import_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('xml','xml'), 'local_import_widget_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('wie','wie'), 'local_import_customizer_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('dat','dat'), 'local_import_redux' => array( array( 'file_path' => Pcfq_Theme_Helper::pcfq_demo_file_path('json','json'), 'option_name' => 'pqf_options', ), ), 'import_preview_image_url' => Pcfq_Theme_Helper::pcfq_demo_prev_img_url('prv-1','jpg'), 'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'nutritius' ), 'preview_url' => 'https://nutritius.peacefulqode.com/', ), array( 'import_file_name' => 'Saprophytic Nutrition', 'categories' => array( 'LTR' ), 'local_import_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('xml','xml'), 'local_import_widget_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('wie','wie'), 'local_import_customizer_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('dat','dat'), 'local_import_redux' => array( array( 'file_path' => Pcfq_Theme_Helper::pcfq_demo_file_path('json','json'), 'option_name' => 'pqf_options', ), ), 'import_preview_image_url' => Pcfq_Theme_Helper::pcfq_demo_prev_img_url('prv-2','jpg'), 'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'nutritius' ), 'preview_url' => 'https://nutritius.peacefulqode.com/saprophytic-nutrition/', ), array( 'import_file_name' => 'Parasitic Nutrition', 'categories' => array( 'LTR' ), 'local_import_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('xml','xml'), 'local_import_widget_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('wie','wie'), 'local_import_customizer_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('dat','dat'), 'local_import_redux' => array( array( 'file_path' => Pcfq_Theme_Helper::pcfq_demo_file_path('json','json'), 'option_name' => 'pqf_options', ), ), 'import_preview_image_url' => Pcfq_Theme_Helper::pcfq_demo_prev_img_url('prv-3','jpg'), 'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'nutritius' ), 'preview_url' => 'https://nutritius.peacefulqode.com/parasitic-nutrition/', ), array( 'import_file_name' => 'Macronutrients', 'categories' => array( 'LTR' ), 'local_import_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('xml','xml'), 'local_import_widget_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('wie','wie'), 'local_import_customizer_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('dat','dat'), 'local_import_redux' => array( array( 'file_path' => Pcfq_Theme_Helper::pcfq_demo_file_path('json','json'), 'option_name' => 'pqf_options', ), ), 'import_preview_image_url' => Pcfq_Theme_Helper::pcfq_demo_prev_img_url('prv-4','jpg'), 'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'nutritius' ), 'preview_url' => 'https://nutritius.peacefulqode.com/macronutrients/', ), array( 'import_file_name' => 'Micronutrients', 'categories' => array( 'LTR' ), 'local_import_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('xml','xml'), 'local_import_widget_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('wie','wie'), 'local_import_customizer_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('dat','dat'), 'local_import_redux' => array( array( 'file_path' => Pcfq_Theme_Helper::pcfq_demo_file_path('json','json'), 'option_name' => 'pqf_options', ), ), 'import_preview_image_url' => Pcfq_Theme_Helper::pcfq_demo_prev_img_url('prv-5','jpg'), 'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'nutritius' ), 'preview_url' => 'https://nutritius.peacefulqode.com/micronutrients/', ), array( 'import_file_name' => 'Carbohydrates', 'categories' => array( 'LTR' ), 'local_import_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('xml','xml'), 'local_import_widget_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('wie','wie'), 'local_import_customizer_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('dat','dat'), 'local_import_redux' => array( array( 'file_path' => Pcfq_Theme_Helper::pcfq_demo_file_path('json','json'), 'option_name' => 'pqf_options', ), ), 'import_preview_image_url' => Pcfq_Theme_Helper::pcfq_demo_prev_img_url('prv-6','jpg'), 'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'nutritius' ), 'preview_url' => 'https://nutritius.peacefulqode.com/carbohydrates/', ), array( 'import_file_name' => 'Leading Nutrition', 'categories' => array( 'LTR' ), 'local_import_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('xml','xml'), 'local_import_widget_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('wie','wie'), 'local_import_customizer_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('dat','dat'), 'local_import_redux' => array( array( 'file_path' => Pcfq_Theme_Helper::pcfq_demo_file_path('json','json'), 'option_name' => 'pqf_options', ), ), 'import_preview_image_url' => Pcfq_Theme_Helper::pcfq_demo_prev_img_url('prv-7','jpg'), 'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'nutritius' ), 'preview_url' => 'https://nutritius.peacefulqode.com/leading-nutrition/', ), array( 'import_file_name' => 'Holistic', 'categories' => array( 'LTR' ), 'local_import_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('xml','xml'), 'local_import_widget_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('wie','wie'), 'local_import_customizer_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('dat','dat'), 'local_import_redux' => array( array( 'file_path' => Pcfq_Theme_Helper::pcfq_demo_file_path('json','json'), 'option_name' => 'pqf_options', ), ), 'import_preview_image_url' => Pcfq_Theme_Helper::pcfq_demo_prev_img_url('prv-8','jpg'), 'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'nutritius' ), 'preview_url' => 'https://nutritius.peacefulqode.com/holistic/', ), array( 'import_file_name' => 'Supplemental', 'categories' => array( 'LTR' ), 'local_import_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('xml','xml'), 'local_import_widget_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('wie','wie'), 'local_import_customizer_file' => Pcfq_Theme_Helper::pcfq_demo_file_path('dat','dat'), 'local_import_redux' => array( array( 'file_path' => Pcfq_Theme_Helper::pcfq_demo_file_path('json','json'), 'option_name' => 'pqf_options', ), ), 'import_preview_image_url' => Pcfq_Theme_Helper::pcfq_demo_prev_img_url('prv-9','jpg'), 'import_notice' => __( 'After you import this demo, you will have to setup the slider separately.', 'nutritius' ), 'preview_url' => 'https://nutritius.peacefulqode.com/supplemental/', ), ); } add_filter( 'pt-ocdi/import_files', 'nutritius_ocdi_import_files' ); function nutritius_ocdi_after_import( $selected_import ) { // Assign menus to their locations. $locations = get_theme_mod( 'nav_menu_locations' ); // registered menu locations in theme $menus = wp_get_nav_menus(); // registered menus $arr = json_decode(json_encode($menus), true); foreach($arr as $a) { // assign menus to theme locations if( $a['name'] == 'Main Menu' ) { $locations['primary'] = $a['term_id']; } } set_theme_mod( 'nav_menu_locations', $locations ); if ( 'Holozoic Nutrition' === $selected_import['import_file_name'] ) { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Holozoic Nutrition' ); $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 ); } if ( 'Saprophytic Nutrition' === $selected_import['import_file_name'] ) { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Saprophytic Nutrition' ); $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 ); } if ( 'Parasitic Nutrition' === $selected_import['import_file_name'] ) { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Parasitic Nutrition' ); $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 ); } if ( 'Macronutrients' === $selected_import['import_file_name'] ) { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Macronutrients' ); $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 ); } if ( 'Micronutrients' === $selected_import['import_file_name'] ) { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Micronutrients' ); $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 ); } if ( 'Carbohydrates' === $selected_import['import_file_name'] ) { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Carbohydrates' ); $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 ); } if ( 'Leading Nutrition' === $selected_import['import_file_name'] ) { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Leading Nutrition' ); $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 ); } if ( 'Holistic' === $selected_import['import_file_name'] ) { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Holistic' ); $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 ); } if ( 'Supplemental' === $selected_import['import_file_name'] ) { // Assign front page and posts page (blog page). $front_page_id = get_page_by_title( 'Supplemental' ); $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 ); } if ( class_exists( 'RevSlider' ) ) { if ( 'RTL' === $selected_import['import_file_name'] ) { $slider_array = array( Pcfq_Theme_Helper::pcfq_demo_file_path('1' , 'zip' , 'slider'), ); } else{ $slider_array = array( Pcfq_Theme_Helper::pcfq_demo_file_path('1' , 'zip' , 'slider'), Pcfq_Theme_Helper::pcfq_demo_file_path('2' , 'zip' , 'slider'), Pcfq_Theme_Helper::pcfq_demo_file_path('3' , 'zip' , 'slider'), Pcfq_Theme_Helper::pcfq_demo_file_path('4' , 'zip' , 'slider'), Pcfq_Theme_Helper::pcfq_demo_file_path('5' , 'zip' , 'slider'), Pcfq_Theme_Helper::pcfq_demo_file_path('6' , 'zip' , 'slider'), Pcfq_Theme_Helper::pcfq_demo_file_path('7' , 'zip' , 'slider'), Pcfq_Theme_Helper::pcfq_demo_file_path('8' , 'zip' , 'slider'), Pcfq_Theme_Helper::pcfq_demo_file_path('9' , 'zip' , 'slider'), ); } $slider = new RevSlider(); foreach($slider_array as $filepath){ $slider->importSliderFromPost(true,true,$filepath); } } // remove default post wp_delete_post(1); } add_action( 'pt-ocdi/after_import', 'nutritius_ocdi_after_import' );
修改文件时间
将文件时间修改为当前时间的前一年
删除文件