Skip to content

Commit

Permalink
Add theme setup hook
Browse files Browse the repository at this point in the history
Copied from 2020 theme
  • Loading branch information
adamwoodnz committed May 9, 2024
1 parent dc00626 commit 3958c22
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions wp-content/themes/pub/wporg-learn-2024/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,26 @@ function get_views_path() {
/**
* Actions and filters.
*/
add_action( 'after_setup_theme', __NAMESPACE__ . '\setup' );
add_action( 'wp_enqueue_scripts', __NAMESPACE__ . '\enqueue_assets' );
add_filter( 'wporg_block_navigation_menus', __NAMESPACE__ . '\add_site_navigation_menus' );

/**
* Sets up theme defaults and registers support for various WordPress features.
*
* Note that this function is hooked into the after_setup_theme hook, which
* runs before the init hook. The init hook is too late for some features, such
* as indicating support for post thumbnails.
*/
function setup() {
add_theme_support( 'post-thumbnails' );
add_theme_support( 'sensei' );
add_theme_support( 'responsive-embeds' );

add_filter( 'mkaz_code_syntax_force_loading', '__return_true' );
add_filter( 'mkaz_prism_css_path', '__return_empty_string' ); // Disable default styles to avoid conflicts.
}

/**
* Enqueue scripts and styles.
*/
Expand Down

0 comments on commit 3958c22

Please sign in to comment.