Skip to content

Instantly share code, notes, and snippets.

@tripflex
Last active April 22, 2024 19:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tripflex/e3aaf95c9d9bde582287bdefbff7aee2 to your computer and use it in GitHub Desktop.
Save tripflex/e3aaf95c9d9bde582287bdefbff7aee2 to your computer and use it in GitHub Desktop.
Customize WP Job Manager wp_editor arguments
<?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;
}
<?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;
});
@tripflex
Copy link
Author

@tripflex
Copy link
Author

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