• Hello @westonruter! The plugin is very useful indeed, but reading the code I observed the lack of hooks, I think the hooks will solve the most part of problems of integrations with another plugins like ACF and Kirki (Customizer). Let other developers help you, when you use hooks (actions and filters) you are giving the prompt they need to extend your plugin to a new level and the most part of problems will disappear.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    I’m not sure what hooks you are referring to as being needed. The Customizer’s own hooks are what you should be using to extend Customize Posts with new functionality.

    Thread Starter lucasviewup

    (@lucasviewup)

    First of all I have some points to discuss:

    1) Why the plugin uses the Customizer Javascript API over the PHP API for creating sections, panels and controls?

    The JS API is not so extensible and very documented as the PHP is. I’m not saying that the JS API is bad, but in most cases, is used only in live preview.

    2) Why the plugin can’t have custom hooks? I mean customize_posts hooks. Why not?

    For example, if I want to add a custom field in ‘page’ section, I would do something like this:

    add_action('customize_posts_add_field', function($section, $wp_customize){
      $wp_customize->add_setting( 'header_textcolor' , array(
        'default'   => '#000000',
        'transport' => 'refresh',
      ) );
    
      $wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 
        'link_color', array(
    	'label'      => __( 'Header Color', 'mytheme' ),
    	'section'    => $section->id,
    	'settings'   => 'your_setting_id',
       ) ) );
    
      ...
    
    });

    This is way is so much clearer than the gist you paste here:
    https://gist.github.com/westonruter/f8473159e48fbacbef9dcd6498155846

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘The plugin need hooks!!!!’ is closed to new replies.