Created
          March 31, 2016 07:16 
        
      - 
      
- 
        Save al5dy/7f5da11344c9652aeb042e05988d7d51 to your computer and use it in GitHub Desktop. 
    Кнопка "Добавить все" на определенном CPT в ACF Relationship
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | function acf_add_button( $field ) { | |
| $screen = get_current_screen(); | |
| if( $screen->post_type === 'product' ) { | |
| echo '<div class="acf-relationship-header"><a href="#" id="acf-add-all" class="button" title="">Добавить все</a></div>'; | |
| } | |
| } | |
| add_action('acf/render_field/type=relationship', 'acf_add_button', 10, 1); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment