Файловый менеджер - Редактировать - /home/kunzqhe/www/wp-content/plugins/builder-mosaic/init.php
Ðазад
<?php /* Plugin Name: Builder Mosaic Plugin URI: https://themify.me/addons/mosaic Version: 2.0.1 Author: Themify Author URI: https://themify.me Description: Make beautiful mosaic/masony tile layouts with Themify Builder. The content can be pulled dynamically from blog posts, WooCommerce products, gallery images, RSS feeds, custom post types, directory listing, and more. Text Domain: builder-mosaic Domain Path: /languages Compatibility: 5.0.6 */ defined( 'ABSPATH' ) or die( '-1' ); class Builder_Mosaic { public $url; public $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(); add_action( 'plugins_loaded', array( $this, 'i18n' ), 5 ); add_action( 'themify_builder_setup_modules', array( $this, 'register_module' ) ); if ( is_admin() ) { add_action( 'themify_builder_admin_enqueue', array( $this, 'admin_enqueue' ), 15 ); add_action( 'wp_ajax_builder_tiled_posts_save_preset', array( $this, 'save_preset' ) ); add_filter( 'plugin_row_meta', array( $this, 'themify_plugin_meta'), 10, 2 ); add_filter( 'plugin_action_links_' . plugin_basename(__FILE__), array( $this, 'action_links') ); } else { add_action('themify_builder_frontend_enqueue', array($this, 'admin_enqueue'), 15); } include $this->dir . 'providers/base.php'; } public function constants() { $data = get_file_data( __FILE__, array( 'Version' ) ); $this->version = $data[0]; $this->url = trailingslashit( plugin_dir_url( __FILE__ ) ); $this->dir = trailingslashit( plugin_dir_path( __FILE__ ) ); } public function i18n() { load_plugin_textdomain( 'builder-tile-slider', false, '/languages' ); } 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 ); } /** * Retrieves the variables passed to the addon's admin.js * * @return array */ function admin_js_vars() { return array( 'path' => $this->url, 'jqui' => includes_url( 'js/jquery/ui/' ), 'admin_css'=>themify_enque($this->url . 'assets/admin.css'), 'presets' => $this->get_custom_presets(), 'v'=> $this->version, 'labels'=>array( 'custom'=>__( 'Custom:', 'builder-mosaic' ), 'name'=> __( 'Name', 'builder-mosaic' ), 'template'=>__( 'Tile Templates', 'builder-mosaic' ), 'add'=>__( 'Add Tile', 'builder-mosaic' ), 'remove'=>__( 'Remove Selected Tile', 'builder-mosaic' ), 'save'=>__( 'Save Current', 'builder-mosaic' ) ) ); } public function admin_enqueue() { wp_enqueue_script( 'themify-builder-mosaic-admin', themify_enque($this->url . 'assets/admin.js'), array('themify-builder-app-js'), $this->version, true ); wp_localize_script( 'themify-builder-mosaic-admin', 'builderMosaicAdmin', $this->admin_js_vars() ); } public function register_module() { Themify_Builder_Model::register_directory( 'templates', $this->dir . 'templates' ); Themify_Builder_Model::register_directory( 'modules', $this->dir . 'modules' ); } /** * Returns a list of tile presets, saved by user * * @return array */ function get_custom_presets() { $presets = array(); $posts = get_posts( array( 'post_type' => 'tftp_template', 'no_found_rows'=>true, 'posts_per_page' => -1, ) ); foreach($posts as $template ) { $presets[ $template->ID ] = array( 'title' => $template->post_title, 'content' => $template->post_content, ); } return $presets; } function save_preset() { if ( isset( $_POST['name'],$_POST['grid'] )) { $result = wp_insert_post( array( 'post_title' => stripslashes( $_POST['name'] ), 'post_content' => stripslashes( $_POST['grid'] ), 'post_status' => 'publish', 'post_type' => 'tftp_template', ) ); echo is_wp_error( $result ) ?$result->get_error_message():$result; } wp_die(); } } Builder_Mosaic::get_instance();
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Ð“ÐµÐ½ÐµÑ€Ð°Ñ†Ð¸Ñ Ñтраницы: 0 |
proxy
|
phpinfo
|
ÐаÑтройка