true ), 'objects' ); foreach ( $post_types as $post_type => $object ) { if ( 'attachment' === $post_type ) { continue; } add_settings_field( 'prepend_' . $post_type, '', array( $this, 'prepend_html' ), 'writing', 'apporprep_section', array( 'post_type' => $post_type ) ); add_settings_field( 'append_' . $post_type, '', array( $this, 'append_html' ), 'writing', 'apporprep_section', array( 'post_type' => $post_type ) ); register_setting( 'writing', 'prepend_' . $post_type, array( $this, 'validate' ) ); register_setting( 'writing', 'append_' . $post_type, array( $this, 'validate' ) ); } } public function header_html() { ?>
true, 'media_buttons' => true, 'textarea_rows' => 8, 'teeny' => true ) ); } public function append_html( $args ) { $post_type = $args['post_type']; $value = get_option( 'append_' . $post_type, '' ); wp_editor( $value, 'append_' . $post_type, array( 'quicktags' => true, 'media_buttons' => true, 'textarea_rows' => 8, 'teeny' => true ) ); } public function validate( $value ) { $value = wp_kses( $value, wp_kses_allowed_html( 'post' ) ); return $value; } }