diff options
author | Zach van Rijn <me@zv.io> | 2021-07-21 16:19:29 -0500 |
---|---|---|
committer | Zach van Rijn <me@zv.io> | 2021-07-21 16:19:29 -0500 |
commit | 69c17f9c1942fd0d6a5ea941636e87723b8a6fe2 (patch) | |
tree | e1d0212147048204b0eede0aa6ff79849ed479da /inc/metabox/class-astra-meta-box-operations.php | |
parent | 74a7109a2a5ab0d191f26c917ae69e46f0d83b32 (diff) | |
download | blog-ng-69c17f9c1942fd0d6a5ea941636e87723b8a6fe2.tar.gz blog-ng-69c17f9c1942fd0d6a5ea941636e87723b8a6fe2.tar.bz2 blog-ng-69c17f9c1942fd0d6a5ea941636e87723b8a6fe2.tar.xz blog-ng-69c17f9c1942fd0d6a5ea941636e87723b8a6fe2.zip |
dos2unix on all .php files, begin paring down admin page and site branding.
Diffstat (limited to 'inc/metabox/class-astra-meta-box-operations.php')
-rw-r--r-- | inc/metabox/class-astra-meta-box-operations.php | 230 |
1 files changed, 115 insertions, 115 deletions
diff --git a/inc/metabox/class-astra-meta-box-operations.php b/inc/metabox/class-astra-meta-box-operations.php index c9cc708..a1c8f8e 100644 --- a/inc/metabox/class-astra-meta-box-operations.php +++ b/inc/metabox/class-astra-meta-box-operations.php @@ -1,115 +1,115 @@ -<?php
-/**
- * Astra Meta Box Operations
- *
- * @package Astra
- * @author Astra
- * @copyright Copyright (c) 2020, Astra
- * @link https://wpastra.com/
- * @since Astra 1.0.0
- */
-
-if ( ! defined( 'ABSPATH' ) ) {
- exit; // Exit if accessed directly.
-}
-
-/**
- * Meta Box
- */
-if ( ! class_exists( 'Astra_Meta_Box_Operations' ) ) {
-
- /**
- * Meta Box
- */
- class Astra_Meta_Box_Operations {
-
- /**
- * Instance
- *
- * @var $instance
- */
- private static $instance;
-
- /**
- * Initiator
- */
- public static function get_instance() {
- if ( ! isset( self::$instance ) ) {
- self::$instance = new self();
- }
- return self::$instance;
- }
-
- /**
- * Constructor
- */
- public function __construct() {
- add_action( 'wp', array( $this, 'meta_hooks' ) );
- }
-
- /**
- * Metabox Hooks
- */
- public function meta_hooks() {
-
- if ( is_singular() ) {
- add_action( 'wp_head', array( $this, 'primary_header' ) );
- add_filter( 'astra_the_title_enabled', array( $this, 'post_title' ) );
- add_filter( 'body_class', array( $this, 'body_class' ) );
- }
- }
-
- /**
- * Primary Header
- */
- public function primary_header() {
-
- $display_header = get_post_meta( get_the_ID(), 'ast-main-header-display', true );
-
- $display_header = apply_filters( 'ast_main_header_display', $display_header );
-
- if ( 'disabled' == $display_header ) {
-
- remove_action( 'astra_masthead', 'astra_masthead_primary_template' );
- }
- }
-
- /**
- * Disable Post / Page Title
- *
- * @param boolean $defaults Show default post title.
- * @return boolean Status of default post title.
- */
- public function post_title( $defaults ) {
-
- $title = get_post_meta( get_the_ID(), 'site-post-title', true );
- if ( 'disabled' == $title ) {
- $defaults = false;
- }
-
- return $defaults;
- }
-
- /**
- * Add Body Classes
- *
- * @param array $classes Body Classes Array.
- * @return array
- */
- public function body_class( $classes ) {
-
- $title = get_post_meta( get_the_ID(), 'site-post-title', true );
-
- if ( 'disabled' != $title ) {
- $classes[] = 'ast-normal-title-enabled';
- }
-
- return $classes;
- }
- }
-}
-
-/**
- * Kicking this off by calling 'get_instance()' method
- */
-Astra_Meta_Box_Operations::get_instance();
+<?php +/** + * Astra Meta Box Operations + * + * @package Astra + * @author Astra + * @copyright Copyright (c) 2020, Astra + * @link https://wpastra.com/ + * @since Astra 1.0.0 + */ + +if ( ! defined( 'ABSPATH' ) ) { + exit; // Exit if accessed directly. +} + +/** + * Meta Box + */ +if ( ! class_exists( 'Astra_Meta_Box_Operations' ) ) { + + /** + * Meta Box + */ + class Astra_Meta_Box_Operations { + + /** + * Instance + * + * @var $instance + */ + private static $instance; + + /** + * Initiator + */ + public static function get_instance() { + if ( ! isset( self::$instance ) ) { + self::$instance = new self(); + } + return self::$instance; + } + + /** + * Constructor + */ + public function __construct() { + add_action( 'wp', array( $this, 'meta_hooks' ) ); + } + + /** + * Metabox Hooks + */ + public function meta_hooks() { + + if ( is_singular() ) { + add_action( 'wp_head', array( $this, 'primary_header' ) ); + add_filter( 'astra_the_title_enabled', array( $this, 'post_title' ) ); + add_filter( 'body_class', array( $this, 'body_class' ) ); + } + } + + /** + * Primary Header + */ + public function primary_header() { + + $display_header = get_post_meta( get_the_ID(), 'ast-main-header-display', true ); + + $display_header = apply_filters( 'ast_main_header_display', $display_header ); + + if ( 'disabled' == $display_header ) { + + remove_action( 'astra_masthead', 'astra_masthead_primary_template' ); + } + } + + /** + * Disable Post / Page Title + * + * @param boolean $defaults Show default post title. + * @return boolean Status of default post title. + */ + public function post_title( $defaults ) { + + $title = get_post_meta( get_the_ID(), 'site-post-title', true ); + if ( 'disabled' == $title ) { + $defaults = false; + } + + return $defaults; + } + + /** + * Add Body Classes + * + * @param array $classes Body Classes Array. + * @return array + */ + public function body_class( $classes ) { + + $title = get_post_meta( get_the_ID(), 'site-post-title', true ); + + if ( 'disabled' != $title ) { + $classes[] = 'ast-normal-title-enabled'; + } + + return $classes; + } + } +} + +/** + * Kicking this off by calling 'get_instance()' method + */ +Astra_Meta_Box_Operations::get_instance(); |