文件操作 - fields.php
返回文件管理
返回主菜单
删除本文件
文件: /var/www/ltlcompare.com/wp-content/themes/ltl-compare/functions/fields.php
编辑文件内容
<?php use Carbon_Fields\Container; use Carbon_Fields\Field; add_action( 'carbon_fields_register_fields', 'ltl_compare_crb_init_fields' ); function ltl_compare_crb_init_fields() { /* options */ Container::make( 'theme_options', __( 'Theme Options', DOMAIN ) ) ->add_fields( array( Field::make( 'image', 'logo', __( 'Logo', DOMAIN ) ), Field::make( 'image', 'logo_white', __( 'Logo white', DOMAIN ) ), Field::make( 'text', 'header_btn_text', __( 'Header button text', DOMAIN ) ), Field::make( 'text', 'header_btn_link', __( 'Header button link', DOMAIN ) ), Field::make( 'text', 'copyright', __( 'Copyright', DOMAIN ) ) ->set_help_text( __( '{Y} - current year', DOMAIN ) ), Field::make( 'textarea', 'footer_app_desc', __( 'Footer app description', DOMAIN ) ) ->set_rows( 3 ), Field::make( 'complex', 'footer_apps', __( 'Footer apps' ) ) ->set_collapsed( true ) ->set_layout( 'tabbed-vertical' ) ->add_fields( array( Field::make( 'text', 'name', __( 'Name', DOMAIN ) ), Field::make( 'image', 'image', __( 'Image', DOMAIN ) ), Field::make( 'text', 'link', __( 'Link', DOMAIN ) ), ) ) ->set_header_template( '<%= name %>' ), Field::make( 'media_gallery', 'footer_awards', __( 'Footer awards', DOMAIN ) ) ->set_type( array( 'image' ) ), Field::make( 'rich_text', 'footer_info', __( 'Footer info text', DOMAIN ) ), Field::make( 'text', 'app_url', __( 'App url', DOMAIN ) ), ) ) ; /* front-page */ Container::make( 'post_meta', __( 'Fields', DOMAIN ) ) ->where( 'post_template', '=', 'front-page.php' ) ->add_tab( __( 'Promo', DOMAIN ), array( Field::make( 'textarea', 'promo_title', __( 'Title', DOMAIN ) ) ->set_rows( 2 ), Field::make( 'textarea', 'promo_subtitle', __( 'Subtitle', DOMAIN ) ) ->set_rows( 2 ), Field::make( 'media_gallery', 'promo_carriers', __( 'Carriers', DOMAIN ) ) ->set_type( array( 'image' ) ), Field::make( 'textarea', 'promo_explainer_text', __( 'Explainer text', DOMAIN ) ) ->set_rows( 2 ), ) ) ; /* review */ Container::make( 'post_meta', __( 'Поля', DOMAIN ) ) ->where( 'post_type', '=', 'review' ) ->add_fields( array( Field::make( 'text', 'stars', __( 'Stars', DOMAIN ) ) ->set_attribute( 'type', 'number' ) ->set_attribute( 'min', '1' ) ->set_attribute( 'max', '5' ) ->set_default_value( '5' ), Field::make( 'textarea', 'text', __( 'Text', DOMAIN ) ) ->set_rows( 3 ), Field::make( 'text', 'date', __( 'Date', DOMAIN ) ), ) ) ; } ?>
修改文件时间
将文件时间修改为当前时间的前一年
删除文件