Marks a shortcode as deprecated and inform when it has been used.
Description
See also
Parameters
- $shortcode
-
(string) (Required) The shortcode that was called.
- $version
-
(string) (Required) The version of the plugin that deprecated the shortcode.
- $replacement
-
(string) (Optional) The shortcode that should have been called.
Default value: null
Source
File: src/error-handler.php
public function deprecated_shortcode( $shortcode, $version, $replacement = null ) { do_action( 'deprecated_shortcode_run', $shortcode, $replacement, $version ); if ( WP_DEBUG && apply_filters( 'deprecated_shortcode_trigger_error', true ) ) { if ( ! is_null( $replacement ) ) { $message = sprintf( $this->get_translation( 'deprecated_shortcode' ), $shortcode, $version, $replacement ); } else { $message = sprintf( $this->get_translation( 'deprecated_shortcode_no_alt' ), $shortcode, $version ); } torro()->logger()->debug( $message, array( 'deprecated' => true ) ); } }
Changelog
Version | Description |
---|---|
1.0.0 | Introduced. |