/** * Write to the Dynamik Custom Functions file if it exists. * * @since 1.0 * */ function dynamik_write_custom_functions($code = '') { dynamik_folders_open_permissions(); if (!file_exists(dynamik_get_custom_functions_path())) { dynamik_create_custom_functions_file(); } $handle = @fopen(dynamik_get_custom_functions_path(), 'w+'); @fwrite($handle, stripslashes($code)); @fclose($handle); dynamik_folders_close_permissions(); }
/** * Require the Dynamik Custom Functions file only on the * site's front-end and only if it exists. * * @since 1.0 * */ function dynamik_require_custom_functions_file() { $custom_functions = get_option('dynamik_gen_custom_functions'); if (file_exists(dynamik_get_custom_functions_path()) && (!empty($custom_functions['custom_functions_effect_admin']) || !is_admin())) { require_once dynamik_get_custom_functions_path(); } }