| 1 |
<?php |
| 2 |
/** |
| 3 |
* PHP and WordPress configuration compatibility functions for the Gutenberg |
| 4 |
* editor plugin. |
| 5 |
* |
| 6 |
* @package gutenberg |
| 7 |
*/ |
| 8 |
|
| 9 |
if ( ! defined( 'ABSPATH' ) ) { |
| 10 |
die( 'Silence is golden.' ); |
| 11 |
} |
| 12 |
|
| 13 |
/** |
| 14 |
* Splits a UTF-8 string into an array of UTF-8-encoded codepoints. |
| 15 |
* |
| 16 |
* @since 0.5.0 |
| 17 |
* @deprecated 5.0.0 _mb_substr |
| 18 |
* |
| 19 |
* @param string $str The string to split. |
| 20 |
* @return string Extracted substring. |
| 21 |
*/ |
| 22 |
function _gutenberg_utf8_split( $str ) { |
| 23 |
_deprecated_function( __FUNCTION__, '5.0.0', '_mb_substr' ); |
| 24 |
|
| 25 |
return _mb_substr( $str ); |
| 26 |
} |
| 27 |
|
| 28 |
/** |
| 29 |
* Disables wpautop behavior in classic editor when post contains blocks, to |
| 30 |
* prevent removep from invalidating paragraph blocks. |
| 31 |
* |
| 32 |
* @link https://core.trac.wordpress.org/ticket/45113 |
| 33 |
* @link https://core.trac.wordpress.org/changeset/43758 |
| 34 |
* @deprecated 5.0.0 |
| 35 |
* |
| 36 |
* @param array $settings Original editor settings. |
| 37 |
* @return array Filtered settings. |
| 38 |
*/ |
| 39 |
function gutenberg_disable_editor_settings_wpautop( $settings ) { |
| 40 |
_deprecated_function( __FUNCTION__, '5.0.0' ); |
| 41 |
|
| 42 |
return $settings; |
| 43 |
} |
| 44 |
|
| 45 |
/** |
| 46 |
* Add rest nonce to the heartbeat response. |
| 47 |
* |
| 48 |
* @link https://core.trac.wordpress.org/ticket/45113 |
| 49 |
* @link https://core.trac.wordpress.org/changeset/43939 |
| 50 |
* @deprecated 5.0.0 |
| 51 |
* |
| 52 |
* @param array $response Original heartbeat response. |
| 53 |
* @return array New heartbeat response. |
| 54 |
*/ |
| 55 |
function gutenberg_add_rest_nonce_to_heartbeat_response_headers( $response ) { |
| 56 |
_deprecated_function( __FUNCTION__, '5.0.0' ); |
| 57 |
|
| 58 |
return $response; |
| 59 |
} |
| 60 |
|
| 61 |
/** |
| 62 |
* Check if we need to load the block warning in the Classic Editor. |
| 63 |
* |
| 64 |
* @deprecated 5.0.0 |
| 65 |
*/ |
| 66 |
function gutenberg_check_if_classic_needs_warning_about_blocks() { |
| 67 |
_deprecated_function( __FUNCTION__, '5.0.0' ); |
| 68 |
} |
| 69 |
|
| 70 |
/** |
| 71 |
* Adds a warning to the Classic Editor when trying to edit a post containing blocks. |
| 72 |
* |
| 73 |
* @since 3.4.0 |
| 74 |
* @deprecated 5.0.0 |
| 75 |
*/ |
| 76 |
function gutenberg_warn_classic_about_blocks() { |
| 77 |
_deprecated_function( __FUNCTION__, '5.0.0' ); |
| 78 |
} |
| 79 |
|
| 80 |
/** |
| 81 |
* Display the privacy policy help notice. |
| 82 |
* |
| 83 |
* In Gutenberg, the `edit_form_after_title` hook is not supported. Because |
| 84 |
* WordPress Core uses this hook to display this notice, it never displays. |
| 85 |
* Outputting the notice on the `admin_notices` hook allows Gutenberg to |
| 86 |
* consume the notice and display it with the Notices API. |
| 87 |
* |
| 88 |
* @since 4.5.0 |
| 89 |
* @deprecated 5.0.0 |
| 90 |
*/ |
| 91 |
function gutenberg_show_privacy_policy_help_text() { |
| 92 |
_deprecated_function( __FUNCTION__, '5.0.0' ); |
| 93 |
} |
| 94 |
|