/**
 * Write to the Genesis Extender Custom Hook Boxes file if it exists.
 *
 * @since 1.0
 *
 */
function genesis_extender_write_custom_hook_boxes($code = '')
{
    genesis_extender_folders_open_permissions();
    if (!file_exists(genesis_extender_get_custom_hook_boxes_path())) {
        genesis_extender_create_custom_hook_boxes_file();
    }
    $handle = @fopen(genesis_extender_get_custom_hook_boxes_path(), 'w+');
    @fwrite($handle, htmlspecialchars_decode(stripslashes($code)));
    @fclose($handle);
    genesis_extender_folders_close_permissions();
}
Ejemplo n.º 2
0
/**
 * Require the Genesis Extender Custom Hook Boxes file only on the
 * site's front-end and only if it exists.
 *
 * @since 1.0
 *
 */
function genesis_extender_require_custom_hook_boxes_file()
{
    if (!is_admin() && file_exists(genesis_extender_get_custom_hook_boxes_path())) {
        require_once genesis_extender_get_custom_hook_boxes_path();
    }
}