This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'theme_json_theme', 'get_parent_theme_style_variation_data' ); | |
/** | |
* Merges parent theme style variation data with active theme.json. | |
* | |
* @since 1.0.0 | |
* | |
* @param mixed $theme_json WP_Theme_JSON_Data | WP_Theme_JSON_Data_Gutenberg. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\add_filter( 'render_block_core/heading', __NAMESPACE__ . '\\randomize_h1_heading_block_on_front_page', 10, 2 ); | |
/** | |
* Randomizes content of H1 heading blocks on the front page. | |
* | |
* @since 1.0.0 | |
* | |
* @param string $content Block HTML content. | |
* @param array $block Block data. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$array = [ | |
0 => 'X', | |
1 => 'Y', | |
2 => 'Z', | |
3 => 'X', | |
4 => 'Y', | |
5 => 'Z', | |
6 => 'X', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php // Do not include opening PHP tag. | |
// Place in child theme functions.php or custom plugin. | |
add_filter( 'blockify', function ( array $defaults ): array { | |
unset( $defaults['darkMode'] ); | |
return $defaults; | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- wp:template-part {"slug":"header","tagName":"header"} /--> | |
<!-- wp:post-content {"layout":{"inherit":true}} /--> | |
<!-- wp:template-part {"slug":"footer","tagName":"footer"} /--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Remove hero section backgrounds. | |
add_action( 'after_setup_theme', function () { | |
remove_theme_support( 'custom-header' ); | |
add_theme_support( 'custom-header', [ | |
'header-selector' => false, | |
'default-image' => CHILD_THEME_URI . '/assets/images/hero.jpg', | |
'width' => 1280, | |
'height' => 720, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'after_switch_theme', 'startup_install_plugins' ); | |
/** | |
* Install plugin dependencies. | |
* | |
* @since 1.2.0 | |
* | |
* @return void | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\spl_autoload_register( function ( $class ) { | |
if ( strpos( $class, __NAMESPACE__ ) !== false ) { | |
require_once __DIR__ . '/src' . str_replace( '\\', DIRECTORY_SEPARATOR, substr( $class, strlen( __NAMESPACE__ ) ) ) . '.php'; | |
} | |
} ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_shortcode( 'current_user', __NAMESPACE__ . '\current_user_shortcode' ); | |
/** | |
* Description of expected behavior. | |
* | |
* @since 1.0.0 | |
* | |
* @param $atts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'install_plugins_tabs', __NAMESPACE__ . '\genesis_plugins_tab' ); | |
/** | |
* Add Genesis to plugin tabs. | |
* | |
* @since 1.0.0 | |
* | |
* @param array $tabs Default plugin tabs. |