文件操作 - block.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/plugins/total-theme-core/inc/vcex/block.php
编辑文件内容
<?php namespace TotalThemeCore\Vcex; \defined( 'ABSPATH' ) || exit; abstract class Block { /** * Block namespace. */ protected $namespace = 'vcex'; /** * Block name. */ protected $block_name = ''; /** * Path to block json file. */ protected $json_path = ''; /** * Block args. */ protected $args = []; /** * Render Callback function. */ protected $render_callback = ''; /** * Editor styles. */ protected $editor_styles = []; /** * Editor scripts */ protected $editor_scripts = []; /** * Setup the block. */ abstract public function setup(); /** * Registers the block to WordPress. */ public function register_block() { $this->setup(); if ( $this->block_name && \function_exists( 'register_block_type' ) ) { \register_block_type( $this->json_path, $this->get_args() ); } } /** * Return register_block_type args. */ public function get_args() { if ( empty( $this->args['render_callback'] ) && \method_exists( $this, 'render_callback' ) ) { $this->args['render_callback'] = [ $this, 'render_callback' ]; } return $this->args; } /** * Wrapper for displaying a block shortcode. */ public function do_shortcode( $tag, $atts = [], $content = null ) { global $shortcode_tags; if ( ! isset( $shortcode_tags[$tag] ) || ! is_callable( $shortcode_tags[$tag] ) ) { return false; } if ( ! $content && ! empty( $atts['content'] ) ) { $content = $atts['content']; } $shortcode = \call_user_func( $shortcode_tags[$tag], $atts, $content, $tag ); if ( $shortcode ) { $class = 'wp-block-' . \sanitize_html_class( $this->namespace . '-' . $this->block_name ); if ( ! empty( $atts['className'] ) ) { $class .= ' ' . \esc_attr( \trim( $atts['className'] ) ); } return '<div class="' . \esc_attr( $class ) . '">' . $shortcode . '</div>'; } } /** * Helper function checks if we are currently in the block editor. */ protected function is_editor() { return \defined( 'REST_REQUEST' ) && REST_REQUEST && ! empty( $_REQUEST['context'] ) && 'edit' === $_REQUEST['context']; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件