Iโm Ari Stathopoulos, a developer from Greece.
Read my bio on my personal site, where you can also reach me.
Currently working on various projects for Emilia Capital, and contributing to WordPress Core as a sponsored contributor.
This repository is no longer used. Please see https://github.com/aristath/kirki/tree/develop/docs/files
License: MIT License
Iโm Ari Stathopoulos, a developer from Greece.
Read my bio on my personal site, where you can also reach me.
Currently working on various projects for Emilia Capital, and contributing to WordPress Core as a sponsored contributor.
I'm trying to include Kirki in a plugin. This plugin adds Customizer settings to any theme when the plugin is active. I modified the instructions and included the helper file like this:
require_once plugin_dir_path( __FILE__ ) . 'customizer/include-kirki.php';
When I launch the customizer, I get a fatal error:
[26-Feb-2017 01:09:27 UTC] PHP Fatal error: Class 'Kirki_Installer_Section' not found in /app/public/wp-content/plugins/blank-slate/customizer/include-kirki.php on line 77
[26-Feb-2017 01:09:27 UTC] PHP Stack trace:
[26-Feb-2017 01:09:27 UTC] PHP 1. {main}() /app/public/wp-admin/customize.php:0
[26-Feb-2017 01:09:27 UTC] PHP 2. require_once() /app/public/wp-admin/customize.php:13
[26-Feb-2017 01:09:27 UTC] PHP 3. require_once() /app/public/wp-admin/admin.php:31
[26-Feb-2017 01:09:27 UTC] PHP 4. require_once() /app/public/wp-load.php:37
[26-Feb-2017 01:09:27 UTC] PHP 5. require_once() /app/public/wp-config.php:81
[26-Feb-2017 01:09:27 UTC] PHP 6. do_action() /app/public/wp-settings.php:470
[26-Feb-2017 01:09:27 UTC] PHP 7. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453
[26-Feb-2017 01:09:27 UTC] PHP 8. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:323
[26-Feb-2017 01:09:27 UTC] PHP 9. call_user_func_array:{/app/public/wp-includes/class-wp-hook.php:298}() /app/public/wp-includes/class-wp-hook.php:298
[26-Feb-2017 01:09:27 UTC] PHP 10. WP_Customize_Manager->wp_loaded() /app/public/wp-includes/class-wp-hook.php:298
[26-Feb-2017 01:09:27 UTC] PHP 11. do_action() /app/public/wp-includes/class-wp-customize-manager.php:734
[26-Feb-2017 01:09:27 UTC] PHP 12. WP_Hook->do_action() /app/public/wp-includes/plugin.php:453
[26-Feb-2017 01:09:27 UTC] PHP 13. WP_Hook->apply_filters() /app/public/wp-includes/class-wp-hook.php:323
[26-Feb-2017 01:09:27 UTC] PHP 14. call_user_func_array:{/app/public/wp-includes/class-wp-hook.php:298}() /app/public/wp-includes/class-wp-hook.php:298
[26-Feb-2017 01:09:27 UTC] PHP 15. kirki_installer_register() /app/public/wp-includes/class-wp-hook.php:298
include-kirki.php
is unmodified. Is there a reason this is not working in a plugin, rather than a theme as originally intended please?
Hello @aristath
Just a note, the new class didn't work for me at the beggining.
I had to put require_once get_template_directory() . '/inc/class-my-theme-kirki.php';
before require get_template_directory() . '/inc/customizer.php';
in the functions.php file
to make the new class works without an error saying that the My_Theme_Kirki was not found.
Have a nice day and thanks a lot for all your efforts.
ThemeCheck is not happy with the following issues in KirKI Helpers. I know its just an "INFO" and not warning so nothing to take that seriously, but iframe is something every wp developer prefers to stay away from. Can you suggest some quick fix to resolve this issue?
INFO: iframe was found in the file include-kirki.php iframes are sometimes used to load unwanted adverts and code on your site.
Line 7: * A simple control that will render the installer <iframe>.
Line 9: * as well as style the section & the iframe.
Line 20: iframe#kirki-customizer-installer { margin-left: -15px; height: 158px; }
Line 34: jQuery('iframe#kirki-customizer-installer').load( function() {
Line 35: jQuery('iframe#kirki-customizer-installer').contents().find('head').append( install
Hello,
It seems that when using active_callback along with transport "postMessage", nothing seems to happen.
Is this on purpose?
I am using this exact demo configuration along with 'transport' => 'postMessage',
https://aristath.github.io/kirki/docs/arguments/active_callback.html
i am working with Kirki for around a month all working as charm except one thing.. e.g.
i have added a field and a section
Kirki::add_section( 'about_us_section', array(
'title' => __( 'About Us Section' ),
'description' => __( 'Add About Us Content Here' ),
'panel' => 'theme_options',
'priority' => 160,
'capability' => 'edit_theme_options',
) );
Kirki::add_field( 'theme_config', array(
'type' => 'text',
'settings' => 'about_us_video_setting',
'label' => __( 'Video Link', 'rst' ),
'section' => 'about_us_section',
'default' => esc_attr__( 'youtube.com', 'rst' ),
) );
but what i need is this
i have seen selective refresh but not able to achieve the desired result however if i do it in the wordpress way without using the plugin and add that selective refresh all works like charm..
is something there which i am not able to find on the documentation?
Hello Aristeides,
Thanks for your work on Kirki, I've been using it for the last couple of weeks on a new theme and it's helped a lot with the customizer.
I was testing and just updated my WP to version 4.6 and noticed that the customizer install now button for Kirki generated in the iframe window appears to be blocked now with WP version 4.6, it works with 4.5 just fine.
I was actually going to switch to the tgmpa route but instead tinkered a bit and basically just cloned that button to the parent window...I'm sure there's a better solution but at least it works again. Starting at line 36 in include-kirki.php I added...
// Clone button to parent window
var iBody = jQuery('iframe#kirki-customizer-installer').contents().find('body');
var kButton = iBody.find('#plugin_install_from_iframe').clone();
iBody.find('#plugin_install_from_iframe').hide();
parent.jQuery('#customize-control-kirki_installer').append(kButton);
Maybe you are already aware of this but I thought I'd share.
Hey Aristath!
Is there a way to make this work on a multisite installation?
Using a custom setting in the customizer (which is recommended by Kirki) is no longer working, after upgrading Wordpress to v4.7.
This is the method that requires you to add a few lines of code in your theme that will create a custom section and a custom control.
Kindly check it and advise on a lasting solution.
Theme check issue (include-kirki.php):
REQUIRED: Found a Customizer setting that did not have a sanitization callback function. Every call to the add_setting() method needs to have a sanitization callback function passed.
Hi,
just updated to WP 4.7 in found out that recommended helper method using class Kirki_Installer_Control doesn't work with WP 4.7.
Any ideas ? Did something change with WP_Customize_Control in this update ?
So I really can't get this to work anymore. I'm running WP v4.7 and the section just won't appear. I've tried adding a section manually with a setting, section and control and that works. It's as if it won't print because render()
isn't triggered? I get no bugs with WP_DEBUG either, I just don't get it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.