I tried to add controls via javascript but it did not show any content. I tried custom control & core control. My code is almost the same as the code in WordPress core.

Here is my code which is put to the console.

testA = wp.customize.control( 'test' );
testA = new wp.customize.controlConstructor.color( 'test', {
  params: {
    label: 'test color',
    section: 'setting_introduction',
    priority: 1,
    active: true,
    type: 'color',
    settings: {
      default: 'test'
} );
wp.customize.control.add( 'test', testA );

Where am I doing the mistake ? Please help me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.