[gnomegr-web] Add footer option to WP customizer



commit 97ea330bca41343374b77196927b48f36fc6f609
Author: Tom Tryfonidis <tomtryf gnome org>
Date:   Thu Apr 6 00:11:19 2017 +0300

    Add footer option to WP customizer

 gnomegr/footer.php         |    6 ++----
 gnomegr/inc/customizer.php |   35 +++++++++++++++++++++++++++++++++++
 2 files changed, 37 insertions(+), 4 deletions(-)
---
diff --git a/gnomegr/footer.php b/gnomegr/footer.php
index d063986..335feba 100644
--- a/gnomegr/footer.php
+++ b/gnomegr/footer.php
@@ -21,11 +21,9 @@
         <div class="row">
             <div class="col-sm-12">
                 <div id="footnotes" class="col-sm-9">
-                    <strong class="gnome_logo">&copy; <?php echo date("Y"); ?> <?php esc_html_e( 'GNOME', 
'grass' ); ?></strong><br />
+                    <strong class="gnome_logo">&copy; <?php echo date("Y"); ?> <?php echo 
get_theme_mod('footer_copyright_text');?></strong><br />
                     <small>
-                        <?php esc_html_e( 'Licence', 'grass' ); ?> <a 
href="http://creativecommons.org/licenses/by-sa/3.0/gr/";>Creative Commons CC-BY</a>.
-                        <?php esc_html_e( 'Hosted by', 'grass' ); ?> <a href="http://www.redhat.com/";>Red 
Hat</a>.
-                        <?php esc_html_e( 'Based on', 'grass' ); ?> <a 
href="http://www.wordpress.org";>WordPress</a>.
+                        <?php echo get_theme_mod('footer_notes');?>
                     </small>
                 </div>
             </div>
diff --git a/gnomegr/inc/customizer.php b/gnomegr/inc/customizer.php
index 60ea9a4..1e8ebb2 100644
--- a/gnomegr/inc/customizer.php
+++ b/gnomegr/inc/customizer.php
@@ -260,5 +260,40 @@ function gnome_grass_options( $wp_customize ) {
             'type' => 'textarea',
         )
     );
+    // Footer
+    $wp_customize->add_section( 'footer_section', array(
+        'title'          => esc_html( 'Footer', 'grass' ),
+        'priority'       => 95,
+        'description' => esc_html( 'Edit your footer content', 'grass' ),
+        'panel' => 'page_home',
+    ));
+    // Footer Copyright Text
+    $wp_customize->add_setting( 'footer_copyright_text',
+        array(
+            'default' => 'GNOME',
+            'sanitize_callback' => 'grass_sanitize_text',
+        )
+    );
+    $wp_customize->add_control( 'footer_copyright_text',
+        array(
+            'label' => esc_html('Footer Copyright Holder'),
+            'section' => 'footer_section',
+            'type' => 'text',
+        )
+    );
+    // Footernotes
+    $wp_customize->add_setting( 'footer_notes',
+        array(
+            'default' => 'Content License <a href=""></a>. Hosted by <a href="http://www.redhat.com/";>Red 
Hat</a>. Powered by <a href="http://www.wordpress.org";>WordPress</a>.',
+            'sanitize_callback' => 'grass_sanitize_text',
+        )
+    );
+    $wp_customize->add_control( 'footer_notes',
+        array(
+            'label' => esc_html('Text for footernotes'),
+            'section' => 'footer_section',
+            'type' => 'textarea',
+        )
+    );
 }
 ?>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]