77 * Author URI: http://40q.com.ar
88 * Text Domain: acf-gutenberg
99 * Domain Path: /resources/languages
10- * Version: 0. 1.0
10+ * Version: 1.0.4
1111 *
1212 * @package ACF_Gutenberg
1313 */
1717// Exit if accessed directly.
1818defined ('ABSPATH ' ) || exit;
1919
20-
2120$ plugin = (object ) [
2221 'name ' => 'ACF Gutenberg ' ,
23- 'version ' => '0. 1.0 ' ,
22+ 'version ' => '1.0.4 ' ,
2423
2524 'requiredPHP ' => '7.1 ' ,
2625 'requiredWP ' => '4.7.0 ' ,
2726
28- 'composer ' => __DIR__ . '/vendor/autoload.php ' ,
27+ 'composer ' => __DIR__ . '/vendor/autoload.php ' ,
2928];
3029
30+ define ('ACFGB_PATH ' , dirname (__FILE__ ));
31+ define ('ACFGB_FOLDER ' , basename (ACFGB_PATH ));
32+ define ('ACFGB_URL ' , plugin_dir_url (__FILE__ ));
3133
32- define ( 'ACFGB_PATH ' , dirname ( __FILE__ ) );
33- define ( 'ACFGB_FOLDER ' , basename ( ACFGB_PATH ) );
34- define ( 'ACFGB_URL ' , plugin_dir_url ( __FILE__ ) );
35-
36-
37- define ( 'ACFGB_PATH_RESOURCES ' , dirname ( __FILE__ ) . '/resources ' );
38- define ( 'ACFGB_URL_RESOURCES ' , ACFGB_URL . '/resources ' );
39- define ( 'ACFGB_PATH_SRC ' , dirname ( __FILE__ ) . '/src ' );
40- define ( 'ACFGB_URL_SRC ' , ACFGB_URL . '/src ' );
41- define ( 'ACFGB_PATH_BIN ' , dirname ( __FILE__ ) . '/bin ' );
42- define ( 'ACFGB_URL_BIN ' , ACFGB_URL . '/bin ' );
43-
34+ define ('ACFGB_PATH_RESOURCES ' , dirname (__FILE__ ) . '/resources ' );
35+ define ('ACFGB_URL_RESOURCES ' , ACFGB_URL . '/resources ' );
36+ define ('ACFGB_PATH_SRC ' , dirname (__FILE__ ) . '/src ' );
37+ define ('ACFGB_URL_SRC ' , ACFGB_URL . '/src ' );
38+ define ('ACFGB_PATH_BIN ' , dirname (__FILE__ ) . '/bin ' );
39+ define ('ACFGB_URL_BIN ' , ACFGB_URL . '/bin ' );
4440
4541/** Initialize error collector */
4642$ errors = [];
4743
48-
49-
5044/**
5145 * Helper function for displaying errors.
5246 * @param $errors []
6761 */
6862version_compare ($ plugin ->requiredPHP , phpversion (), '< ' )
6963 ?: $ errors [] = (object ) [
70- 'title ' => __ ('Invalid PHP version ' , 'plugin-name ' ),
71- 'message ' => __ (
72- sprintf ('You must be using PHP %s or greater. ' , $ plugin ->requiredPHP ),
73- 'plugin-name '
74- ),
75- ];
64+ 'title ' => __ ('Invalid PHP version ' , 'plugin-name ' ),
65+ 'message ' => __ (
66+ sprintf ('You must be using PHP %s or greater. ' , $ plugin ->requiredPHP ),
67+ 'plugin-name '
68+ ),
69+ ];
7670
7771/**
7872 * Ensure the correct WordPress version is being used.
7973 */
8074version_compare ($ plugin ->requiredWP , get_bloginfo ('version ' ), '< ' )
8175 ?: $ errors [] = (object ) [
82- 'title ' => __ ('Invalid WordPress version ' , 'plugin-name ' ),
83- 'message ' => __ (
84- sprintf ('You must be using WordPress %s or greater. ' , $ plugin ->requiredWP ),
85- 'plugin-name '
86- ),
87- ];
76+ 'title ' => __ ('Invalid WordPress version ' , 'plugin-name ' ),
77+ 'message ' => __ (
78+ sprintf ('You must be using WordPress %s or greater. ' , $ plugin ->requiredWP ),
79+ 'plugin-name '
80+ ),
81+ ];
8882
8983/**
9084 * Ensure dependencies can be loaded.
9185 */
9286file_exists ($ plugin ->composer )
9387 ?: $ errors [] = (object ) [
94- 'title ' => __ ('Autoloader not found ' , 'plugin-name ' ),
95- 'message ' => __ (
96- sprintf ('You must run <code>composer install</code> from the %s plugin directory. ' , $ plugin ->name ),
97- 'plugin-name '
98- ),
99- ];
88+ 'title ' => __ ('Autoloader not found ' , 'plugin-name ' ),
89+ 'message ' => __ (
90+ sprintf ('You must run <code>composer install</code> from the %s plugin directory. ' , $ plugin ->name ),
91+ 'plugin-name '
92+ ),
93+ ];
10094
10195/**
10296 * If there are no errors, boot the plugin, or else display errors:
121115 add_action ('admin_notices ' , function () use ($ errors , $ display_errors ) {
122116 $ display_errors ($ errors , true );
123117 });
124- }
118+ }
0 commit comments