文件操作 - CCB_Elementor_Widget.php
返回文件管理
返回主菜单
删除本文件
文件: /root/Desktop/OLD/plugin-wordpress/cost-calculator-builder/widgets/CCB_Elementor_Widget.php
编辑文件内容
<?php namespace CCB_Elementor_Widgets\Widgets; use Elementor\Widget_Base; use Elementor\Controls_Manager; use Elementor\Base_Control; if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly /** * Elementor Hello World * * Elementor widget for hello world. * * @since 1.0.0 */ class CCB_Elementor_Widget extends Widget_Base { /** * Retrieve the widget name. * * @since 1.0.0 * * @access public * * @return string Widget name. */ public function get_name() { return 'stm_calc'; } /** * Retrieve the widget title. * * @since 1.0.0 * * @access public * * @return string Widget title. */ public function get_title() { return __( 'Cost Calculator Builder', 'cost-calculator-builder' ); } /** * Retrieve the widget icon. * * @since 1.0.0 * * @access public * * @return string Widget icon. */ public function get_icon() { return 'eicon-archive'; } /** * Retrieve the list of categories the widget belongs to. * * Used to determine where to display the widget in the editor. * * Note that currently Elementor supports only one posts. * When multiple categories passed, Elementor uses the first one. * * @since 1.0.0 * * @access public * * @return array Widget categories. */ public function get_categories() { return [ 'theme-elements' ]; } /** * Register the widget controls. * * Adds different input fields to allow the user to change and customize the widget settings. * * @since 1.0.0 * * @access protected */ protected function _register_controls() { $this->start_controls_section( 'cost_calculator_builder', [ 'label' => __( 'Select calculator', 'cost-calculator-builder' ), ] ); $this->add_control( 'ccb_calculator', [ 'label' => __( 'Calculator', 'cost-calculator-builder' ), 'type' => Controls_Manager::SELECT, 'options' => ccb_all_calculators(), 'default' => 'select', ] ); $this->end_controls_section(); } /** * Render the widget output on the frontend. * * Written in PHP and used to generate the final HTML. * * @since 1.0.0 * * @access protected */ protected function render() { $settings = $this->get_settings(); echo do_shortcode("[stm-calc id='". esc_attr($settings['ccb_calculator']) ."']"); } /** * Render the widget output in the editor. * * Written as a Backbone JavaScript template and used to generate the live preview. * * @since 1.0.0 * * @access protected */ protected function _content_template() { } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件