mirror of
https://github.com/10h30/yeuchaybo.git
synced 2026-07-17 13:43:45 +09:00
Initial
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
/**
|
||||
* Child Theme Library
|
||||
*
|
||||
* WARNING: This file is a part of the core Child Theme Library.
|
||||
* DO NOT edit this file under any circumstances. Please use
|
||||
* the functions.php file to make any theme modifications.
|
||||
*
|
||||
* @package SEOThemes\ChildThemeLibrary\Functions
|
||||
* @link https://github.com/seothemes/child-theme-library
|
||||
* @author Thuan Bui
|
||||
* @copyright Copyright © 2018 Thuan Bui
|
||||
* @license GPL-2.0+
|
||||
*/
|
||||
|
||||
add_filter( 'genesis_theme_settings_defaults', 'child_theme_set_default_settings' );
|
||||
/**
|
||||
* Update Theme Settings upon reset.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @param array $defaults Default theme settings.
|
||||
*
|
||||
* @return array Custom theme settings.
|
||||
*/
|
||||
function child_theme_set_default_settings( array $defaults ) {
|
||||
|
||||
$config = child_theme_get_config( 'genesis-settings' );
|
||||
|
||||
$defaults = wp_parse_args( $config, $defaults );
|
||||
|
||||
return $defaults;
|
||||
|
||||
}
|
||||
|
||||
add_action( 'after_switch_theme', 'child_theme_update_settings' );
|
||||
/**
|
||||
* Update Theme Settings upon activation.
|
||||
*
|
||||
* @since 1.0.0
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
function child_theme_update_settings() {
|
||||
|
||||
$config = child_theme_get_config();
|
||||
|
||||
if ( function_exists( 'genesis_update_settings' ) ) {
|
||||
|
||||
genesis_update_settings( $config['genesis-settings'] );
|
||||
|
||||
}
|
||||
|
||||
update_option( 'posts_per_page', $config['blog_cat_num'] );
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user