summaryrefslogtreecommitdiff
path: root/inc/core/deprecated
diff options
context:
space:
mode:
Diffstat (limited to 'inc/core/deprecated')
-rw-r--r--inc/core/deprecated/deprecated-filters.php87
-rw-r--r--inc/core/deprecated/deprecated-functions.php145
-rw-r--r--inc/core/deprecated/deprecated-hooks.php34
3 files changed, 266 insertions, 0 deletions
diff --git a/inc/core/deprecated/deprecated-filters.php b/inc/core/deprecated/deprecated-filters.php
new file mode 100644
index 0000000..ae044ee
--- /dev/null
+++ b/inc/core/deprecated/deprecated-filters.php
@@ -0,0 +1,87 @@
+<?php
+/**
+ * Deprecated Filters of Astra Theme.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.0.23
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+// Depreciating astra_color_palletes filter.
+add_filter( 'astra_color_palettes', 'astra_deprecated_color_palette', 10, 1 );
+
+/**
+ * Astra Color Palettes
+ *
+ * @since 1.0.23
+ * @param array $color_palette customizer color palettes.
+ * @return array $color_palette updated customizer color palettes.
+ */
+function astra_deprecated_color_palette( $color_palette ) {
+
+ $color_palette = astra_apply_filters_deprecated( 'astra_color_palletes', array( $color_palette ), '1.0.22', 'astra_color_palettes', '' );
+
+ return $color_palette;
+}
+
+
+// Deprecating astra_sigle_post_navigation_enabled filter.
+add_filter( 'astra_single_post_navigation_enabled', 'astra_deprecated_sigle_post_navigation_enabled', 10, 1 );
+
+/**
+ * Astra Single Post Navigation
+ *
+ * @since 1.0.27
+ * @param boolean $post_nav true | false.
+ * @return boolean $post_nav true for enabled | false for disable.
+ */
+function astra_deprecated_sigle_post_navigation_enabled( $post_nav ) {
+
+ $post_nav = astra_apply_filters_deprecated( 'astra_sigle_post_navigation_enabled', array( $post_nav ), '1.0.27', 'astra_single_post_navigation_enabled', '' );
+
+ return $post_nav;
+}
+
+// Deprecating astra_primary_header_main_rt_section filter.
+add_filter( 'astra_header_section_elements', 'astra_deprecated_primary_header_main_rt_section', 10, 2 );
+
+/**
+ * Astra Header elements.
+ *
+ * @since 1.2.2
+ * @param array $elements List of elements.
+ * @param string $header Header section type.
+ * @return array
+ */
+function astra_deprecated_primary_header_main_rt_section( $elements, $header ) {
+
+ $elements = astra_apply_filters_deprecated( 'astra_primary_header_main_rt_section', array( $elements, $header ), '1.2.2', 'astra_header_section_elements', '' );
+
+ return $elements;
+}
+
+if ( ! function_exists( 'astra_apply_filters_deprecated' ) ) {
+ /**
+ * Astra Filter Deprecated
+ *
+ * @since 1.1.1
+ * @param string $tag The name of the filter hook.
+ * @param array $args Array of additional function arguments to be passed to apply_filters().
+ * @param string $version The version of WordPress that deprecated the hook.
+ * @param string $replacement Optional. The hook that should have been used. Default false.
+ * @param string $message Optional. A message regarding the change. Default null.
+ */
+ function astra_apply_filters_deprecated( $tag, $args, $version, $replacement = false, $message = null ) {
+ if ( function_exists( 'apply_filters_deprecated' ) ) { /* WP >= 4.6 */
+ return apply_filters_deprecated( $tag, $args, $version, $replacement, $message );
+ } else {
+ return apply_filters_ref_array( $tag, $args );
+ }
+ }
+}
diff --git a/inc/core/deprecated/deprecated-functions.php b/inc/core/deprecated/deprecated-functions.php
new file mode 100644
index 0000000..779d474
--- /dev/null
+++ b/inc/core/deprecated/deprecated-functions.php
@@ -0,0 +1,145 @@
+<?php
+/**
+ * Deprecated Functions of Astra Theme.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.0.23
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! function_exists( 'astra_blog_post_thumbnai_and_title_order' ) ) :
+
+ /**
+ * Blog post thumbnail & title order
+ *
+ * @since 1.4.9
+ * @deprecated 1.4.9 Use astra_blog_post_thumbnail_and_title_order()
+ * @see astra_blog_post_thumbnail_and_title_order()
+ *
+ * @return void
+ */
+ function astra_blog_post_thumbnai_and_title_order() {
+ _deprecated_function( __FUNCTION__, '1.4.9', 'astra_blog_post_thumbnail_and_title_order()' );
+
+ astra_blog_post_thumbnail_and_title_order();
+ }
+
+endif;
+
+if ( ! function_exists( 'get_astra_secondary_class' ) ) :
+
+ /**
+ * Retrieve the classes for the secondary element as an array.
+ *
+ * @since 1.5.2
+ * @deprecated 1.5.2 Use astra_get_secondary_class()
+ * @param string|array $class One or more classes to add to the class list.
+ * @see astra_get_secondary_class()
+ *
+ * @return array
+ */
+ function get_astra_secondary_class( $class = '' ) {
+ _deprecated_function( __FUNCTION__, '1.5.2', 'astra_get_secondary_class()' );
+
+ return astra_get_secondary_class( $class );
+ }
+
+endif;
+
+if ( ! function_exists( 'deprecated_astra_color_palette' ) ) :
+
+ /**
+ * Depreciating astra_color_palletes filter.
+ *
+ * @since 1.5.2
+ * @deprecated 1.5.2 Use astra_deprecated_color_palette()
+ * @param array $color_palette customizer color palettes.
+ * @see astra_deprecated_color_palette()
+ *
+ * @return array
+ */
+ function deprecated_astra_color_palette( $color_palette ) {
+ _deprecated_function( __FUNCTION__, '1.5.2', 'astra_deprecated_color_palette()' );
+
+ return astra_deprecated_color_palette( $color_palette );
+ }
+
+endif;
+
+if ( ! function_exists( 'deprecated_astra_sigle_post_navigation_enabled' ) ) :
+
+ /**
+ * Deprecating astra_sigle_post_navigation_enabled filter.
+ *
+ * @since 1.5.2
+ * @deprecated 1.5.2 Use astra_deprecated_sigle_post_navigation_enabled()
+ * @param boolean $post_nav true | false.
+ * @see astra_deprecated_sigle_post_navigation_enabled()
+ *
+ * @return array
+ */
+ function deprecated_astra_sigle_post_navigation_enabled( $post_nav ) {
+ _deprecated_function( __FUNCTION__, '1.5.2', 'astra_deprecated_sigle_post_navigation_enabled()' );
+
+ return astra_deprecated_sigle_post_navigation_enabled( $post_nav );
+ }
+
+endif;
+
+if ( ! function_exists( 'deprecated_astra_primary_header_main_rt_section' ) ) :
+
+ /**
+ * Deprecating astra_primary_header_main_rt_section filter.
+ *
+ * @since 1.5.2
+ * @deprecated 1.5.2 Use astra_deprecated_primary_header_main_rt_section()
+ * @param array $elements List of elements.
+ * @param string $header Header section type.
+ * @see astra_deprecated_primary_header_main_rt_section()
+ *
+ * @return array
+ */
+ function deprecated_astra_primary_header_main_rt_section( $elements, $header ) {
+ _deprecated_function( __FUNCTION__, '1.5.2', 'astra_deprecated_primary_header_main_rt_section()' );
+
+ return astra_deprecated_primary_header_main_rt_section( $elements, $header );
+ }
+
+endif;
+
+if ( ! function_exists( 'astar' ) ) :
+
+ /**
+ * Get a specific property of an array without needing to check if that property exists.
+ *
+ * @since 1.5.2
+ * @deprecated 1.5.2 Use astra_get_prop()
+ * @param array $array Array from which the property's value should be retrieved.
+ * @param string $prop Name of the property to be retrieved.
+ * @param string $default Optional. Value that should be returned if the property is not set or empty. Defaults to null.
+ * @see astra_get_prop()
+ *
+ * @return null|string|mixed The value
+ */
+ function astar( $array, $prop, $default = null ) {
+ return astra_get_prop( $array, $prop, $default );
+ }
+
+endif;
+
+/**
+ * Check if we're being delivered AMP.
+ *
+ * @return bool
+ */
+function astra_is_emp_endpoint() {
+ _deprecated_function( __FUNCTION__, '2.0.1', 'astra_is_amp_endpoint()' );
+
+ return astra_is_amp_endpoint();
+}
diff --git a/inc/core/deprecated/deprecated-hooks.php b/inc/core/deprecated/deprecated-hooks.php
new file mode 100644
index 0000000..0f2943d
--- /dev/null
+++ b/inc/core/deprecated/deprecated-hooks.php
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Deprecated Hooks of Astra Theme.
+ *
+ * @package Astra
+ * @author Astra
+ * @copyright Copyright (c) 2020, Astra
+ * @link https://wpastra.com/
+ * @since Astra 1.0.23
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit;
+}
+
+if ( ! function_exists( 'astra_do_action_deprecated' ) ) {
+ /**
+ * Astra Filter Deprecated
+ *
+ * @since 1.1.1
+ * @param string $tag The name of the filter hook.
+ * @param array $args Array of additional function arguments to be passed to apply_filters().
+ * @param string $version The version of WordPress that deprecated the hook.
+ * @param string $replacement Optional. The hook that should have been used. Default false.
+ * @param string $message Optional. A message regarding the change. Default null.
+ */
+ function astra_do_action_deprecated( $tag, $args, $version, $replacement = false, $message = null ) {
+ if ( function_exists( 'do_action_deprecated' ) ) { /* WP >= 4.6 */
+ do_action_deprecated( $tag, $args, $version, $replacement, $message );
+ } else {
+ do_action_ref_array( $tag, $args );
+ }
+ }
+}