' . __( 'Continued', 'pressbooks-aldine' ) . ''; } /** * Add style select dropdown to TinyMCE. * * @param array $buttons The default button array. * @return array The modified array. */ function add_style_select( $buttons ) { array_unshift( $buttons, 'styleselect' ); return $buttons; } /** * Add custom block formats to TinyMCE. * * @param array $init_array The default array. * @return array The modified array. **/ function add_blocks( $init_array ) { $style_formats = [ [ 'title' => __( 'Page Section', 'pressbooks-aldine' ), 'block' => 'div', 'classes' => [ 'page-section' ], 'wrapper' => true, ], [ 'title' => __( 'Page Section (Accent)', 'pressbooks-aldine' ), 'block' => 'div', 'classes' => [ 'page-section', 'page-section--accent' ], 'wrapper' => true, ], [ 'title' => __( 'Page Section (Bordered)', 'pressbooks-aldine' ), 'block' => 'div', 'classes' => [ 'page-section', 'page-section--bordered' ], 'wrapper' => true, ], [ 'title' => __( 'Page Section (Borderless)', 'pressbooks-aldine' ), 'block' => 'div', 'classes' => [ 'page-section', 'page-section--borderless' ], 'wrapper' => true, ], [ 'title' => __( 'Call to Action', 'pressbooks-aldine' ), 'inline' => 'a', 'classes' => [ 'call-to-action' ], ], ]; $init_array['style_formats'] = json_encode( $style_formats ); return $init_array; } /** * Add things to the menu. * * @param string $items * @param object $args * @return string */ function adjust_menu( $items, $args ) { if ( $args->theme_location === 'primary-menu' ) { return \Aldine\Helpers\get_default_menu( $items ); } return $items; }