| Server IP : 208.109.34.209 / Your IP : 216.73.217.134 Web Server : Apache System : Linux 209.34.109.208.host.secureserver.net 5.14.0-687.29.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Jul 23 16:18:48 EDT 2026 x86_64 User : oceanproject ( 1012) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/oceanproject/public_html/wp-content/themes/reda/inc/ |
Upload File : |
<?php
function reda_formats_button($buttons) {
array_unshift($buttons, 'styleselect');
return $buttons;
}
add_filter('mce_buttons', 'reda_formats_button');
function reda_mce_before_init_insert_formats($init_array) {
$style_formats = array(
array(
'title' => 'Lead header',
'inline' => 'span',
'styles' => array('line-height' => '1.8em'),
),
array(
'title' => 'Lead paragraph',
'inline' => 'span',
'styles' => array('font-size' => '17px', 'line-height' => '2.1em'),
),
array(
'title' => 'Subheading',
'block' => 'p',
'classes' => 'reda-header-top',
'styles' => array('margin-bottom' => '5px'),
),
array(
'title' => 'Font weight 100',
'inline' => 'span',
'styles' => array('font-weight' => '100'),
),
array(
'title' => 'Font weight 200',
'inline' => 'span',
'styles' => array('font-weight' => '200'),
),
array(
'title' => 'Font weight 300',
'inline' => 'span',
'styles' => array('font-weight' => '300'),
),
array(
'title' => 'Font weight 400',
'inline' => 'span',
'styles' => array('font-weight' => '400'),
),
array(
'title' => 'Font weight 500',
'inline' => 'span',
'styles' => array('font-weight' => '500'),
),
array(
'title' => 'Font weight 600',
'inline' => 'span',
'styles' => array('font-weight' => '600'),
),
array(
'title' => 'Font weight 700',
'inline' => 'span',
'styles' => array('font-weight' => '700'),
),
array(
'title' => 'Font weight 800',
'inline' => 'span',
'styles' => array('font-weight' => '800'),
),
array(
'title' => 'Font weight 900',
'inline' => 'span',
'styles' => array('font-weight' => '900'),
),
);
$init_array['style_formats'] = json_encode( $style_formats );
$sizes = '';
for($size = 10; $size <= 160; $size+=2) {
$sizes .= ' '.$size.'px';
}
$init_array['fontsizeselect'] = true;
$init_array['fontsize_formats'] = $sizes;
return $init_array;
}
add_filter('tiny_mce_before_init', 'reda_mce_before_init_insert_formats');
function customize_acf_wysiwyg_toolbar( $toolbars ) {
if (($key = array_search('fontsizeselect' , $toolbars['Full'][2])) !== true) {
array_push($toolbars['Full'][2], 'fontsizeselect');
}
return $toolbars;
}
if ( ! function_exists( 'wpex_mce_buttons' ) ) {
function wpex_mce_buttons( $buttons ) {
array_push( $buttons, 'fontsizeselect' );
return $buttons;
}
}
add_filter( 'mce_buttons_2', 'wpex_mce_buttons' );