Advertisement
Guest User

Untitled

a guest
May 27th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. /**
  2. * Allows to change the default <h1> - <h3> tags used by Enfold
  3. *
  4. * @param array $args
  5. * @param string $context where the filter is called from
  6. * @param array $extra_args contains extra info depending on $context
  7. * @return array
  8. */
  9. function my_avf_customize_heading_settings( array $args, $context, array $extra_args = array() )
  10. {
  11. /**
  12. * This is an example of the usage for "avia_sc_timeline"
  13. */
  14. if( $context == 'avia_sc_timeline' )
  15. {
  16. $args['heading'] = 'h1'; // change heading from h3 to h1
  17. $args['extra_class'] = 'my-timeline-class'; // add an extra class for styling
  18. }
  19.  
  20. /**
  21. * This is an example of the usage for "avia_content_slider" and slider title
  22. */
  23. if( 'avia_content_slider' == $context && is_array( $extra_args ) && in_array( 'slider_title', $extra_args ) )
  24. {
  25. $args['heading'] = 'h2'; // change heading from h3 to h2
  26. $args['extra_class'] = 'my-extra-class'; // add an extra class for styling
  27. }
  28.  
  29. /**
  30. * This is an example of the usage for "avia_content_slider" and slider title for the entries
  31. */
  32. if( 'avia_content_slider' == $context && is_array( $extra_args ) && in_array( 'slider_entry', $extra_args ) )
  33. {
  34. $args['heading'] = 'h6'; // change heading from h3 to h6
  35. $args['extra_class'] = 'my-extra-class'; // add an extra class for styling
  36. }
  37.  
  38. /**
  39. * This is an example of the usage for "avia_sc_icon_box"
  40. */
  41. if( $context == 'avia_sc_icon_box' )
  42. {
  43. $args['heading'] = 'h1'; // change heading from h3 to h1
  44. $args['extra_class'] = 'my-icon-box-class'; // add an extra class for styling
  45. }
  46.  
  47. return $args;
  48. }
  49.  
  50. add_filter( 'avf_customize_heading_settings', 'my_avf_customize_heading_settings', 10, 3 );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement