Last active
December 3, 2024 16:13
-
-
Save tripflex/e3aaf95c9d9bde582287bdefbff7aee2 to your computer and use it in GitHub Desktop.
Customize WP Job Manager wp_editor arguments
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'submit_job_form_wp_editor_args', 'smyles_submit_job_form_wp_editor_args' ); | |
function smyles_submit_job_form_wp_editor_args( $args ){ | |
// @see https://github.com/Automattic/WP-Job-Manager/blob/master/templates/form-fields/wp-editor-field.php#L2 | |
// change quicktags to true | |
$args['quicktags'] = true; | |
// change rows to 10 (default is 8) | |
$args['textarea_rows'] = 10; | |
// Add underline to TinyMCE toolbar @see https://www.tinymce.com/docs/advanced/editor-control-identifiers/#toolbarcontrols | |
// https://www.tiny.cloud/docs/tinymce/6/basic-setup/#toolbar-configuration | |
$args['tinymce']['toolbar1'] = 'bold,italic,underline,|,bullist,numlist,|,link,unlink,|,undo,redo'; | |
return $args; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Show "advanced toolbar by default" | |
add_filter('tiny_mce_before_init', function($init_array) { | |
// Show the second toolbar by default | |
$init_array['wordpress_adv_hidden'] = false; | |
return $init_array; | |
}); |
More examples can be found below, as well as specifics and recommendations around what to use for toolbars:
https://gist.github.com/tripflex/5e9024f7a949c423e8be3daea290e6c4
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See the defaults for WP Job Manager WP Editor field here:
https://github.com/Automattic/WP-Job-Manager/blob/master/templates/form-fields/wp-editor-field.php#L18