Skip to content

Settings reference#

Snippets → Settings, for administrators (manage_options). The first group is shared with Simple Custom CSS and JS (stored in its ccj_settings option), so it carries over in either direction; the rest are BB Snippets' own (bb_snippets_settings).

Shared with Simple Custom CSS and JS#

Setting Key Default What it does
Comments in the page remove_comments off Leaves out the start/end Simple Custom CSS and JS comments around inline snippets.
Comments in files remove_file_comments off Leaves out the header comment at the top of linked files.
Preview link lifetime ccj_duration_preview 3600 Seconds a "Preview unsaved changes" link works (minimum 60).
Web Designer role add_role as found Creates or removes the css_js_designer role: the snippet capabilities and read, nothing else.

BB Snippets#

Setting Key Default What it does
Output output classic classic prints the old plugin's markup byte for byte. registered turns front-end CSS snippets and linked JavaScript snippets into WordPress styles and scripts (bb-snippet-{key}), printed at the same place. See How it works. Saving purges BB Cache.
Code code_for_editors off Off: JavaScript, HTML and admin, login or block-editor snippets need unfiltered_html (administrators and editors); the Web Designer role writes CSS for the site only. On: anyone with the snippet capabilities may write them, which lets them run script in an administrator's browser. See Security.

Constants and filters#

Name Kind Effect
BB_SNIPPETS_EVAL_CONDITIONALS constant true runs conditional rules with eval() instead of the parser. Gives every snippet editor PHP execution; leave it off.
CCJ_WP_CONDITIONALS constant false turns conditional rules off, as in the old plugin.
bb_snippets_code_cap filter The capability code snippets need (default unfiltered_html).
bb_snippets_file_dirs filter The theme snippet folders.
ccj_preprocessor_import_paths filter Folders SASS/LESS @import may read from.
bb_snippets_purge filter Return false to stop BB Snippets purging BB Cache.
bb_snippets_device_nocache filter Whether pages with desktop/mobile snippets are kept out of the page cache.
bb_snippets_is_mobile filter The device test for desktop/mobile snippets.

The rest of the hooks are listed under How it works.