A
A
astaxov812020-08-14 01:22:30
WordPress
astaxov81, 2020-08-14 01:22:30

WP Customizer API doesn't work with live editing. How to fix?

Hello.
I created a new topic, added a field in it to fill in the Customize API:

add_action( 'customize_register', static function ( WP_Customize_Manager $wp_customize ) {
  if ( $panel_main_page = 'panel_main_page' ) {
    $wp_customize->add_panel(
      'panel_main_page',
      array(
        'title'    => 'Контента на главной странице',
        'priority' => 999,
      )
    );
    if ( $name_section = 'header_h1' ) {
      $wp_customize->add_section(
        $name_section,
        array(
          'panel'    => $panel_main_page,
          'title'    => 'Заголовок (h1) страницы',
          'priority' => 0,
        )
      );
      $wp_customize->add_setting(
        'header_h1',
        array(
          'transport' => WPTEST_GET_THE_MOD_DEFAULT
        )
      );
      $wp_customize->add_control(
        'header_h1',
        array(
          'section' => $name_section,
          'label'   => 'Текст заголовка',
          'type'    => 'text'
        )
      );
    }
  }
} );


Real-time editing mode does not work. The field itself works, that is, I fill it out -> click publish -> F5 and I see the changes.

But not so long ago I worked with a theme where fields were added in a similar way, but the changes were visible in "real time".

Do not tell me how to fix this moment?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Anton Litvinenko, 2020-08-14
@astaxov81

what does this line do for you?
'transport' => WPTEST_GET_THE_MOD_DEFAULT
By default, it should be set to refresh, which should refresh the page on changes. And in order to make changes right away, you need to write js for this

V
vreitech, 2015-04-08
@fzfx

I haven't seen this kind of behavior. what are "LAN clients" and why should it be visible in them if it is disabled?

S
solalex, 2015-04-09
@solalex

The computer wakes up not by IP, but by poppy.
try to wake up on etherwake, if it is not in your firmware, put openwrt on the router
mac-address of course substitute your

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question