文件操作 - meta.php
返回文件管理
返回主菜单
删除本文件
文件: /storage/v12552/jimbrandstatter/public_html/wp-content/plugins/total-theme-core/inc/cards/meta.php
编辑文件内容
<?php namespace TotalThemeCore\Cards; \defined( 'ABSPATH' ) || exit; /** * Register meta options for theme cards. */ class Meta { /** * Static-only class. */ private function __construct() {} /** * Hook into actions and filters. */ public static function init(): void { \add_action( 'admin_init', [ self::class, 'on_admin_init' ] ); } /** * Initialize. */ public static function on_admin_init(): void { if ( self::is_enabled() && \class_exists( '\WPEX_Meta_Factory' ) ) { new \WPEX_Meta_Factory( self::card_metabox() ); } } /** * Check if enabled. */ public static function is_enabled(): bool { $check = true; /** * Filters if the card metabox is enabled or not. * * @param bool $check */ $check = \apply_filters( 'wpex_has_card_metabox', $check ); return (bool) $check; } /** * Card metabox settings. */ protected static function card_metabox(): array { $post_types = [ 'post' => 'post', ]; /** * Filters the post types to add the card metabox to. * * @param array $post_types */ $post_types = (array) \apply_filters( 'wpex_card_metabox_post_types', $post_types ); return [ 'id' => 'card', 'title' => \esc_html__( 'Card Settings', 'total-theme-core' ), 'screen' => $post_types, 'context' => 'normal', 'priority' => 'default', 'fields' => [ self::class, 'get_fields' ] ]; } /** * Return metabox fields. */ public static function get_fields(): array { $fields = [ [ 'name' => \esc_html__( 'Link Target', 'total-theme-core' ), 'id' => 'wpex_card_link_target', 'type' => 'select', 'choices' => [ '' => \esc_html__( 'Default', 'total-theme-core' ), '_blank' => \esc_html__( 'New Tab', 'total-theme-core' ), ], ], [ 'name' => \esc_html__( 'Link URL', 'total-theme-core' ), 'id' => 'wpex_card_url', 'type' => 'text', ], [ 'name' => \esc_html__( 'Thumbnail', 'total-theme-core' ), 'id' => 'wpex_card_thumbnail', 'type' => 'upload', 'media_type' => 'image', 'return' => 'id', 'desc' => \esc_html__( 'Select a custom thumbnail to override the featured image.', 'total-theme-core' ), ], [ 'name' => \esc_html__( 'Font Icon', 'total-theme-core' ), 'id' => 'wpex_card_icon', 'type' => 'icon_select', 'choices' => self::choices_icons(), 'desc' => \esc_html__( 'Enter your custom Font Icon classname or click the button to select from the available theme icons.', 'total-theme-core' ), ], ]; /** * Filters the card metabox fields. * * @param array $fields */ $fields = \apply_filters( 'wpex_card_metabox_fields', $fields ); return (array) $fields; } /** * Icon choices. * * @todo update to use SVG's for the icon displays - will require a new "icon_select" meta type where we can pass on an array of SVG options. * * @todo update so the icon option only saves the icon name and not the full ticon ticon- unless it's an SVG then it can save as ticons/ */ protected static function choices_icons(): array { $icons_list = []; if ( \function_exists( '\wpex_ticons_list' ) ) { $ticons = \wpex_ticons_list(); if ( $ticons && \is_array( $ticons ) ) { foreach ( $ticons as $ticon ) { if ( \str_contains( $ticon, 'custom/' ) ) { continue; } if ( 'none' === $ticon || '' === $ticon ) { $icons_list[] = \esc_html__( 'None', 'total' ); } else { $icons_list['ticon ticon-' . \trim( $ticon )] = \ucwords( \str_replace( '-', ' ', $ticon ) ); } } } } /** * Filters the icons list for the card metabox. * * @param array $icons_list */ $icons_list = \apply_filters( 'wpex_card_meta_choices_icons', $icons_list ); return (array) $icons_list; } }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件