mirror of
https://github.com/10h30/yeuchaybo.git
synced 2026-06-05 15:10:03 +09:00
56 lines
1.1 KiB
PHP
56 lines
1.1 KiB
PHP
|
|
<?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\Widgets
|
||
|
|
* @link https://github.com/seothemes/child-theme-library
|
||
|
|
* @author Thuan Bui
|
||
|
|
* @copyright Copyright © 2018 Thuan Bui
|
||
|
|
* @license GPL-2.0+
|
||
|
|
*/
|
||
|
|
|
||
|
|
// If this file is called directly, abort.
|
||
|
|
if ( ! defined( 'ABSPATH' ) ) {
|
||
|
|
|
||
|
|
die;
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
add_action( 'widgets_init', 'child_theme_unregister_widgets' );
|
||
|
|
/**
|
||
|
|
* Unregister widgets defined in the config.
|
||
|
|
*
|
||
|
|
* @since 1.0.0
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
function child_theme_unregister_widgets() {
|
||
|
|
|
||
|
|
$config = child_theme_get_config( 'widgets' );
|
||
|
|
|
||
|
|
foreach ( $config as $widget ) {
|
||
|
|
|
||
|
|
unregister_widget( $widget );
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
|
||
|
|
add_action( 'after_setup_theme', 'child_theme_widget_shortcodes' );
|
||
|
|
/**
|
||
|
|
* Enables shortcodes in text widgets.
|
||
|
|
*
|
||
|
|
* @since 1.0.0
|
||
|
|
*
|
||
|
|
* @return void
|
||
|
|
*/
|
||
|
|
function child_theme_widget_shortcodes() {
|
||
|
|
|
||
|
|
add_filter( 'widget_text', 'do_shortcode' );
|
||
|
|
|
||
|
|
}
|