Advertisement
Guest User

Untitled

a guest
Jan 20th, 2023
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <?php
  2. /**
  3. * Register/enqueue custom scripts and styles
  4. */
  5. add_action( 'wp_enqueue_scripts', function() {
  6. // Enqueue your files on the canvas & frontend, not the builder panel. Otherwise custom CSS might affect builder)
  7. if ( ! bricks_is_builder_main() ) {
  8. wp_enqueue_style( 'bricks-child', get_stylesheet_uri(), ['bricks-frontend'], filemtime( get_stylesheet_directory() . '/style.css' ) );
  9. }
  10. } );
  11.  
  12.  
  13. /**
  14. * Register custom elements
  15. */
  16. add_action( 'init', function() {
  17. $element_files = [
  18. __DIR__ . '/elements/title.php',
  19. ];
  20.  
  21. foreach ( $element_files as $file ) {
  22. \Bricks\Elements::register_element( $file );
  23. }
  24. }, 11 );
  25.  
  26. /**
  27. * Add text strings to builder
  28. */
  29. add_filter( 'bricks/builder/i18n', function( $i18n ) {
  30. // For element category 'custom'
  31. $i18n['custom'] = esc_html__( 'Custom', 'bricks' );
  32.  
  33. return $i18n;
  34. } );
  35.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement