Completed
Push — componentlibrary ( 67a692...eed31d )
by Doğa
01:48
created
inc/acf.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 use Flynt\Utils\Options;
5 5
 
6
-add_filter('pre_http_request', function ($preempt, $args, $url) {
6
+add_filter('pre_http_request', function($preempt, $args, $url) {
7 7
     if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) {
8 8
         $response = wp_cache_get($url, 'oembedCache');
9 9
         if (!empty($response)) {
@@ -13,14 +13,14 @@  discard block
 block discarded – undo
13 13
     return false;
14 14
 }, 10, 3);
15 15
 
16
-add_filter('http_response', function ($response, $args, $url) {
16
+add_filter('http_response', function($response, $args, $url) {
17 17
     if (strpos($url, 'https://www.youtube.com/oembed') !== false || strpos($url, 'https://vimeo.com/api/oembed') !== false) {
18 18
         wp_cache_set($url, $response, 'oembedCache');
19 19
     }
20 20
     return $response;
21 21
 }, 10, 3);
22 22
 
23
-add_filter('acf/fields/google_map/api', function ($api) {
23
+add_filter('acf/fields/google_map/api', function($api) {
24 24
     $apiKey = Options::get('globalOptions', 'feature', 'Acf', 'googleMapsApiKey');
25 25
     if ($apiKey) {
26 26
         $api['key'] = $apiKey;
Please login to merge, or discard this patch.
inc/mimeTypes.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
  */
5 5
 namespace Flynt\MimeTypes;
6 6
 
7
-add_filter('upload_mimes', function ($mimes) {
7
+add_filter('upload_mimes', function($mimes) {
8 8
     $mimes['svg'] = 'image/svg+xml';
9 9
     return $mimes;
10 10
 });
Please login to merge, or discard this patch.
inc/removeEditor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@
 block discarded – undo
4 4
  */
5 5
 namespace Flynt\RemoveEditor;
6 6
 
7
-add_action('init', function () {
7
+add_action('init', function() {
8 8
     remove_post_type_support('page', 'editor');
9 9
     remove_post_type_support('post', 'editor');
10 10
 });
Please login to merge, or discard this patch.
inc/assets.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -2,7 +2,7 @@  discard block
 block discarded – undo
2 2
 
3 3
 use Flynt\Utils\Asset;
4 4
 
5
-add_action('wp_enqueue_scripts', function () {
5
+add_action('wp_enqueue_scripts', function() {
6 6
     Asset::enqueue([
7 7
         'name' => 'Flynt/assets',
8 8
         'path' => 'assets/main.js',
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     ]);
19 19
 });
20 20
 
21
-add_action('admin_enqueue_scripts', function () {
21
+add_action('admin_enqueue_scripts', function() {
22 22
     Asset::enqueue([
23 23
         'name' => 'Flynt/assets/admin',
24 24
         'path' => 'assets/admin.js',
Please login to merge, or discard this patch.
inc/cleanHead.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
  * Remove self-closing tag
29 29
  *
30 30
  */
31
-add_action('init', function () {
31
+add_action('init', function() {
32 32
     // Originally from http://wpengineer.com/1438/wordpress-header/
33 33
     remove_action('wp_head', 'feed_links_extra', 3);
34 34
     add_action('wp_head', 'ob_start', 1, 0);
35
-    add_action('wp_head', function () {
35
+    add_action('wp_head', function() {
36 36
         $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\r\n]+/';
37 37
         echo preg_replace($pattern, '', ob_get_clean());
38 38
     }, 3, 0);
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
  *
61 61
  * Clean up output of stylesheet <link> tags
62 62
  */
63
-add_filter('style_loader_tag', function ($input) {
63
+add_filter('style_loader_tag', function($input) {
64 64
     preg_match_all(
65 65
         "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!",
66 66
         $input,
Please login to merge, or discard this patch.
inc/hideProtectedPosts.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -5,7 +5,7 @@
 block discarded – undo
5 5
  */
6 6
 namespace Flynt\HideProtectedPosts;
7 7
 
8
-add_action('pre_get_posts', function ($query) {
8
+add_action('pre_get_posts', function($query) {
9 9
     if (!$query->is_singular() && !is_admin()) {
10 10
         $query->set('has_password', false);
11 11
     }
Please login to merge, or discard this patch.
Components/FeatureAdminComponentScreenshots/functions.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 use Flynt\Utils\Asset;
5 5
 
6
-add_action('admin_enqueue_scripts', function () {
6
+add_action('admin_enqueue_scripts', function() {
7 7
     $data = [
8 8
         'templateDirectoryUri' => get_template_directory_uri() . '/dist',
9 9
     ];
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 if (class_exists('acf')) {
14 14
     if (is_admin()) {
15 15
         // add image to the flexible content component name
16
-        add_filter('acf/fields/flexible_content/layout_title', function ($title, $field, $layout, $i) {
16
+        add_filter('acf/fields/flexible_content/layout_title', function($title, $field, $layout, $i) {
17 17
             $componentName = ucfirst($layout['name']);
18 18
             $componentPath = "Components/{$componentName}";
19 19
             $componentScreenshotPath = Asset::requirePath("{$componentPath}/screenshot.png");
Please login to merge, or discard this patch.
inc/tinyMce.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@  discard block
 block discarded – undo
16 16
 namespace Flynt\TinyMce;
17 17
 
18 18
 // First Toolbar
19
-add_filter('mce_buttons', function ($buttons) {
19
+add_filter('mce_buttons', function($buttons) {
20 20
     $config = getConfig();
21 21
     if ($config && isset($config['toolbars'])) {
22 22
         $toolbars = $config['toolbars'];
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 });
29 29
 
30 30
 // Second Toolbar
31
-add_filter('mce_buttons_2', function ($buttons) {
31
+add_filter('mce_buttons_2', function($buttons) {
32 32
     return [];
33 33
 });
34 34
 
35
-add_filter('tiny_mce_before_init', function ($init) {
35
+add_filter('tiny_mce_before_init', function($init) {
36 36
     $config = getConfig();
37 37
     if ($config) {
38 38
         if (isset($config['blockformats'])) {
@@ -47,11 +47,11 @@  discard block
 block discarded – undo
47 47
     return $init;
48 48
 });
49 49
 
50
-add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) {
50
+add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) {
51 51
     // Load Toolbars and parse them into TinyMCE
52 52
     $config = getConfig();
53 53
     if ($config && !empty($config['toolbars'])) {
54
-        $toolbars = array_map(function ($toolbar) {
54
+        $toolbars = array_map(function($toolbar) {
55 55
             array_unshift($toolbar, []);
56 56
             return $toolbar;
57 57
         }, $config['toolbars']);
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 function getBlockFormats($blockFormats)
63 63
 {
64 64
     if (!empty($blockFormats)) {
65
-        $blockFormatStrings = array_map(function ($tag, $label) {
65
+        $blockFormatStrings = array_map(function($tag, $label) {
66 66
             return "${label}=${tag}";
67 67
         }, $blockFormats, array_keys($blockFormats));
68 68
         return implode(';', $blockFormatStrings);
Please login to merge, or discard this patch.