I need to add some gravity varieties filters in my capabilities.php. I’ve the code up and working, however I wish to enhance this snippet with a situation. As I solely want these filters on 1 web page of my web site, it would not make sense for it to run site-wide.
I am not a programmer. I attempted a few methods to place this code snippet underneath the situation: "if (is_page( array( ‘post-form’ ) ) ) {" however with out success. I do know it is potential so as to add this conditional inside every operate, however that does not look superb, and I would like extra optimized code:
add_filter( 'gform_rich_text_editor_buttons_17', 'gravityfpega_botoestiny', 10, 2 );
operate gravityfpega_botoestiny() {
$mce_buttons = array( 'formatselect', 'daring', 'italic', 'bullist', 'numlist', 'blockquote', 'alignleft', 'aligncenter', 'alignright', 'hyperlink', 'unlink', 'spellchecker' ); // Allow solely Daring, Italic and Bullet Checklist buttons
return $mce_buttons;
}
add_filter( 'gform_rich_text_editor_buttons_row_two_17', 'gravityfpega_botoestiny2', 10, 2 );
operate gravityfpega_botoestiny2() {
$mce_buttons = array( 'strikethrough', 'hr', 'forecolor', 'removeformat', 'charmap', 'outdent', 'indent', 'undo', 'redo', 'wp_help' ); // Allow solely Daring, Italic and Bullet Checklist buttons
return $mce_buttons;
}
operate gravityfpega_mediatinymce( $editor_settings, $field_object, $type, $entry ) {
$editor_settings['media_buttons'] = true;
$editor_settings['editor_height'] = 600;
return $editor_settings;
}
add_filter( 'gform_rich_text_editor_options_17', 'gravityfpega_mediatinymce', 10, 4 );
operate gravityfpega_dragdroptinymce( $editor_settings, $field_object, $type, $entry ) {
$editor_settings['drag_drop_upload'] = true;
return $editor_settings;
}
//masses script to do the oembed stuff
operate alt_lab_front_end_scripts(){
wp_enqueue_editor();
wp_enqueue_script( 'mce-view', '', array('tiny_mce') );
}
add_action( 'wp_enqueue_scripts', 'alt_lab_front_end_scripts' );
add_filter( 'gform_rich_text_editor_options_17', 'gravityfpega_dragdroptinymce', 10, 4 );
add_filter( 'gform_advancedpostcreation_excerpt', 'enable_excerpt', 10, 1 );
operate enable_excerpt( $enable_excerpt ){
return true;
} }
// https://gravitywiz.com/automatic-save-and-continue-with-gravity-forms
if ( class_exists( 'GW_Save_Continue_Auto_Load' ) ) {
new GW_Save_Continue_Auto_Load( array(
'form_ids' => array( 17 ),
'enable_inline_confirmation' => true,
'auto_save' => true
) );
}
Can somebody assist me please?