Skip to content

Default Value – Header

Henner R Setyono edited this page Apr 7, 2020 · 7 revisions

NOTE: Everything here are under the key header.

So to override one of the items, you need to write it like this:

add_filter( 'custy_default_values', function( $defaults ) {

  $defaults['header']['button'] = wp_parse_args( [
    'style' => 'solid',
  ], $defaults['header']['button'] );

  return $defaults;
});

TABLE OF CONTENT

To modify the default placements, read here.

Rows

'top-row' => [
  'rowBackground' => blocksy_background_default_value([
    'backgroundColor' => [ 'default' => [ 'color' => 'var(--text)' ] ],
  ]),
  'row_padding' => 'small', // none | small | medium
],

'middle-row' => [
  'rowBackground' => blocksy_background_default_value([
    'backgroundColor' => [
      'default' => [ 'color' => 'var(--textInvert)' ],
    ],
  ]),
  'row_padding' => 'medium', // none | small | medium
],

'bottom-row' => [
  'rowBackground' => blocksy_background_default_value([
    'backgroundColor' => [
      'default' => [ 'color' => 'var(--textInvert)' ],
    ],
  ]),
  'row_padding' => 'small', // none | small | medium
],

'offcanvas' => [
  'reveal_from' => 'right', // left| above | right
  'offcanvasBackground' => blocksy_background_default_value([
    'backgroundColor' => [
      'default' => [ 'color' => 'var(--text)' ],
    ],
  ]),
  'items_alignment' => 'left',
  'close_button_style' => 'close-circle', // close | close-circle | close-square
  'closeButtonColor' => [
    'default' => [ 'color' => 'rgba(255,255,255, .5)' ],
    'hover' => [ 'color' => 'white' ],
  ],
],

Menu

'menu' => [
  'menu' => blocksy_get_default_menu(),

  'parentBackground' => [
    'default' => [ 'color' => 'CT_CSS_SKIP_RULE' ],
    'hover' => [ 'color' => 'var(--mainLight)' ],
  ],
  'parentTextColor' => [
    'default' => [ 'color' => 'var(--text)' ],
    'hover' => [ 'color' => 'var(--main)' ],
  ],
  'parentFontSize' => 'var(--fontSize)',

  'dropdownBackground' => [
    'default' => [ 'color' => 'var(--text)' ],
    'hover' => [ 'color' => 'var(--main)' ],
  ],
  'dropdownTextColor' => [
    'default' => [ 'color' => 'var(--textInvert)' ],
    'hover' => [ 'color' => 'var(--textInvert)' ],
  ],
  'dropdownFontSize' => 'var(--smallFontSize)',
],

'menu2' => $defaults['header']['menu'],

Logo

'logo' => [
  'logo_type' => 'text', // text | image | svg

  // Logo text
  'text' => get_option('blogname'),
  'textSize' => 'var(--mediumFontSize)',
  // Logo Image
  'image' => [ 'attachment_id' => null, 'url' => null ],
  'has_mobile_image' => 'no',
  'mobile_image' => [ 'attachment_id' => null, 'url' => null ],
  // Logo SVG
  'svg_code' => '<svg xmlns="http://www.w3.org/2000/svg" width="70" height="60" viewBox="0 0 452 389"><defs><clipPath id="b"><rect width="452" height="389"/></clipPath></defs><g id="a" clip-path="url(#b)"><rect width="452" height="389" fill="rgba(255,255,255,0)"/><path d="M0-225,225-612,450-225Zm391-32L327.222-368.035,263.406-257ZM59-257H223.1l84.459-145.268L225-546Zm391,32v0Z" transform="translate(1 613)" fill="#fff"/></g></svg>',

  'logoColor' => [
    'default' => [ 'color' => 'var(--text)' ],
    'hover' => [ 'color' => 'var(--main)' ],
  ],
  'logoMaxWidth' => '70px',
  'logoMaxHeight' => '60px',

  'has_tagline' => 'no',
  'tagline' => get_option('blogdescription'),
  'taglineColor' => [
    'default' => [ 'color' => 'var(--textDim)' ]
  ],
  'taglineSize' => 'var(--smallFontSize)',
  'tagline_visibility' => [
    'desktop' => true,
    'tablet' => true,
    'mobile' => false,
  ]
],

