Skip to content

Instantly share code, notes, and snippets.

@atwellpub
Last active August 29, 2015 14:04
Show Gist options
  • Save atwellpub/6962736a05d82c7da059 to your computer and use it in GitHub Desktop.
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
<?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'
);
}
@jdouglas71
Copy link

This doesn't parse. Needs a comma at the end of the description line.

@FresnoPM
Copy link

FresnoPM commented Sep 2, 2014

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment