File manager - Edit - /home/theblueo/tv/fb4e3b/page.tar
Back
content-front-page-panels.php 0000666 00000004265 15214167434 0012271 0 ustar 00 <?php /** * Template part for displaying pages on front page * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.0 */ global $twentyseventeencounter; ?> <article id="panel<?php echo $twentyseventeencounter; ?>" <?php post_class( 'twentyseventeen-panel ' ); ?> > <?php if ( has_post_thumbnail() ) : $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' ); // Calculate aspect ratio: h / w * 100%. $ratio = $thumbnail[2] / $thumbnail[1] * 100; ?> <div class="panel-image" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>);"> <div class="panel-image-prop" style="padding-top: <?php echo esc_attr( $ratio ); ?>%"></div> </div><!-- .panel-image --> <?php endif; ?> <div class="panel-content"> <div class="wrap"> <header class="entry-header"> <?php the_title( '<h2 class="entry-title">', '</h2>' ); ?> <?php twentyseventeen_edit_link( get_the_ID() ); ?> </header><!-- .entry-header --> <div class="entry-content"> <?php /* translators: %s: Name of current post */ the_content( sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), get_the_title() ) ); ?> </div><!-- .entry-content --> <?php // Show recent blog posts if is blog posts page (Note that get_option returns a string, so we're casting the result as an int). if ( get_the_ID() === (int) get_option( 'page_for_posts' ) ) : ?> <?php // Show four most recent posts. $recent_posts = new WP_Query( array( 'posts_per_page' => 3, 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'no_found_rows' => true, ) ); ?> <?php if ( $recent_posts->have_posts() ) : ?> <div class="recent-posts"> <?php while ( $recent_posts->have_posts() ) : $recent_posts->the_post(); get_template_part( 'template-parts/post/content', 'excerpt' ); endwhile; wp_reset_postdata(); ?> </div><!-- .recent-posts --> <?php endif; ?> <?php endif; ?> </div><!-- .wrap --> </div><!-- .panel-content --> </article><!-- #post-## --> content-page.php 0000666 00000001322 15214167434 0007652 0 ustar 00 <?php /** * Template part for displaying page content in page.php * * @link https://codex.wordpress.org/Template_Hierarchy * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <header class="entry-header"> <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?> <?php twentyseventeen_edit_link( get_the_ID() ); ?> </header><!-- .entry-header --> <div class="entry-content"> <?php the_content(); wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentyseventeen' ), 'after' => '</div>', ) ); ?> </div><!-- .entry-content --> </article><!-- #post-## --> content-front-page.php 0000666 00000003011 15214167434 0010775 0 ustar 00 <?php /** * Displays content for front page * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class( 'twentyseventeen-panel ' ); ?> > <?php if ( has_post_thumbnail() ) : $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' ); $post_thumbnail_id = get_post_thumbnail_id( $post->ID ); $thumbnail_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'twentyseventeen-featured-image' ); // Calculate aspect ratio: h / w * 100%. $ratio = $thumbnail_attributes[2] / $thumbnail_attributes[1] * 100; ?> <div class="panel-image" style="background-image: url(<?php echo esc_url( $thumbnail[0] ); ?>);"> <div class="panel-image-prop" style="padding-top: <?php echo esc_attr( $ratio ); ?>%"></div> </div><!-- .panel-image --> <?php endif; ?> <div class="panel-content"> <div class="wrap"> <header class="entry-header"> <?php the_title( '<h2 class="entry-title">', '</h2>' ); ?> <?php twentyseventeen_edit_link( get_the_ID() ); ?> </header><!-- .entry-header --> <div class="entry-content"> <?php /* translators: %s: Name of current post */ the_content( sprintf( __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'twentyseventeen' ), get_the_title() ) ); ?> </div><!-- .entry-content --> </div><!-- .wrap --> </div><!-- .panel-content --> </article><!-- #post-## --> model.php 0000666 00000007552 15214214062 0006367 0 ustar 00 <?php namespace Elementor\Core\Settings\Page; use Elementor\Core\Settings\Base\CSS_Model; use Elementor\Plugin; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor page settings model. * * Elementor page settings model handler class is responsible for registering * and managing Elementor page settings models. * * @since 1.6.0 */ class Model extends CSS_Model { /** * WordPress post object. * * Holds an instance of `WP_Post` containing the post object. * * @since 1.6.0 * @access public * * @var \WP_Post */ private $post; /** * @var \WP_Post */ private $post_parent; /** * Model constructor. * * Initializing Elementor page settings model. * * @since 1.6.0 * @access public * * @param array $data Optional. Model data. Default is an empty array. */ public function __construct( array $data = [] ) { $this->post = get_post( $data['id'] ); if ( ! $this->post ) { $this->post = new \WP_Post( (object) [] ); } if ( wp_is_post_revision( $this->post->ID ) ) { $this->post_parent = get_post( $this->post->post_parent ); } else { $this->post_parent = $this->post; } parent::__construct( $data ); } /** * Get model name. * * Retrieve page settings model name. * * @since 1.6.0 * @access public * * @return string Model name. */ public function get_name() { return 'page-settings'; } /** * Get model unique name. * * Retrieve page settings model unique name. * * @since 1.6.0 * @access public * * @return string Model unique name. */ public function get_unique_name() { return $this->get_name() . '-' . $this->post->ID; } /** * Get CSS wrapper selector. * * Retrieve the wrapper selector for the page settings model. * * @since 1.6.0 * @access public * * @return string CSS wrapper selector. */ public function get_css_wrapper_selector() { $document = Plugin::$instance->documents->get( $this->post_parent->ID ); return $document->get_css_wrapper_selector(); } /** * Get panel page settings. * * Retrieve the panel setting for the page settings model. * * @since 1.6.0 * @access public * * @return array { * Panel settings. * * @type string $title The panel title. * } */ public function get_panel_page_settings() { $document = Plugin::$instance->documents->get( $this->post->ID ); return [ /* translators: %s: Document title */ 'title' => sprintf( __( '%s Settings', 'elementor' ), $document::get_title() ), ]; } /** * On export post meta. * * When exporting data, check if the post is not using page template and * exclude it from the exported Elementor data. * * @since 1.6.0 * @access public * * @param array $element_data Element data. * * @return array Element data to be exported. */ public function on_export( $element_data ) { if ( ! empty( $element_data['settings']['template'] ) ) { /** * @var \Elementor\Modules\PageTemplates\Module $page_templates_module */ $page_templates_module = Plugin::$instance->modules_manager->get_modules( 'page-templates' ); $is_elementor_template = ! ! $page_templates_module->get_template_path( $element_data['settings']['template'] ); if ( ! $is_elementor_template ) { unset( $element_data['settings']['template'] ); } } return $element_data; } /** * Register model controls. * * Used to add new controls to the page settings model. * * @since 1.6.0 * @access protected */ protected function _register_controls() { // Check if it's a real model, or abstract (for example - on import ) if ( $this->post->ID ) { $document = Plugin::$instance->documents->get_doc_or_auto_save( $this->post->ID ); if ( $document ) { $controls = $document->get_controls(); foreach ( $controls as $control_id => $args ) { $this->add_control( $control_id, $args ); } } } } } manager.php 0000666 00000020701 15214214062 0006670 0 ustar 00 <?php namespace Elementor\Core\Settings\Page; use Elementor\Core\Files\CSS\Base; use Elementor\Core\Files\CSS\Post; use Elementor\Core\Files\CSS\Post_Preview; use Elementor\Core\Settings\Base\CSS_Manager; use Elementor\Core\Utils\Exceptions; use Elementor\Core\Settings\Base\Model as BaseModel; use Elementor\DB; use Elementor\Plugin; use Elementor\Utils; if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly. } /** * Elementor page settings manager. * * Elementor page settings manager handler class is responsible for registering * and managing Elementor page settings managers. * * @since 1.6.0 */ class Manager extends CSS_Manager { /** * Meta key for the page settings. */ const META_KEY = '_elementor_page_settings'; /** * Is CPT supports custom templates. * * Whether the Custom Post Type supports templates. * * @since 1.6.0 * @deprecated 2.0.0 Use `Utils::is_cpt_custom_templates_supported()` method instead. * @access public * @static * * @return bool True is templates are supported, False otherwise. */ public static function is_cpt_custom_templates_supported() { _deprecated_function( __METHOD__, '2.0.0', 'Utils::is_cpt_custom_templates_supported()' ); return Utils::is_cpt_custom_templates_supported(); } /** * Get manager name. * * Retrieve page settings manager name. * * @since 1.6.0 * @access public * * @return string Manager name. */ public function get_name() { return 'page'; } /** * Get model for config. * * Retrieve the model for settings configuration. * * @since 1.6.0 * @access public * * @return BaseModel The model object. */ public function get_model_for_config() { if ( ! is_singular() && ! Plugin::$instance->editor->is_edit_mode() ) { return null; } if ( Plugin::$instance->editor->is_edit_mode() ) { $post_id = Plugin::$instance->editor->get_post_id(); $document = Plugin::$instance->documents->get_doc_or_auto_save( $post_id ); } else { $post_id = get_the_ID(); $document = Plugin::$instance->documents->get_doc_for_frontend( $post_id ); } if ( ! $document ) { return null; } $model = $this->get_model( $document->get_post()->ID ); if ( $document->is_autosave() ) { $model->set_settings( 'post_status', $document->get_main_post()->post_status ); } return $model; } /** * Ajax before saving settings. * * Validate the data before saving it and updating the data in the database. * * @since 1.6.0 * @access public * * @param array $data Post data. * @param int $id Post ID. * * @throws \Exception If invalid post returned using the `$id`. * @throws \Exception If current user don't have permissions to edit the post. */ public function ajax_before_save_settings( array $data, $id ) { $post = get_post( $id ); if ( empty( $post ) ) { throw new \Exception( 'Invalid post.', Exceptions::NOT_FOUND ); } if ( ! current_user_can( 'edit_post', $id ) ) { throw new \Exception( 'Access denied.', Exceptions::FORBIDDEN ); } // Avoid save empty post title. if ( ! empty( $data['post_title'] ) ) { $post->post_title = $data['post_title']; } if ( isset( $data['post_excerpt'] ) && post_type_supports( $post->post_type, 'excerpt' ) ) { $post->post_excerpt = $data['post_excerpt']; } if ( isset( $data['post_status'] ) ) { $this->save_post_status( $id, $data['post_status'] ); unset( $post->post_status ); } wp_update_post( $post ); // Check updated status if ( DB::STATUS_PUBLISH === get_post_status( $id ) ) { $autosave = wp_get_post_autosave( $post->ID ); if ( $autosave ) { wp_delete_post_revision( $autosave->ID ); } } if ( isset( $data['post_featured_image'] ) && post_type_supports( $post->post_type, 'thumbnail' ) ) { if ( empty( $data['post_featured_image']['id'] ) ) { delete_post_thumbnail( $post->ID ); } else { set_post_thumbnail( $post->ID, $data['post_featured_image']['id'] ); } } if ( Utils::is_cpt_custom_templates_supported() ) { $template = get_metadata( 'post', $post->ID, '_wp_page_template', true ); if ( isset( $data['template'] ) ) { $template = $data['template']; } if ( empty( $template ) ) { $template = 'default'; } // Use `update_metadata` in order to save also for revisions. update_metadata( 'post', $post->ID, '_wp_page_template', $template ); } } /** * @inheritDoc * * Override parent because the page setting moved to document.settings. */ protected function print_editor_template_content( $name ) { ?> <# const tabs = elementor.config.document.settings.tabs; if ( Object.values( tabs ).length > 1 ) { #> <div class="elementor-panel-navigation"> <# _.each( tabs, function( tabTitle, tabSlug ) { #> <div class="elementor-component-tab elementor-panel-navigation-tab elementor-tab-control-{{ tabSlug }}" data-tab="{{ tabSlug }}"> <a href="#">{{{ tabTitle }}}</a> </div> <# } ); #> </div> <# } #> <div id="elementor-panel-<?php echo $name; ?>-settings-controls"></div> <?php } /** * Save settings to DB. * * Save page settings to the database, as post meta data. * * @since 1.6.0 * @access protected * * @param array $settings Settings. * @param int $id Post ID. */ protected function save_settings_to_db( array $settings, $id ) { // Use update/delete_metadata in order to handle also revisions. if ( ! empty( $settings ) ) { // Use `wp_slash` in order to avoid the unslashing during the `update_post_meta`. update_metadata( 'post', $id, self::META_KEY, wp_slash( $settings ) ); } else { delete_metadata( 'post', $id, self::META_KEY ); } } /** * Get CSS file for update. * * Retrieve the CSS file before updating it. * * This method overrides the parent method to disallow updating CSS files for pages. * * @since 1.6.0 * @access protected * * @param int $id Post ID. * * @return false Disallow The updating CSS files for pages. */ protected function get_css_file_for_update( $id ) { return false; } /** * Get saved settings. * * Retrieve the saved settings from the post meta. * * @since 1.6.0 * @access protected * * @param int $id Post ID. * * @return array Saved settings. */ protected function get_saved_settings( $id ) { $settings = get_post_meta( $id, self::META_KEY, true ); if ( ! $settings ) { $settings = []; } if ( Utils::is_cpt_custom_templates_supported() ) { $saved_template = get_post_meta( $id, '_wp_page_template', true ); if ( $saved_template ) { $settings['template'] = $saved_template; } } return $settings; } /** * Get CSS file name. * * Retrieve CSS file name for the page settings manager. * * @since 1.6.0 * @access protected * * @return string CSS file name. */ protected function get_css_file_name() { return 'post'; } /** * Get model for CSS file. * * Retrieve the model for the CSS file. * * @since 1.6.0 * @access protected * * @param Base $css_file The requested CSS file. * * @return BaseModel The model object. */ protected function get_model_for_css_file( Base $css_file ) { if ( ! $css_file instanceof Post ) { return null; } $post_id = $css_file->get_post_id(); if ( $css_file instanceof Post_Preview ) { $autosave = Utils::get_post_autosave( $post_id ); if ( $autosave ) { $post_id = $autosave->ID; } } return $this->get_model( $post_id ); } /** * Get special settings names. * * Retrieve the names of the special settings that are not saved as regular * settings. Those settings have a separate saving process. * * @since 1.6.0 * @access protected * * @return array Special settings names. */ protected function get_special_settings_names() { return [ 'id', 'post_title', 'post_status', 'template', 'post_excerpt', 'post_featured_image', ]; } /** * @since 2.0.0 * @access public * * @param $post_id * @param $status */ public function save_post_status( $post_id, $status ) { $parent_id = wp_is_post_revision( $post_id ); if ( $parent_id ) { // Don't update revisions post-status return; } $parent_id = $post_id; $post = get_post( $parent_id ); $allowed_post_statuses = get_post_statuses(); if ( isset( $allowed_post_statuses[ $status ] ) ) { $post_type_object = get_post_type_object( $post->post_type ); if ( 'publish' !== $status || current_user_can( $post_type_object->cap->publish_posts ) ) { $post->post_status = $status; } } wp_update_post( $post ); } }
| ver. 1.4 |
Github
|
.
| PHP 7.0.33 | Generation time: 0 |
proxy
|
phpinfo
|
Settings