Description
The wpforms_display_media_button
filter is used to return true or false to display or hide the Add Form button on the Classic Editor.
Parameters
- $display
- (bool) (Required) Determines to display the Add Form button on WordPress admin pages, posts or custom post types. The default is
true
(to show)
Source
includes/admin/class-editor.php
More Information
The wpforms_display_media_button
filter provides an “Add Form” button inside the Classic Editor.
Examples
/** * Remove the 'Add Form' WPForms TinyMCE button. * * @link https://wpforms.com/developers/wpforms_display_media_button/ * * @param bool $display Default is true. * * @return bool */ function wpf_dev_remove_media_button( $display ) { $screen = get_current_screen(); if ( 'page' == $screen->post_type || 'post' == $screen->post_type ) { return false; } return $display; } add_filter( 'wpforms_display_media_button', 'wpf_dev_remove_media_button', 10, 1 );