Last active
March 30, 2016 09:43
-
-
Save hsleonis/be4c8fb25310043dbe06b502e681253e to your computer and use it in GitHub Desktop.
WP Theme Modification API
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Retrieves a modification setting for the current theme | |
| * Get, set or remove values of theme customizer | |
| * | |
| * Functions | |
| * get_theme_mod() | |
| * get_theme_mods() | |
| * set_theme_mod() | |
| * remove_theme_mod() | |
| * remove_theme_mods() | |
| * Hooks [Here $name= Theme customizer settings ID] | |
| * theme_mod_$name | |
| * | |
| * Reference: https://codex.wordpress.org/Theme_Modification_API | |
| */ | |
| $color = get_theme_mod( 'background_color', '#27AE60'); | |
| var_dump($color); | |
| // #27AE60 | |
| $mods = get_theme_mods(); | |
| var_dump($mods); | |
| // output example: | |
| // array(2) { ["header_textcolor"]=> string(3) "333" ["header_image"]=> string(20) "random-default-image" } | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment