Advertisement
DidouS

Add custom fieldtype to supported ACF fields

Mar 27th, 2020
273
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.62 KB | None | 0 0
  1.  
  2.  
  3. add_action( 'init' , 'add_custom_supported_fieldtype' );
  4.  
  5. /**
  6.  * Add a new fieldtype-name to the supported field_types
  7.  */
  8. function add_custom_supported_fieldtype() {
  9.  
  10.     // bail early if plugin has been deactivated or isn't installed
  11.     if ( !class_exists( 'easy_acf_connect' ) ) return;
  12.  
  13.     easy_acf_connect::$supported_acf_field_types = array_merge(
  14.                                                                 easy_acf_connect::$supported_acf_field_types,
  15.                                                                 array( 'image_aspect_ratio_crop' )
  16.                                                     );
  17.  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement