Complete switch over to Trestle settings.

This commit is contained in:
MickeyKay
2015-05-11 17:09:22 -07:00
parent 7d1b5573a1
commit 1bb6537455
5 changed files with 117 additions and 241 deletions
+33 -15
View File
@@ -7,23 +7,10 @@
* @package Trestle
*/
add_action( 'admin_enqueue_scripts', 'trestle_admin_actions' );
/**
* Loads admin scripts and styles.
* Set up Trestle default settings.
*
* @since 1.0.0
*/
function trestle_admin_actions() {
// Include the main stylesheet in the editor
add_editor_style( get_stylesheet_uri() );
}
//add_filter( 'after_setup_theme', 'trestle_settings_defaults' );
/**
* Sets up Trestle default settings.
*
* @since 1.0.0
* @since 2.0.0
*
* @return array Genesis settings updated to include Trestle defaults.
*/
@@ -70,6 +57,37 @@ function trestle_settings_defaults() {
// Update options with defaults.
update_option( TRESTLE_SETTINGS_FIELD, $options );
}
/**
* Wrapper function to get Trestle options.
*
* @since 2.0.0
* @uses genesis_get_option()
*
* @return mixed Trestle option value.
*/
function trestle_get_option( $key, $setting = null, $use_cache = true ) {
// Set default to TRESTLE_SETTINGS_FIELD.
$setting = $setting ? $setting : TRESTLE_SETTINGS_FIELD;
return genesis_get_option( $key, $setting, false );
}
add_action( 'admin_enqueue_scripts', 'trestle_admin_actions' );
/**
* Loads admin scripts and styles.
*
* @since 1.0.0
*/
function trestle_admin_actions() {
// Include the main stylesheet in the editor
add_editor_style( get_stylesheet_uri() );
}
add_action( 'tgmpa_register', 'trestle_register_required_plugins' );