do_action( 'wp_enqueue_code_editor', $settings ) There is also an action inside of that function where you can hook your own functions and maybe add something else related to the WordPress Code Editor. You can also filter the settings of a code editor by using the filter wp_code_editor_settings. This filter passes 2 variables, $settings and $args, where $settings are the final settings and the $args are the arguments passed to the function wp_enqueue_code_editor. There are a lot of settings that you can change but probably the most used ones are the type and also the indents such as indentUnit and tabSize. Here are some of the types which you could set: To find out how you can use that function, read the code in wp-includes/general-template.php ( online). The function wp_enqueue_code_editor for the WordPress Code Editor were introduced with the version 4.9.0. WordPress ships with their own code editor, so why not enhance the user experience by providing a nice way of editing the code? In this tutorial, you’ll see how to use the WordPress Code Editor and integrate it with your own plugin or themes. When that comes, we usually tend to use the classic textarea field for that. When you’re developing plugins, themes or even custom solutions, you might provide your clients a way to insert custom scripts or styles.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |