Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter kirki_control_types bug, new control can't render Underscore template #1887

Closed
pkvillanueva opened this issue May 11, 2018 · 2 comments

Comments

@pkvillanueva
Copy link

pkvillanueva commented May 11, 2018

Issue description:

I couldn't find my defined JS template in the HTML document. According to this post that in order to render the JS template it has to be registered via $wp_customize->register_control_type( $control_type ); and I found out that there's an issue with Kirki_Init class.

The kirki_control_types hook didn't apply the filter I made and after applying this change (http://take.ms/iEZZT), the JS template is successfully rendered.

Version used:

3.0.25

Using theme_mods or options?

theme_mods

Code to reproduce the issue (config + field(s))

add_action( 'customize_register', function( $wp_customize ) {
	/**
	 * The custom control class
	 */
	class Kirki_Controls_Notice_Control extends Kirki_Control_Base {
		public $type = 'notice';

		public function render_content() {
			?>
			THE CONTROL CONTENT HERE
			<?php
		}

		public function content_template() {
			?>
			FIND ME SOMEWHERE
			<?php
		}
	}

	// Register our custom control with Kirki
	add_filter( 'kirki_control_types', function( $controls ) {
		$controls['notice'] = 'Kirki_Controls_Notice_Control';
		return $controls;
	} );
} );
@pkvillanueva pkvillanueva changed the title Filter kirki_control_types bug, can't render Underscore template Filter kirki_control_types bug, new control can't render Underscore template May 11, 2018
@themeum themeum deleted a comment from niklasp Nov 21, 2018
@aristath
Copy link
Contributor

@pkvillanueva I'm sorry for the delay here, I missed this ticket.
Do you still require assistance on this one?

@pkvillanueva
Copy link
Author

@aristath No, I have solved my issue. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants