• Resolved webbymaja

    (@webbymaja)


    In my “submit job form” page, I want to add visual editor to “job description” field. I’ve modified wp-editor-field.php and now I have Visual and Text tabs showing. But toolbars for Visual show only on click. That is, user has to click on Visual tab to display the toolbars. I would like them to be visual on page load. How can I do it?

    Here is my wp-editor-field.php
    <?php
    /**
    * Shows the right textarea form field with WP Editor on job listing forms.
    *
    * This template can be overridden by copying it to yourtheme/job_manager/form-fields/wp-editor-field.php.
    *
    * @see https://wpjobmanager.com/document/template-overrides/
    * @author Automattic
    * @package wp-job-manager
    * @category Template
    * @version 1.31.1
    */

    if ( ! defined( ‘ABSPATH’ ) ) {
    exit; // Exit if accessed directly.
    }

    $editor = apply_filters( ‘submit_job_form_wp_editor_args’, [
    ‘textarea_name’ => isset( $field[‘name’] ) ? $field[‘name’] : $key,
    ‘media_buttons’ => false,
    ‘textarea_rows’ => 8,
    ‘quicktags’ => true,
    ‘editor_css’ => ‘<style> .mce-top-part button { background-color: rgba(0,0,0,0.0) !important; } </style>’,
    ‘tinymce’ => [
    ‘plugins’ => ‘lists,paste,tabfocus,wplink,wordpress,textcolor,hr’,
    ‘paste_as_text’ => true,
    ‘paste_auto_cleanup_on_paste’ => true,
    ‘paste_remove_spans’ => true,
    ‘paste_remove_styles’ => true,
    ‘paste_remove_styles_if_webkit’ => true,
    ‘paste_strip_class_attributes’ => true,
    ‘toolbar1’ => ‘formatselect,bold,italic,bullist,numlist,blockquote,alignleft,aligncenter,alignright,link,unlink,wp_more,dfw,wp_adv’,
    ‘toolbar2’ => ‘strikethrough,underline,alignjustify,hr,fontselect,fontsizeselect,forecolor,backcolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help’,
    ‘toolbar3’ => ”,
    ‘toolbar4’ => ”
    ],
    ] );
    wp_editor( isset( $field[‘value’] ) ? wp_kses_post( $field[‘value’] ) : ”, $key, $editor );
    if ( ! empty( $field[‘description’] ) ) : ?><small class=”description”><?php echo wp_kses_post( $field[‘description’] ); ?></small><?php endif; ?>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘job description wp editor’ is closed to new replies.