Last active
August 29, 2015 14:04
-
-
Save atwellpub/6962736a05d82c7da059 to your computer and use it in GitHub Desktop.
Adds settings to the 'default' landing page template via custom plugin code or an active theme's functions.php file
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 | |
add_filter('lp_extension_data','lp_rebuild_old_data_configurations_to_suit_new_convention'); | |
function lp_rebuild_old_data_configurations_to_suit_new_convention($lp_data) | |
{ | |
$lp_data['default']['settings']['new_setting'] = array( | |
'label' => "New setting", | |
'description' => "Description of new setting here. Will be placed in tooltip" | |
'id' => 'new_setting', | |
'type' => 'dropdown', | |
'default' => 'off', | |
'options' => array('off'=>'Turn off','on'=>'Trun On'), | |
'context' => 'normal' | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
when I place this code in my theme's functions.php, I get
Fatal error: Cannot redeclare lp_rebuild_old_data_configurations_to_suit_new_convention() in /nas/wp/www/sitename/wp-content/themes/my-theme/functions.php on line x