View file root/inc/metaboxes.php

File size: 6.7Kb
<?php
/**
 * ****************************************************************************
 *
 *   НЕ РЕДАКТИРУЙТЕ ЭТОТ ФАЙЛ
 *
 *   ВНИМАНИЕ!!!!!!!
 *
 *   НЕ РЕДАКТИРУЙТЕ ЭТОТ ФАЙЛ
 *   ПРИ ОБНОВЛЕНИИ ТЕМЫ - ВЫ ПОТЕРЯЕТЕ ВСЕ ВАШИ ИЗМЕНЕНИЯ
 *   ИСПОЛЬЗУЙТЕ ДОЧЕРНЮЮ ТЕМУ ИЛИ НАСТРОЙКИ ТЕМЫ В АДМИНКЕ
 *
 *   ПОДБРОБНЕЕ:
 *   https://docs.wpshop.ru/child-themes/
 *
 * *****************************************************************************
 *
 * @package root
 * @build 13334
 */


/**
 * Metaboxes
 */

function wpshop_core_metabox() {

    class Posts_Meta_Box extends Vetteo_Meta_Box {

        public function __construct() {
            $this->set_settings( 'meta_posts_', 'post', __( 'Root: Post settings', 'root' ), 'advanced' );

            parent::__construct();
        }

        public function render_fields()
        {
            echo '<table class="form-table">';

            $this->field_text( 'source_link',               __( 'Source', 'root' ), 'http://...', __( 'If you need to provide a link to an external site as a source, fill in this field', 'root' ) );
            $this->field_checkbox( 'source_hide',           __( 'Hide link?', 'root' ), __( 'Hide link to source using JS', 'root' ) );
            $this->field_checkbox( 'header_hide',           __( 'Hide header', 'root' ), __( 'Do not show the header on this page', 'root' ) );
            $this->field_checkbox( 'header_menu_hide',      __( 'Hide top menu', 'root' ), __( 'Do not show the top menu on this page', 'root' ) );
            $this->field_checkbox( 'footer_menu_hide',      __( 'Hide bottom menu', 'root' ), __( 'Do not show the bottom menu on this page', 'root' ) );
            $this->field_checkbox( 'sidebar_hide',          __( 'Hide sidebar', 'root' ), __( 'Do not show sidebar on this page', 'root' ) );
            $this->field_checkbox( 'footer_hide',           __( 'Hide footer', 'root' ), __( 'Do not show footer on this page', 'root' ) );
            $this->field_checkbox( 'breadcrumbs_hide',      __( 'Hide breadcrumbs', 'root' ), __( 'Do not show breadcrumbs on this page', 'root' ) );
            $this->field_checkbox( 'h1_hide',               __( 'Hide title', 'root' ), __( 'Do not show title H1 on this page', 'root' ) );
            $this->field_checkbox( 'meta_hide',             __( 'Hide meta-information', 'root' ), __( 'Do not show meta-information (date, category, author) on this page', 'root' ) );
            $this->field_checkbox( 'thumb_hide',            __( 'Hide thumbnail', 'root' ), __( 'Do not show thumbnail or separator on this page', 'root' ) );
            $this->field_checkbox( 'share_top_hide',        __( 'Hide top social buttons', 'root' ), __( 'Do not show top social buttons on this page', 'root' ) );
            $this->field_checkbox( 'share_bottom_hide',     __( 'Hide bottom social buttons', 'root' ), __( 'Do not show bottom social buttons on this page', 'root' ) );
            $this->field_checkbox( 'toc_hide',              __( 'Hide contents', 'root' ), __( 'Do not show contents on this page', 'root' ) );
            $this->field_checkbox( 'related_posts_hide',    __( 'Hide related posts', 'root' ), __( 'Do not show related posts on this page', 'root' ) );
            $this->field_checkbox( 'comments_hide',         __( 'Hide comments', 'root' ), __( 'Do not show comments on this page', 'root' ) );
            $this->field_checkbox( 'content_full_width',    __( 'Content across the width', 'root' ), __( 'Make content across the entire width of the page without the sidebar', 'root' ) );
            $this->field_checkbox( 'site_full_width',       __( 'Site across the width', 'root' ), __( 'Make the site across the width', 'root' ) );
            $this->field_text( 'related_posts_ids',         __( 'ID related posts', 'root' ), '', __( 'Enter the ID of the posts separated by commas to display certain posts in related posts', 'root' ) );

            echo '</table>';
        }

    }

    new Posts_Meta_Box;


    class Pages_Meta_Box extends Vetteo_Meta_Box {

        public function __construct() {
            $this->set_settings( 'meta_pages_', 'page', __( 'Root: Page settings', 'root' ), 'advanced' );

            parent::__construct();
        }

        public function render_fields()
        {
            echo '<table class="form-table">';

            $this->field_checkbox( 'header_hide',           __( 'Hide header', 'root' ), __( 'Do not show the header on this page', 'root' ) );
            $this->field_checkbox( 'header_menu_hide',      __( 'Hide top menu', 'root' ), __( 'Do not show the top menu on this page', 'root' ) );
            $this->field_checkbox( 'footer_menu_hide',      __( 'Hide bottom menu', 'root' ), __( 'Do not show the bottom menu on this page', 'root' ) );
            $this->field_checkbox( 'sidebar_hide',          __( 'Hide sidebar', 'root' ), __( 'Do not show sidebar on this page', 'root' ) );
            $this->field_checkbox( 'footer_hide',           __( 'Hide footer', 'root' ), __( 'Do not show footer on this page', 'root' ) );
            $this->field_checkbox( 'breadcrumbs_hide',      __( 'Hide breadcrumbs', 'root' ), __( 'Do not show breadcrumbs on this page', 'root' ) );
            $this->field_checkbox( 'h1_hide',               __( 'Hide title', 'root' ), __( 'Do not show title H1 on this page', 'root' ) );
            $this->field_checkbox( 'thumb_hide',            __( 'Hide thumbnail', 'root' ), __( 'Do not show thumbnail or separator on this page', 'root' ) );
            $this->field_checkbox( 'share_top_hide',        __( 'Hide top social buttons', 'root' ), __( 'Do not show top social buttons on this page', 'root' ) );
            $this->field_checkbox( 'share_bottom_hide',     __( 'Hide bottom social buttons', 'root' ), __( 'Do not show bottom social buttons on this page', 'root' ) );
            $this->field_checkbox( 'toc_hide',              __( 'Hide contents', 'root' ), __( 'Do not show contents on this page', 'root' ) );
            $this->field_checkbox( 'related_posts_hide',    __( 'Hide related posts', 'root' ), __( 'Do not show related posts on this page', 'root' ) );
            $this->field_checkbox( 'content_full_width',    __( 'Content across the width', 'root' ), __( 'Make content across the entire width of the page without the sidebar', 'root' ) );
            $this->field_checkbox( 'site_full_width',       __( 'Site across the width', 'root' ), __( 'Make the site across the width', 'root' ) );

            echo '</table>';
        }

    }

    new Pages_Meta_Box;

}
add_action( 'after_setup_theme', 'wpshop_core_metabox' );