/**
 * Write to the Genesis Extender Custom Widget Areas file if it exists.
 *
 * @since 1.0
 *
 */
function genesis_extender_write_custom_widget_areas($code = '')
{
    genesis_extender_folders_open_permissions();
    if (!file_exists(genesis_extender_get_custom_widget_areas_path())) {
        genesis_extender_create_custom_widget_areas_file();
    }
    $handle = @fopen(genesis_extender_get_custom_widget_areas_path(), 'w+');
    @fwrite($handle, stripslashes($code));
    @fclose($handle);
    genesis_extender_folders_close_permissions();
}
Пример #2
0
/**
 * Require the Genesis Extender Custom Widget Areas file only on the
 * site's front-end and only if it exists.
 *
 * @since 1.0
 *
 */
function genesis_extender_require_custom_widget_areas_file()
{
    if (!is_admin() && file_exists(genesis_extender_get_custom_widget_areas_path())) {
        require_once genesis_extender_get_custom_widget_areas_path();
    }
}