Astra_Ext_Advanced_Hooks_Meta::init_metabox()

Init Metabox


Description


Source

File: addons/advanced-hooks/classes/class-astra-ext-advanced-hooks-meta.php

		public function init_metabox() {
			add_action( 'add_meta_boxes', array( $this, 'setup_meta_box' ) );
			add_action( 'edit_form_after_title', array( $this, 'enable_php_markup' ), 1, 1 );
			add_action( 'admin_footer', array( $this, 'add_navigation_button' ), 1, 1 );
			add_action( 'edit_form_after_editor', array( $this, 'php_editor_markup' ), 10, 1 );
			add_action( 'save_post', array( $this, 'save_meta_box' ) );

			/**
			 * Set metabox options
			 *
			 * @see https://php.net/manual/en/filter.filters.sanitize.php
			 */
			self::$meta_option = apply_filters(
				'astra_advanced_hooks_meta_box_options',
				array(
					'ast-advanced-hook-location'  => array(
						'default'  => array(),
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-exclusion' => array(
						'default'  => array(),
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-layout'    => array(
						'default'  => '',
						'sanitize' => 'FILTER_DEFAULT',
					),

					'ast-advanced-hook-action'    => array(
						'default'  => '',
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-priority'  => array(
						'default'  => '',
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-with-php'  => array(
						'default'  => '',
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-php-code'  => array(
						'default'  => '<!-- Add your snippet here. -->',
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-users'     => array(
						'default'  => array(),
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-padding'   => array(
						'default'  => array(),
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-header'    => array(
						'default'  => array(),
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-footer'    => array(
						'default'  => array(),
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-404-page'                => array(
						'default'  => array(),
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-hook-content'   => array(
						'default'  => array(),
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-display-device' => array(
						'default'  => array( 'desktop', 'tablet', 'mobile' ),
						'sanitize' => 'FILTER_DEFAULT',
					),
					'ast-advanced-time-duration'  => array(
						'default'  => array(
							'enabled'  => '',
							'start-dt' => '',
							'end-dt'   => '',
						),
						'sanitize' => 'FILTER_DEFAULT',
					),
				)
			);

		}


User Contributed Notes

You must log in before being able to contribute a note or feedback.