Файловый менеджер - Редактировать - /home/kunzqhe/www/wp-content/plugins/builder-tiles/init.php
Ðазад
<?php /* Plugin Name: Builder Tiles Plugin URI: https://themify.me/addons/tiles Version: 2.0.5 Author: Themify Author URI: https://themify.me Description: A Builder addon to make flippable Tiles like Windows 8 Metro layouts. It requires to use with the latest version of any Themify theme or the Themify Builder plugin. Text Domain: builder-tiles Domain Path: /languages Compatibility: 5.1.3 */ defined('ABSPATH') or die('-1'); if (!class_exists('Builder_Tiles')) { class Builder_Tiles { public $url; private $dir; public $version; /** * Creates or returns an instance of this class. * * @return A single instance of this class. */ public static function get_instance() { static $instance = null; if ($instance === null) { $instance = new self; } return $instance; } private function __construct() { $this->constants(); include( $this->dir . 'includes/admin.php' ); add_action( 'init', array($this, 'i18n'), 5 ); add_action( 'themify_builder_setup_modules', array($this, 'register_module') ); add_action( 'wp_head', array( $this, 'tiles_gap' ) ); if( is_admin() ) { add_filter( 'plugin_row_meta', array( $this, 'themify_plugin_meta'), 10, 2 ); add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'action_links') ); add_filter( 'themify_do_metaboxes', array($this, 'themify_do_metaboxes') ); add_action( 'admin_enqueue_scripts', array($this, 'enque_scripts') ); } else { add_action( 'themify_builder_frontend_enqueue', array($this, 'enque_scripts'), 15 ); } } public function constants() { $data = get_file_data(__FILE__, array('Version')); $this->version = $data[0]; $this->url = defined('BUILDER_TILES_URL') ? BUILDER_TILES_URL : trailingslashit(plugin_dir_url(__FILE__)); $this->dir = defined('BUILDER_TILES_DIR') ? BUILDER_TILES_DIR : trailingslashit(plugin_dir_path(__FILE__)); } public function themify_plugin_meta( $links, $file ) { if ( plugin_basename( __FILE__ ) === $file ) { $row_meta = array( 'changelogs' => '<a href="' . esc_url( 'https://themify.me/changelogs/' ) . basename( dirname( $file ) ) .'.txt" target="_blank" aria-label="' . esc_attr__( 'Plugin Changelogs', 'themify' ) . '">' . esc_html__( 'View Changelogs', 'themify' ) . '</a>' ); return array_merge( $links, $row_meta ); } return (array) $links; } public function action_links( $links ) { if ( is_plugin_active( 'themify-updater/themify-updater.php' ) ) { $tlinks = array( '<a href="' . admin_url( 'index.php?page=themify-license' ) . '">'.__('Themify License', 'themify') .'</a>', ); } else { $tlinks = array( '<a href="' . esc_url('https://themify.me/docs/themify-updater-documentation') . '">'. __('Themify Updater', 'themify') .'</a>', ); } return array_merge( $links, $tlinks ); } public function i18n() { load_plugin_textdomain('builder-tiles', false, '/languages'); } public function enque_scripts() { if( is_admin() ) { global $pagenow; if ( ! in_array( $pagenow, array( 'post-new.php', 'post.php' ),true ) ) return; } wp_enqueue_script( 'themify-builder-tiles-admin', themify_enque($this->url . 'assets/admin.js'), array( 'jquery' ), $this->version, true ); } public function register_module() { Themify_Builder_Model::register_directory('templates', $this->dir . 'templates'); Themify_Builder_Model::register_directory('modules', $this->dir . 'modules'); } public function get_tile_sizes() { return apply_filters('builder_tiles_sizes', array( 'square-large' => array('label' => __('Square Large', 'builder-tiles'), 'width' => 480, 'height' => 480, 'mobile_width' => 280, 'mobile_height' => 280, 'image' => $this->url . 'assets/sizes/size-sl.svg'), 'square-small' => array('label' => __('Square Small', 'builder-tiles'), 'width' => 240, 'height' => 240, 'mobile_width' => 140, 'mobile_height' => 140, 'image' => $this->url . 'assets/sizes/size-ss.svg'), 'landscape' => array('label' => __('Landscape', 'builder-tiles'), 'width' => 480, 'height' => 240, 'mobile_width' => 280, 'mobile_height' => 140, 'image' => $this->url . 'assets/sizes/size-l.svg'), 'portrait' => array('label' => __('Portrait', 'builder-tiles'), 'width' => 240, 'height' => 480, 'mobile_width' => 140, 'mobile_height' => 280, 'image' => $this->url . 'assets/sizes/size-p.svg'), )); } public function themify_do_metaboxes($panels) { $options = array( array( 'name' => 'builder_tiles_fluid_tiles', 'title' => __('Fluid Tiles', 'builder-tiles'), 'description' => __('If enabled, tiles will display fluid in % width (eg. small tile will be 25% width)', 'builder-tiles'), 'type' => 'dropdown', 'meta' => array( array('value' => '', 'name' => __('Default', 'builder-tiles'), 'selected' => true), array('value' => 'yes', 'name' => __('Enable', 'themify')), array('value' => 'no', 'name' => __('Disable', 'themify')) ) ), array( 'name' => 'builder_tiles_fluid_tiles_base_size', 'title' => __('Base Tile Size', 'builder-tiles'), 'description' => __('Only works if Fluid Tiles is enabled to control how many tiles will be rendered in a row according to the tile size.', 'builder-tiles'), 'type' => 'dropdown', 'meta' => array( array('value' => '', 'name' => __('Default', 'builder-tiles'), 'selected' => true), array('value' => 16, 'name' => __('16%', 'themify')), array('value' => 20, 'name' => __('20%', 'themify')), array('value' => 25, 'name' => __('25%', 'themify')), array('value' => 30, 'name' => __('30%', 'themify')) ) ), array( 'name' => 'builder_tiles_gutter', 'title' => __('Tile Spacing', 'builder-tiles'), 'description' => '', 'type' => 'textbox', 'meta' => array('size' => 'small'), 'after' => ' px' ), ); $panels[] = array( 'name' => __('Builder Tiles', 'builder-tiles'), 'id' => 'builder-tiles', 'options' => $options, 'pages' => 'page' ); remove_filter( 'themify_do_metaboxes', array($this, 'themify_do_metaboxes') ); return $panels; } public function get_option( $name ) { $options = wp_parse_args( get_option( 'builder_tiles', array() ), $this->get_defaults() ); $value = isset( $options[ $name ] ) ? $options[ $name ] : null; if ( is_page() ) { $id = get_the_ID(); if ( empty( $id ) ) { $id = Themify_Builder_Component_Base::$post_id; } $single_value = get_post_meta( $id, "builder_tiles_{$name}", true ); if ( $single_value !== '' ) { $value = $single_value; } } return $value; } function get_defaults() { return array( 'fluid_tiles' => 1, 'gutter' => 0 ); } function tiles_gap() { $gutter = (int) $this->get_option( 'gutter' ); ?> <style>:root { --builder-tiles-gutter: <?php echo $gutter; ?>px; }</style> <?php } } add_action('themify_builder_before_init',array('Builder_Tiles','get_instance')); }
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка