From dce15b92d0fe1085918384086882671641ffa61b Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Fri, 7 Feb 2020 23:28:22 +0000 Subject: [PATCH] Docs: Improve description for the `$editor_id` parameter of `wp_editor()` and `_WP_Editors::editor()`. The restictions mentioned for the parameter value should be consistenct. Props pbiron, SergeyBiryukov. Fixes #49384. git-svn-id: https://develop.svn.wordpress.org/trunk@47210 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-editor.php | 18 ++++++++++-------- src/wp-includes/general-template.php | 6 ++++-- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index 0913621f3c..ce375bcf61 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -36,7 +36,8 @@ final class _WP_Editors { * * @since 3.3.0 * - * @param string $editor_id ID for the current editor instance. + * @param string $editor_id HTML ID for the textarea and TinyMCE and Quicktags instances. + * Should not contain square brackets. * @param array $settings { * Array of editor arguments. * @@ -75,7 +76,7 @@ final class _WP_Editors { * @see _WP_Editors::parse_settings() * * @param array $settings Array of editor arguments. - * @param string $editor_id ID for the current editor instance. Accepts 'classic-block' + * @param string $editor_id Unique editor identifier, e.g. 'content'. Accepts 'classic-block' * when called from block editor's Classic block. */ $settings = apply_filters( 'wp_editor_settings', $settings, $editor_id ); @@ -147,9 +148,10 @@ final class _WP_Editors { * * @since 3.3.0 * - * @param string $content The initial content of the editor. - * @param string $editor_id ID for the textarea and TinyMCE and Quicktags instances (can contain only ASCII letters and numbers). - * @param array $settings See _WP_Editors::parse_settings() for description. + * @param string $content Initial content for the editor. + * @param string $editor_id HTML ID for the textarea and TinyMCE and Quicktags instances. + * Should not contain square brackets. + * @param array $settings See _WP_Editors::parse_settings() for description. */ public static function editor( $content, $editor_id, $settings = array() ) { $set = self::parse_settings( $editor_id, $settings ); @@ -310,8 +312,8 @@ final class _WP_Editors { * * @global string $tinymce_version * - * @param string $editor_id - * @param array $set + * @param string $editor_id Unique editor identifier, e.g. 'content'. + * @param array $set Array of editor arguments. */ public static function editor_settings( $editor_id, $set ) { global $tinymce_version; @@ -353,7 +355,7 @@ final class _WP_Editors { * @since 3.3.0 * * @param array $qtInit Quicktags settings. - * @param string $editor_id The unique editor ID, e.g. 'content'. + * @param string $editor_id Unique editor identifier, e.g. 'content'. */ $qtInit = apply_filters( 'quicktags_settings', $qtInit, $editor_id ); diff --git a/src/wp-includes/general-template.php b/src/wp-includes/general-template.php index 0e821ac744..4f48de5322 100644 --- a/src/wp-includes/general-template.php +++ b/src/wp-includes/general-template.php @@ -3400,11 +3400,13 @@ function wp_default_editor() { * See https://core.trac.wordpress.org/ticket/19173 for more information. * * @see _WP_Editors::editor() + * @see _WP_Editors::parse_settings() * @since 3.3.0 * * @param string $content Initial content for the editor. - * @param string $editor_id HTML ID attribute value for the textarea and TinyMCE. Can only be /[a-z]+/. - * @param array $settings See _WP_Editors::editor(). + * @param string $editor_id HTML ID attribute value for the textarea and TinyMCE. + * Should not contain square brackets. + * @param array $settings See _WP_Editors::parse_settings() for description. */ function wp_editor( $content, $editor_id, $settings = array() ) { if ( ! class_exists( '_WP_Editors', false ) ) {