Skip to content

Instantly share code, notes, and snippets.

@al5dy
Created March 31, 2016 07:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save al5dy/7f5da11344c9652aeb042e05988d7d51 to your computer and use it in GitHub Desktop.
Save al5dy/7f5da11344c9652aeb042e05988d7d51 to your computer and use it in GitHub Desktop.
Кнопка "Добавить все" на определенном CPT в ACF Relationship
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