/**
 * Write to the Genesis Extender Custom Functions file if it exists.
 *
 * @since 1.0
 *
 */
function genesis_extender_write_custom_functions($code = '')
{
    genesis_extender_folders_open_permissions();
    if (!file_exists(genesis_extender_get_custom_functions_path())) {
        genesis_extender_create_custom_functions_file();
    }
    $handle = @fopen(genesis_extender_get_custom_functions_path(), 'w+');
    @fwrite($handle, stripslashes($code));
    @fclose($handle);
    genesis_extender_folders_close_permissions();
}
/**
 * Require the Genesis Extender Custom Functions file only on the
 * site's front-end and only if it exists.
 *
 * @since 1.0
 *
 */
function genesis_extender_require_custom_functions_file()
{
    $custom_functions = get_option('genesis_extender_custom_functions');
    if (file_exists(genesis_extender_get_custom_functions_path()) && (!empty($custom_functions['custom_functions_effect_admin']) || !is_admin())) {
        require_once genesis_extender_get_custom_functions_path();
    }
}