Przeglądaj źródła

renamed a couple of functions from 'newtheme' to 'geologist' (#4840)

* renamed a couple of functions from 'newtheme' to 'geologist'

* Update the build script to use the theme slug in the function names

Co-authored-by: Ben Dwyer <ben@scruffian.com>
Jason Crist 3 lat temu
rodzic
commit
5a04d5706a
2 zmienionych plików z 10 dodań i 10 usunięć
  1. 5 5
      blockbase/create-child.js
  2. 5 5
      geologist/functions.php

+ 5 - 5
blockbase/create-child.js

@@ -58,7 +58,7 @@ const functions_php = `<?php
 /**
  * Add Editor Styles
  */
-function newtheme_editor_styles() {
+function {newtheme}_editor_styles() {
 	// Enqueue editor styles.
 	add_editor_style(
 		array(
@@ -66,16 +66,16 @@ function newtheme_editor_styles() {
 		)
 	);
 }
-add_action( 'after_setup_theme', 'newtheme_editor_styles' );
+add_action( 'after_setup_theme', '{newtheme}_editor_styles' );
 
 /**
  *
  * Enqueue scripts and styles.
  */
-function newtheme_scripts() {
-	wp_enqueue_style( 'newtheme-styles', get_stylesheet_directory_uri() . '/assets/theme.css', array('blockbase-ponyfill'), wp_get_theme()->get( 'Version' ) );
+function {newtheme}_scripts() {
+	wp_enqueue_style( '{newtheme}-styles', get_stylesheet_directory_uri() . '/assets/theme.css', array( 'blockbase-ponyfill' ), wp_get_theme()->get( 'Version' ) );
 }
-add_action( 'wp_enqueue_scripts', 'newtheme_scripts' );
+add_action( 'wp_enqueue_scripts', '{newtheme}_scripts' );
 
 `;
 

+ 5 - 5
geologist/functions.php

@@ -3,7 +3,7 @@
 /**
  * Add Editor Styles
  */
-function newtheme_editor_styles() {
+function geologist_editor_styles() {
 	// Enqueue editor styles.
 	add_editor_style(
 		array(
@@ -11,16 +11,16 @@ function newtheme_editor_styles() {
 		)
 	);
 }
-add_action( 'after_setup_theme', 'newtheme_editor_styles' );
+add_action( 'after_setup_theme', 'geologist_editor_styles' );
 
 /**
  *
  * Enqueue scripts and styles.
  */
-function newtheme_scripts() {
-	wp_enqueue_style( 'newtheme-styles', get_stylesheet_directory_uri() . '/assets/theme.css', array('blockbase-ponyfill'), wp_get_theme()->get( 'Version' ) );
+function geologist_scripts() {
+	wp_enqueue_style( 'geologist-styles', get_stylesheet_directory_uri() . '/assets/theme.css', array('blockbase-ponyfill'), wp_get_theme()->get( 'Version' ) );
 }
-add_action( 'wp_enqueue_scripts', 'newtheme_scripts' );
+add_action( 'wp_enqueue_scripts', 'geologist_scripts' );
 
 /**
  * Block Patterns.