-
Notifications
You must be signed in to change notification settings - Fork 10
/
acf-focal_point.php
44 lines (29 loc) · 1.12 KB
/
acf-focal_point.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
/*
Plugin Name: ACF: Focal Point
Plugin URI: https://github.com/evu/acf-focal_point
Description: Adds a new field type to Advanced Custom Fields allowing users to draw focal points on images. Utilises Responsify.js
Version: 1.0.2
Author: John Healey
Author URI: http://twitter.com/lostinnovation
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*/
// Include field type for ACF5
// $version = 5 and can be ignored until ACF6 exists
function include_field_types_focal_point( $version ) {
include_once('acf-focal_point-v5.php');
}
add_action('acf/include_field_types', 'include_field_types_focal_point');
// Include field type for ACF4
function register_fields_focal_point() {
include_once('acf-focal_point-v4.php');
}
add_action('acf/register_fields', 'register_fields_focal_point');
// Add Responsify.js and init
function focal_point_enque_scripts() {
wp_register_script( 'focal-point', plugins_url( '/js/focal-point.min.js', __FILE__ ), array('jquery'), '1.0', true );
wp_enqueue_script( 'focal-point' );
}
add_action( 'wp_enqueue_scripts', 'focal_point_enque_scripts' );
?>