• I have this problem for last 7-10 days can’t solve it. I also asked in WPSE but no answer! I thought I also ask it here in case any theme customizer expert notices.

    Basically I need to hide a part of the theme customizer section depending on select element. I am running piece of js code which hides/shows them when the page loads. But theme customizer revises the inline css when it finishes loading.

    So, my js code is running too early. I need to run it after theme customizer initialize. I tried to look at the theme customizer source code but couldn’t find anything that can help me solve this problem.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi, i opened ticket by this issue and waiting the reply
    https://core.trac.www.ads-software.com/ticket/33518
    and i tried with hidden css class method from js but should make display none !important, it’s strange because was working fine before wp 4.3 but now the item has class [ .customize-control ] all time get [ style=”display: list-item;” ]
    which also noticed that in the Static Front Page section, the Front page and Posts page controls are no longer hidden when I choose to show the latest posts

    Thread Starter prionkor

    (@prionkor)

    As I said in this thread also on the WPSE there is a customizer method that runs and resets all visibility according to the visibility that set in PHP. checkthe WPSE Question and my answer there.

    Thread Starter prionkor

    (@prionkor)

    I tried to track down javascript events. I have found them but they are internal and do not bubble up. Didn’t find any way of using them with JS.

    Hopefully some core dev can shed light on this. Documentation for JS customizer api is very limited ??

    hi, i found the solution using JS which before i was hide groups/fields in this plugin :
    https://www.ads-software.com/plugins/arabic-webfonts/
    inside this file
    https://plugins.svn.www.ads-software.com/arabic-webfonts/tags/1.4.1/assets/js/customizer-controls.js
    you will found

    $(‘[id$=awf_headings_styles] .customize-control’).hide();
    $(‘[id$=awf_headings_styles] *[id*=fields_group].customize-control’).show();

    which this code doesn’t working but i just using click event before go to this section, so now i know when this section opened and working on fields inside it like that :

    $(‘[id$=awf_headings_styles] .accordion-section-title’).click(function() {
    $(‘[id$=awf_headings_styles] .customize-control’).hide();
    $(‘[id$=awf_headings_styles] *[id*=fields_group].customize-control’).show();
    });

    after this code update everything working fine with me.

    Thread Starter prionkor

    (@prionkor)

    It still doesn’t work if you want to hide something initially (before user clicks anything)

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Does any event runs after the theme customizer finishes loading?’ is closed to new replies.