Button

'button' => [
  'text' => __( 'Contact Us' ),
  'link' => '',
  'target' => 'no',
  'has_icon' => 'no',
  'png_icon' => [],
  'svg_icon' => '',

  'size' => 'small',    // small | normal | large
  'style' => 'outline', // solid | outline | transparent
  'buttonBackground' => [
    'default' => [ 'color' => 'var(--main)' ],
    'hover' => [ 'color' => 'var(--mainDark)' ]
  ],
  'buttonColor' => [
    'default' => [ 'color' => 'var(--textInvert)' ],
    'hover' => [ 'color' => 'var(--textInvert)' ],
  ],
],

'button2' => $defaults['header']['button']

Free Text

'freetext' => [
  'content' => 'Sample Text',
  'textColor' => [
    'default' => [ 'color' => 'var(--text)' ],
    'link' => [ 'color' => 'var(--main)' ],
  ],
  'textSize' => 'var(--smallFontSize)',
  'textMaxWidth' => '100%',
],

'freetext2' => $defaults['header']['freetext'],

Search

'search' => [
  'search_style' => 'expanding', // full | expanding
  'search_placeholder' => __( 'Search...' ),
  
  'submit_button_text' => '<svg viewBox="0 0 512 512"><path d="M508.5 468.9L387.1 347.5c-2.3-2.3-5.3-3.5-8.5-3.5h-13.2c31.5-36.5 50.6-84 50.6-136C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c52 0 99.5-19.1 136-50.6v13.2c0 3.2 1.3 6.2 3.5 8.5l121.4 121.4c4.7 4.7 12.3 4.7 17 0l22.6-22.6c4.7-4.7 4.7-12.3 0-17zM208 368c-88.4 0-160-71.6-160-160S119.6 48 208 48s160 71.6 160 160-71.6 160-160 160z"/></svg>',
  'submitButtonColor' => [
    'default' => [ 'color' => 'var(--textInvert)' ],
    'hover' => [ 'color' => 'var(--textInvert)' ],
  ],
  'submitButtonBackground' => [
    'default' => [ 'color' => 'var(--text)' ],
    'hover' => [ 'color' => 'var(--main)' ],
  ],

  'searchBackground' => [
    'default' => [ 'color' => 'var(--textInvert)' ],
    'focus' => [ 'color' => 'var(--textInvert)' ],
  ]
]

Social Links

'social' => [
  'social_links' => [
    [ 'id' => 'location', 'enabled' => true ],
    [ 'id' => 'email', 'enabled' => true ],
    [ 'id' => 'phone', 'enabled' => true ],
  ],
  'icon_color' => 'custom', // custom | official
  'customColor' => [
    'icon' => [ 'color' => 'var(--textInvert)' ],
    'background' => [ 'color' => 'var(--main)' ]
  ],
  'icon_style' => 'icon-only', // icon-only | circle | square
  'has_label' => 'yes',
  'label_visibility' => [
    'desktop' => true,
    'tablet' => false,
    'mobile' => false
  ],
  'phone_label' => '+123-456-789',
  'location_label' => '',
  'email_label' => '',
],

Mobile Menu & Trigger

'mobile-menu' => [
  'menu' => blocksy_get_default_menu(),
  'mobile_menu_style' => 'default', // default | compact
  'mobileMenuBackground' => [
    'default' => [ 'color' => 'CT_CSS_SKIP_RULE' ]
  ],
  'mobileMenuTextColor' => [
    'default' => [ 'color' => 'var(--textInvert)' ],
    'hover' => [ 'color' => 'var(--sub)' ],
  ],
  
  'parentFontSize' => 'var(--mediumFontSize)',
  'dropdownFontSize' => 'var(--fontSize)',
],


'mobile-menu2' => $defaults['header']['mobile-menu'],

'trigger' => [
  'trigger_style' => 'trigger-1', // trigger-1 | trigger-2 | trigger-3
  'triggerColor' => [
    'default' => [ 'color' => 'var(--text)' ],
    'hover' => [ 'color' => 'var(--main)' ],
  ],
],