Acf_Plugin_Sites

The Advanced Custom Fields: Sites Acf Plugin Sites class.

Defined (1)

The class is defined in the following location(s).

/acf-sites.php  
  1. class Acf_Plugin_Sites { 
  2.  
  3. /** 
  4. * __construct 
  5. * This function will setup the class functionality 
  6. * @type function 
  7. * @date 17/02/2016 
  8. * @since 1.0.0 
  9. * @param n/a 
  10. * @return n/a 
  11. */ 
  12.  
  13. function __construct() { 
  14.  
  15. // vars 
  16. $this->settings = array( 
  17. 'version' => '2.0.0',  
  18. 'url' => plugin_dir_url( __FILE__ ),  
  19. 'path' => plugin_dir_path( __FILE__ ),  
  20. ); 
  21.  
  22. // set text domain 
  23. // https://codex.wordpress.org/Function_Reference/load_plugin_textdomain 
  24. load_plugin_textdomain( 'acf-sites', false, plugin_basename( dirname( __FILE__ ) ) . '/lang' ); 
  25.  
  26. // include field 
  27. add_action( 'acf/include_field_types', array( $this, 'include_field_types' ) ); // v5 
  28. add_action( 'acf/register_fields', array( $this, 'include_field_types' ) ); // v4 
  29.  
  30.  
  31.  
  32. /** 
  33. * include_field_types 
  34. * This function will include the field type class 
  35. * @type function 
  36. * @date 17/02/2016 
  37. * @since 1.0.0 
  38. * @param $version (int) major ACF version. Defaults to false 
  39. * @return n/a 
  40. */ 
  41. function include_field_types( $version = false ) { 
  42.  
  43. // support empty $version 
  44. if ( ! $version ) { 
  45. $version = 4; 
  46.  
  47. // include 
  48. include_once( 'fields/acf-sites-v' . $version . '.php' ); 
  49.  
  50.