GithubHelp home page GithubHelp logo

aristath / kirki-helpers Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 16.0 18 KB

This repository is no longer used. Please see https://github.com/aristath/kirki/tree/develop/docs/files

License: MIT License

PHP 100.00%

kirki-helpers's Introduction

Hi there ๐Ÿ‘‹

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.

kirki-helpers's People

Contributors

aristath avatar daviedr avatar josephgabito avatar rinkuyadav999 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kirki-helpers's Issues

Error with include-kirki.php in a plugin

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?

class-my-theme-kirki.php

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 Issues

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?

ThemeCheck Output

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

Line 38: <iframe id='kirki-customizer-installer' src='<?php echo admin_url( 'plugin-i

Why there is no pencil icon visible near the element?

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' ), 
    
) );

no-edit-icon

but what i need is this

with-edit-icon

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?

wp 4.6 and include-kirki.php

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.

Tooltip And some error

Your design is very very awesome, But I face some following problem. ( I just include kirki in ny theme )
1.whenever use type as "text,dropdownpages" ,tooltip is not working properly. kindly let us know your response.
2. Theme unit test bug are in following image:
kirki-error

Regards,
Suganya

Using a custom setting in the customizer no longer working

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.

Missing sanitization callback function

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.

include-kirki.php

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.