Skip to content

Constants

Constants defined by the theme, plus those you may define yourself to configure it.

Defined by the theme

Set in inc/theme/constants.php, available to templates, child themes, and any code running after the theme loads.

Constant Value Purpose
LOVESHACK_VERSION e.g. 1.1.6 Theme version, used for asset cache busting
LOVESHACK_DIR get_template_directory() Absolute path to the parent theme
LOVESHACK_URI get_template_directory_uri() URL of the parent theme
LOVESHACK_UPDATE_API_URL Update endpoint URL Where theme updates are fetched from
LOVESHACK_CPT_STATUS cp_status Status update post type name
LOVESHACK_CPT_IMAGE cp_image Image post type name
LOVESHACK_CPT_VIDEO cp_video Video post type name
LOVESHACK_FILE_ATTACHMENTS_META_KEY _ls_file_attachment_ids Post meta key holding attachment IDs

The post type constants are defined ahead of inc/post-types.php so they are available before the types themselves are registered.

Use the constants, not the literals

Write LOVESHACK_CPT_STATUS, not 'cp_status'. The constants are the stable interface; the string values are an implementation detail.

Defined by you

Set these in wp-config.php to configure the theme from outside the database.

Constant Purpose
LOVESHACK_UPDATE_API_USERNAME Update API username
LOVESHACK_UPDATE_API_APPLICATION_PASSWORD Update API Application Password
LOVESHACK_UPDATE_API_KEY Legacy shared API key
LOVESHACK_UPDATE_API_CHANNEL Update channel: 'stable', 'beta', or 'alpha'
DISABLE_WP_CRON WordPress core — required for real server cron

Constants take precedence over the equivalent values saved through Loveshack → Theme Updates.

Credentials never belong in the theme

Do not put update credentials in theme files or commit them to version control. Use wp-config.php, an MU plugin, or your secrets provider.

User meta keys

Meta key Holds
lss_digest_last_sent_gmt Timestamp of the subscriber's last successful digest send

Cron hooks

Hook Interval
lss_process_subscriber_digests Every 10 minutes