|
@@ -38,10 +38,10 @@ discard block |
|
|
block discarded – undo |
|
38
|
38
|
if (is_admin()) { |
|
39
|
39
|
add_action('admin_enqueue_scripts', NS . 'enqueueComponentScripts'); |
|
40
|
40
|
// add image to the flexible content component name |
|
41
|
|
- add_filter('acf/fields/flexible_content/layout_title', function ($title, $field, $layout, $i) { |
|
|
41
|
+ add_filter('acf/fields/flexible_content/layout_title', function($title, $field, $layout, $i) { |
|
42
|
42
|
$componentName = ucfirst($layout['name']); |
|
43
|
43
|
$componentPath = "Components/{$componentName}/"; |
|
44
|
|
- $componentPreviewDesktopPath = Asset::requirePath($componentPath . 'preview-desktop.jpg') ; |
|
|
44
|
+ $componentPreviewDesktopPath = Asset::requirePath($componentPath . 'preview-desktop.jpg'); |
|
45
|
45
|
$componentPreviewDesktopUrl = Asset::requireUrl($componentPath . 'preview-desktop.jpg'); |
|
46
|
46
|
if (is_file($componentPreviewDesktopPath)) { |
|
47
|
47
|
$newTitle = '<span class="flyntComponentPreview">'; |
|
@@ -55,7 +55,7 @@ discard block |
|
|
block discarded – undo |
|
55
|
55
|
} else { |
|
56
|
56
|
add_action('wp_enqueue_scripts', NS . 'enqueueComponentScripts'); |
|
57
|
57
|
// adds Component Previews button to admin bar on front-end when logged in |
|
58
|
|
- add_action('admin_bar_menu', function ($wpAdminBar) { |
|
|
58
|
+ add_action('admin_bar_menu', function($wpAdminBar) { |
|
59
|
59
|
$title = __('Component Previews', 'flynt-starter-theme'); |
|
60
|
60
|
$wpAdminBar->add_menu([ |
|
61
|
61
|
'id' => 'toggleComponentPreviews', |