} } /** * Do Deprecated Action * * A method used to run deprecated actions through Elementor's deprecation process. * * @since 3.1.0 * * @param string $hook * @param array $args * @param string $version * @param string $replacement * @param null|string $base_version * * @throws \Exception */ public function do_deprecated_action( $hook, $args, $version, $replacement = '', $base_version = null ) { if ( ! has_action( $hook ) ) { return; } $this->deprecated_hook( $hook, $version, $replacement, $base_version ); do_action_ref_array( $hook, $args ); } /** * Apply Deprecated Filter * * A method used to run deprecated filters through Elementor's deprecation process. * * @since 3.2.0 * * @param string $hook * @param array $args * @param string $version * @param string $replacement * @param null|string $base_version * * @return mixed * @throws \Exception */ public function apply_deprecated_filter( $hook, $args, $version, $replacement = '', $base_version = null ) { if ( ! has_action( $hook ) ) { // `$args` should be an array, but in order to keep BC, we need to support non-array values. if ( is_array( $args ) ) { return $args[0] ?? null; } return $args; } // BC - See the comment above. if ( ! is_array( $args ) ) { $args = [ $args ]; } // Avoid associative arrays. $args = array_values( $args ); $this->deprecated_hook( $hook, $version, $replacement, $base_version ); return apply_filters_ref_array( $hook, $args ); } }