post_type; $disabled_post_types = apply_filters( 'abt_disabled_post_types', [ 'acf', 'um_form' ] ); $is_valid_post_type = ! in_array( $post_type, array_merge( [ 'attachment' ], is_array( $disabled_post_types ) ? $disabled_post_types : [] ), true ); if ( $is_valid_post_type ) { add_action( 'add_meta_boxes', __NAMESPACE__ . '\add_metaboxes' ); add_action( 'admin_enqueue_scripts', __NAMESPACE__ . '\enqueue_scripts' ); add_action( 'save_post', __NAMESPACE__ . '\save_meta' ); add_filter( 'mce_css', function( string $mce_css ): string { return join( ',', array_filter( [ $mce_css, ABT_ROOT_URI . '/bundle/drivers/tinymce.css', ] ) ); } ); add_filter( 'mce_external_plugins', function( array $plugins ): array { $plugins['noneditable'] = '//cdn.jsdelivr.net/npm/tinymce/plugins/noneditable/plugin.min.js'; return $plugins; } ); } } /** * Adds metaboxes to posts and pages. * * @param string $post_type The post type. */ function add_metaboxes( string $post_type ) { add_meta_box( 'abt-reflist', __( 'Reference List', 'academic-bloggers-toolkit' ), function() { wp_nonce_field( Form_Actions::SET_LEGACY_EDITOR_STATE, ABT_NONCE ); ?>