Skip to content

Commit 58d5847

Browse files
committed
fix(inc): add missing files
1 parent 9729f09 commit 58d5847

File tree

2 files changed

+108
-0
lines changed

2 files changed

+108
-0
lines changed

inc/customizer-logo.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
/**
4+
* Add theme options to customizer
5+
*/
6+
7+
add_action('customize_register', function ($wp_customize) {
8+
// Add option to replace header logo
9+
$wp_customize->add_setting(
10+
'custom_header_logo',
11+
[
12+
'default' => '',
13+
'type' => 'theme_mod',
14+
'capability' => 'edit_theme_options'
15+
]
16+
);
17+
18+
$wp_customize->add_control(new WP_Customize_Image_Control(
19+
$wp_customize,
20+
'custom_header_logo',
21+
[
22+
'label' => __('Replace Header Logo'),
23+
'description' => 'Upload file to replace header logo. Accepted file formats: jpg, jpeg, png, svg, gif.',
24+
'section' => 'title_tagline',
25+
'settings' => 'custom_header_logo',
26+
'priority' => 10,
27+
]
28+
));
29+
});

inc/shortcodes.php

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
<?php
2+
3+
/**
4+
* Flynt Shortcodes
5+
*/
6+
7+
namespace Flynt\Shortcodes;
8+
9+
/**
10+
* Current year
11+
*/
12+
add_shortcode('year', function () {
13+
$year = date_i18n('Y');
14+
return $year;
15+
});
16+
17+
/**
18+
* Site Title
19+
*/
20+
add_shortcode('sitetitle', function () {
21+
$blogname = get_bloginfo('name');
22+
return $blogname;
23+
});
24+
25+
/**
26+
* Tagline
27+
*/
28+
add_shortcode('tagline', function () {
29+
$tagline = get_bloginfo('description');
30+
return $tagline;
31+
});
32+
33+
/**
34+
* Flynt Shortcode reference
35+
*/
36+
function getShortcodeReference()
37+
{
38+
return [
39+
'label' => __('Shortcode Reference', 'flynt'),
40+
'name' => 'groupShortcodes',
41+
'instructions' => __('A Shortcode can generally be used inside text fields. It’s best practice to switch to text mode before inserting a shortcode inside the visual editor.', 'flynt'),
42+
'type' => 'group',
43+
'sub_fields' => [
44+
[
45+
'label' => __('Site Title (Website Name)', 'flynt'),
46+
'name' => 'messageShortcodeSiteTitle',
47+
'type' => 'message',
48+
'message' => '<code>[sitetitle]</code>',
49+
'new_lines' => 'wpautop',
50+
'esc_html' => 0,
51+
'wrapper' => [
52+
'width' => 50
53+
],
54+
],
55+
[
56+
'label' => __('Tagline (Subtitle)', 'flynt'),
57+
'name' => 'messageShortcodeTagline',
58+
'type' => 'message',
59+
'message' => '<code>[tagline]</code>',
60+
'new_lines' => 'wpautop',
61+
'esc_html' => 0,
62+
'wrapper' => [
63+
'width' => 50
64+
],
65+
],
66+
[
67+
'label' => __('Current Year', 'flynt'),
68+
'name' => 'messageShortcodeCurrentYear',
69+
'type' => 'message',
70+
'message' => '<code>[year]</code>',
71+
'new_lines' => 'wpautop',
72+
'esc_html' => 0,
73+
'wrapper' => [
74+
'width' => 50
75+
],
76+
],
77+
]
78+
];
79+
}

0 commit comments

Comments
 (0)