base ) && 'post' === $screen->base ) { add_action( 'admin_notices', array( __CLASS__, 'handle_editor_view_js' ) ); add_action( 'admin_head', array( __CLASS__, 'admin_head' ) ); } } public static function admin_head() { remove_action( 'media_buttons', 'grunion_media_button', 999 ); add_action( 'media_buttons', array( __CLASS__, 'grunion_media_button' ), 999 ); } public static function grunion_media_button() { $title = __( 'Add Contact Form', 'jetpack' ); ?> plugins_url( 'css/editor-inline-editing-style.css', __FILE__ ), 'inline_editing_style_rtl' => plugins_url( 'css/editor-inline-editing-style-rtl.css', __FILE__ ), 'dashicons_css_url' => includes_url( 'css/dashicons.css' ), 'default_form' => '[contact-field label="' . __( 'Name', 'jetpack' ) . '" type="name" required="true" /]' . '[contact-field label="' . __( 'Email', 'jetpack' ) . '" type="email" required="true" /]' . '[contact-field label="' . __( 'Website', 'jetpack' ) . '" type="url" /]' . '[contact-field label="' . __( 'Message', 'jetpack' ) . '" type="textarea" /]', 'labels' => array( 'submit_button_text' => __( 'Submit', 'jetpack' ), /** This filter is documented in modules/contact-form/grunion-contact-form.php */ 'required_field_text' => apply_filters( 'jetpack_required_field_text', __( '(required)', 'jetpack' ) ), 'edit_close_ays' => __( 'Are you sure you\'d like to stop editing this form without saving your changes?', 'jetpack' ), 'quicktags_label' => __( 'contact form', 'jetpack' ), 'tinymce_label' => __( 'Add contact form', 'jetpack' ), ) ) ); add_editor_style( plugin_dir_url( __FILE__ ) . 'css/editor-style.css' ); } /** * JS Templates. */ public static function editor_view_js_templates() { ?>