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

Snipet add 4 featured page :) #7

Closed
ferromariano opened this issue Nov 28, 2013 · 1 comment
Closed

Snipet add 4 featured page :) #7

ferromariano opened this issue Nov 28, 2013 · 1 comment

Comments

@ferromariano
Copy link

add_action ( 'customize_register'       , 'xxx_tc_customize_register' ,20,1 );
add_filter ( '__customize_map'          , 'xxx_tc_customizer_map');


add_action ('init' , 'xxx_tc_customizer_map_init');
function xxx_tc_customizer_map_init() {

  remove_action( 'customize_register', array( TC_featured_pages::$instance , 'tc_customize_register'), 20, 1 );
  add_action ( 'customize_register'       , 'xxx_tc_customize_register' ,20,1 );


  add_action  ( '__before_main_container'     , 'xxx_tc_fp_block_display', 10 );


  remove_filter ( '__customize_map'          , array( TC_customize::$instance , 'tc_customizer_map' ));
  add_filter ( '__customize_map'          , 'xxx_tc_customizer_map');

  remove_action( '__before_main_container', array( TC_featured_pages::$instance , 'tc_fp_block_display'), 10 );
  add_action  ( '__before_main_container'     , 'xxx_tc_fp_block_display', 10 );



}

  function xxx_tc_customize_register( $wp_customize) {

    return TC_customize::$instance -> tc_customize_factory ( $wp_customize ,
                                                                  $args = TC_customize::$instance -> tc_customize_arguments(), 
                                                                  $setup = tc__f('__customize_map', $get_default = 'true' ) );
  }


function xxx_tc_customizer_map($r) {
  $r = TC_customize::$instance->tc_customizer_map();


  $r['add_setting_control']['tc_theme_options[tc_featured_page_four]'] = array(
                    'label'       => __( 'Home featured page four' , 'customizr' ),
                    'section'     => 'tc_frontpage_settings' ,
                    'type'        => 'dropdown-pages' ,
                    'priority'      => 90,
  );

  $r['add_setting_control']['tc_theme_options[tc_featured_text_four]'] = array(
                    'sanitize_callback' => array( TC_customize::$instance , 'tc_sanitize_textarea' ),
                    'transport'   => 'postMessage',
                    'control'   => 'TC_controls' ,
                    'label'       => __( 'Featured text one (200 car. max)' , 'customizr' ),
                    'section'     => 'tc_frontpage_settings' ,
                    'type'        => 'textarea' ,
                    'notice'    => __( 'You need to select a page first. Leave this field empty if you want to use the page excerpt.' , 'customizr' ),
                    'priority'      => 100,
  );
  return $r;
}
@ghost
Copy link

ghost commented Dec 12, 2014

Thanks for this contribution @ferromariano . Sorry for the 12 months delay to answer... :)

This issue was closed.
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

1 participant