@@ -9,8 +9,8 @@ |
||
| 9 | 9 | $context = Timber::get_context(); |
| 10 | 10 | $post = new Post(); |
| 11 | 11 | $context['form'] = [ |
| 12 | - 'url' => site_url('/wp-login.php?action=postpass', 'login_post'), |
|
| 13 | - 'inputId' => empty($post->id) ? mt_rand() : $post->id |
|
| 12 | + 'url' => site_url('/wp-login.php?action=postpass', 'login_post'), |
|
| 13 | + 'inputId' => empty($post->id) ? mt_rand() : $post->id |
|
| 14 | 14 | ]; |
| 15 | 15 | |
| 16 | 16 | return Timber::fetch('index.twig', $context); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Timber\Timber; |
| 6 | 6 | use Timber\Post; |
| 7 | 7 | |
| 8 | -add_filter('the_password_form', function ($output) { |
|
| 8 | +add_filter('the_password_form', function($output) { |
|
| 9 | 9 | $context = Timber::get_context(); |
| 10 | 10 | $post = new Post(); |
| 11 | 11 | $context['form'] = [ |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | self::setupHelpers(); |
| 27 | 27 | |
| 28 | 28 | // add styles for admin area |
| 29 | - add_action('admin_enqueue_scripts', function () { |
|
| 29 | + add_action('admin_enqueue_scripts', function() { |
|
| 30 | 30 | Asset::enqueue([ |
| 31 | 31 | 'type' => 'style', |
| 32 | 32 | 'name' => 'Flynt/Features/Acf/AdminCss', |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Flynt\Features\MimeTypes; |
| 4 | 4 | |
| 5 | -add_filter('upload_mimes', function ($mimes) { |
|
| 5 | +add_filter('upload_mimes', function($mimes) { |
|
| 6 | 6 | $mimes['svg'] = 'image/svg+xml'; |
| 7 | 7 | return $mimes; |
| 8 | 8 | }); |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | * clone |
| 29 | 29 | * |
| 30 | 30 | * Prevent cloning with 'protected' keyword |
| 31 | - **/ |
|
| 31 | + **/ |
|
| 32 | 32 | protected function __clone() |
| 33 | 33 | { |
| 34 | 34 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | * constructor |
| 38 | 38 | * |
| 39 | 39 | * Prevent instantiation with 'protected' keyword |
| 40 | - **/ |
|
| 40 | + **/ |
|
| 41 | 41 | protected function __construct() |
| 42 | 42 | { |
| 43 | 43 | } |
@@ -68,7 +68,7 @@ |
||
| 68 | 68 | . "<p><strong>{$options['title']}</strong></p>" |
| 69 | 69 | . $msg . '</div>'; |
| 70 | 70 | |
| 71 | - add_action('admin_notices', function () use ($msg) { |
|
| 71 | + add_action('admin_notices', function() use ($msg) { |
|
| 72 | 72 | echo $msg; |
| 73 | 73 | }); |
| 74 | 74 | |
@@ -2,7 +2,7 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Flynt\Features\RemoveEditor; |
| 4 | 4 | |
| 5 | -add_action('init', function () { |
|
| 5 | +add_action('init', function() { |
|
| 6 | 6 | remove_post_type_support('page', 'editor'); |
| 7 | 7 | remove_post_type_support('post', 'editor'); |
| 8 | 8 | }); |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | * |
| 13 | 13 | * Don't return the default description in the RSS feed if it hasn't been changed |
| 14 | 14 | */ |
| 15 | -add_filter('get_bloginfo_rss', function ($bloginfo) { |
|
| 15 | +add_filter('get_bloginfo_rss', function($bloginfo) { |
|
| 16 | 16 | $defaultTagline = 'Just another WordPress site'; |
| 17 | 17 | return ($bloginfo === $defaultTagline) ? '' : $bloginfo; |
| 18 | 18 | }); |
@@ -12,11 +12,11 @@ discard block |
||
| 12 | 12 | * Remove self-closing tag |
| 13 | 13 | * |
| 14 | 14 | */ |
| 15 | -add_action('init', function () { |
|
| 15 | +add_action('init', function() { |
|
| 16 | 16 | // Originally from http://wpengineer.com/1438/wordpress-header/ |
| 17 | 17 | remove_action('wp_head', 'feed_links_extra', 3); |
| 18 | 18 | add_action('wp_head', 'ob_start', 1, 0); |
| 19 | - add_action('wp_head', function () { |
|
| 19 | + add_action('wp_head', function() { |
|
| 20 | 20 | $pattern = '/.*' . preg_quote(esc_url(get_feed_link('comments_' . get_default_feed())), '/') . '.*[\r\n]+/'; |
| 21 | 21 | echo preg_replace($pattern, '', ob_get_clean()); |
| 22 | 22 | }, 3, 0); |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | * |
| 45 | 45 | * Clean up output of stylesheet <link> tags |
| 46 | 46 | */ |
| 47 | -add_filter('style_loader_tag', function ($input) { |
|
| 47 | +add_filter('style_loader_tag', function($input) { |
|
| 48 | 48 | preg_match_all( |
| 49 | 49 | "!<link rel='stylesheet'\s?(id='[^']+')?\s+href='(.*)' type='text/css' media='(.*)' />!", |
| 50 | 50 | $input, |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | * |
| 64 | 64 | * Clean up output of <script> tags |
| 65 | 65 | */ |
| 66 | -add_filter('script_loader_tag', function ($input) { |
|
| 66 | +add_filter('script_loader_tag', function($input) { |
|
| 67 | 67 | $input = str_replace("type='text/javascript' ", '', $input); |
| 68 | 68 | return str_replace("'", '"', $input); |
| 69 | 69 | }); |
@@ -5,7 +5,7 @@ |
||
| 5 | 5 | use Flynt\Utils\Asset; |
| 6 | 6 | use Flynt\Utils\Feature; |
| 7 | 7 | |
| 8 | -add_action('wp_enqueue_scripts', function () { |
|
| 8 | +add_action('wp_enqueue_scripts', function() { |
|
| 9 | 9 | $jqueryVersion = wp_scripts()->registered['jquery']->ver; |
| 10 | 10 | wp_deregister_script('jquery'); |
| 11 | 11 | |
@@ -2,7 +2,6 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace Flynt\Features\TinyMce; |
| 4 | 4 | |
| 5 | -use Flynt\Utils\Feature; |
|
| 6 | 5 | use Flynt\Utils\Asset; |
| 7 | 6 | |
| 8 | 7 | // Load TinyMCE Settings from config file |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | // Load TinyMCE Settings from config file |
| 9 | 9 | |
| 10 | 10 | // First Toolbar |
| 11 | -add_filter('mce_buttons', function ($buttons) { |
|
| 11 | +add_filter('mce_buttons', function($buttons) { |
|
| 12 | 12 | $config = getConfig(); |
| 13 | 13 | if ($config && isset($config['toolbars'])) { |
| 14 | 14 | $toolbars = $config['toolbars']; |
@@ -20,11 +20,11 @@ discard block |
||
| 20 | 20 | }); |
| 21 | 21 | |
| 22 | 22 | // Second Toolbar |
| 23 | -add_filter('mce_buttons_2', function ($buttons) { |
|
| 23 | +add_filter('mce_buttons_2', function($buttons) { |
|
| 24 | 24 | return []; |
| 25 | 25 | }); |
| 26 | 26 | |
| 27 | -add_filter('tiny_mce_before_init', function ($init) { |
|
| 27 | +add_filter('tiny_mce_before_init', function($init) { |
|
| 28 | 28 | $config = getConfig(); |
| 29 | 29 | if ($config) { |
| 30 | 30 | if (isset($config['blockformats'])) { |
@@ -39,11 +39,11 @@ discard block |
||
| 39 | 39 | return $init; |
| 40 | 40 | }); |
| 41 | 41 | |
| 42 | -add_filter('acf/fields/wysiwyg/toolbars', function ($toolbars) { |
|
| 42 | +add_filter('acf/fields/wysiwyg/toolbars', function($toolbars) { |
|
| 43 | 43 | // Load Toolbars and parse them into TinyMCE |
| 44 | 44 | $config = getConfig(); |
| 45 | 45 | if ($config && !empty($config['toolbars'])) { |
| 46 | - $toolbars = array_map(function ($toolbar) { |
|
| 46 | + $toolbars = array_map(function($toolbar) { |
|
| 47 | 47 | array_unshift($toolbar, []); |
| 48 | 48 | return $toolbar; |
| 49 | 49 | }, $config['toolbars']); |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | function getBlockFormats($blockFormats) |
| 65 | 65 | { |
| 66 | 66 | if (!empty($blockFormats)) { |
| 67 | - $blockFormatStrings = array_map(function ($tag, $label) { |
|
| 67 | + $blockFormatStrings = array_map(function($tag, $label) { |
|
| 68 | 68 | return "${label}=${tag}"; |
| 69 | 69 | }, $blockFormats, array_keys($blockFormats)); |
| 70 | 70 | return implode($blockFormatStrings, ';'); |