Skip to content

Instantly share code, notes, and snippets.

@unaibamir
Created September 4, 2020 23:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save unaibamir/d33c3a02a4045b9060bc3ffed6cc6040 to your computer and use it in GitHub Desktop.
Save unaibamir/d33c3a02a4045b9060bc3ffed6cc6040 to your computer and use it in GitHub Desktop.
ld-wp-editor-field.php
add_filter( "learndash_settings_fields", "custom_learndash_settings_fields", 99, 2 );
function custom_learndash_settings_fields( $fields, $metabox_key ) {
if( $metabox_key = "learndash-course-display-content-settings" ) {
$fields['course_materials_2'] = array(
'label' => 'Testing',
'name' => 'course_materials_2',
'type' => 'wpeditor',
'value' => $fields['course_materials_2'],
'default' => '',
'placeholder' => esc_html__( 'Add a list of needed documents or URLs. This field supports HTML.', 'learndash' ),
'editor_args' => array(
'textarea_name' => $metabox_key . '[course_materials_2]',
'textarea_rows' => 3,
),
);
}
return $fields;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment