Core Framework
HomeChangelogDashboard
  • 📖Introduction
    • 📝 Overview of Core Framework
    • 💁🏼‍♂️ Target Audience
    • 🔍 Navigation of the Documentation
  • 🚀Getting Started
    • Getting Started with Web App and WordPress
    • Initial Setup and Configuration
    • Video tutorial: First-time setup walkthrough
    • OxyNinja Users
  • 🧩Builder Integrations
    • Overview
    • Oxygen Builder
    • Bricks Builder
    • Gutenberg
  • Figma
    • Getting Started with Figma
    • Create and Manage Variables
    • Editing Elements
  • 💻Navigating the UI
    • Color System
    • Typography
    • Spacing
    • Components
    • Utility Classes & Vars
    • Breakpoints
    • Manage project
    • Remote Import
    • Preferences
  • 📒How to Use
    • Dark Mode
    • Grid System
    • Filters
  • 🎯Marketplace
    • Buying Products
    • Become an Author
    • Author Guidelines
  • 👕Official UI Kits
    • Blocks
    • CoreKit
    • Violet
    • WooCore
    • Style Guide
    • OxyNinja Icons
  • Official Templates
    • Agency
    • Real Estate
  • 🔨Troubleshooting
    • Common Problems
    • FAQ
  • 📖Changelog
    • Changelog
    • Feature Requests
  • Development
    • CoreFramework\Helper
Powered by GitBook
On this page
  • Introduction
  • Usage
  • Method: $helper->getStylesheetUrl()
  • Method: $helper->getStylesheetPath()
  • Method: $helper->getStylesheetVersion()
  • Method: $helper->getClassNames([options])
  • Method: $helper->getVariables([options])
  1. Development

CoreFramework\Helper

Introduction

The Helper class provided in the plugin is a powerful tool designed to facilitate easy access to a list of variables and classes within the Core Framework. This class allows developers to retrieve variables and classes, making it convenient to implement Core Framework into various Wordpress plugins.

Usage

use CoreFramework\Helper;

if (is_plugin_active('core-framework/core-framework.php')) {
    if (class_exists('CoreFramework\Helper')) {
        $helper = new Helper(); 

        $class_names = $helper->getClassNames(); // [ 'colorStyles' => ['bg-primary', 'text-primary', 'border-primary'], 'typographyStyles' => [...], 'spacingStyles' => [...], 'layoutsStyles' => [...], 'designStyles' => [...], 'componentsStyles' => [...], 'otherStyles' => [...] ];
        $class_names = $helper->getClassNames([
            'group_by_category' => false,
        ]); // ['bg-primary', 'text-primary', 'border-primary', ...]

        $variables = $helper->getVariables(); // [ 'colorStyles' => ['primary', 'secondary'], 'typographyStyles' => [...], 'spacingStyles' => [...], 'layoutsStyles' => [...], 'designStyles' => [...], 'componentsStyles' => [...], 'otherStyles' => [...] ];
        $variables = $helper->getVariables([
            'group_by_category' => false,
        ]); // ['primary', 'secondary', ...]
    }
}

Method: $helper->getStylesheetUrl()

Since: 1.3.3

Retrieves the full URL of the core framework stylesheet.

Method: $helper->getStylesheetPath()

Since: 1.3.3

Obtains the server path to the core framework stylesheet.

Method: $helper->getStylesheetVersion()

Since: 1.3.3

Fetches the version of the core framework stylesheet.

Method: $helper->getClassNames([options])

Parameters:

  • options (optional, array): An array of options to customise the output. The options array may contain the following keys

    Option
    Type
    Default
    Description

    group_by_category

    boolean

    true

    Determines whether the returned data should be grouped by category.

    excluded_keys

    string[]

    []

    An array of keys that should be excluded from the returned data. For example, to exclude all class names or variables related to colors, pass ['colorStyles'] as an element of the excluded_keys array. The keys can be any of the following predefined strings: 'colorStyles', 'typographyStyles', 'spacingStyles', 'layoutsStyles', 'designStyles', 'componentsStyles', 'otherStyles'.

Method: $helper->getVariables([options])

Parameters:

  • options (optional, array): An array of options to customise the output. The options array may contain the following keys

    Option
    Type
    Default
    Description

    group_by_category

    boolean

    true

    Determines whether the returned data should be grouped by category.

    excluded_keys

    string[]

    []

    An array of keys that should be excluded from the returned data. For example, to exclude all class names or variables related to colors, pass ['colorStyles'] as an element of the excluded_keys array. The keys can be any of the following predefined strings: 'colorStyles', 'typographyStyles', 'spacingStyles', 'layoutsStyles', 'designStyles', 'componentsStyles', 'otherStyles'.

Helper class has been introduced in version 1.2.7.

PreviousChangelog

Last updated 1 year ago