Developer Docs
  • Getting started
  • Tutorials
    • Integrate your theme with HivePress
    • Create a custom HivePress extension
  • Framework
    • Blocks
      • Callback
      • Container
      • Content
      • Form
      • Menu
      • Modal
      • Part
      • Section
      • Template
      • Toggle
    • Components
      • Cache
      • Helper
      • Request
      • Router
      • Translator
    • Configurations
      • Comment types
      • Image sizes
      • Meta boxes
      • Post types
      • Scripts
      • Settings
      • Strings
      • Styles
      • Taxonomies
    • Controllers
    • Emails
    • Fields
      • Checkbox
      • Checkboxes
      • Date
      • Date Range
      • Email
      • File
      • Number
      • Number Range
      • Password
      • Phone
      • Radio Buttons
      • Repeater
      • Select
      • Text
      • Textarea
      • Time
      • URL
    • Forms
    • Menus
    • Models
      • Making queries
      • Creating models
      • Customizing models
    • Templates
  • Resources
    • Code snippets
    • Code reference
    • Hook reference
    • REST API
Powered by GitBook
On this page

Was this helpful?

  1. Framework
  2. Configurations

Strings

This configuration contains an array of reusable HivePress strings. It's mainly used to avoid duplicating translations in the HivePress themes and extensions. You can get any of the available strings by the string name:

echo hivepress()->translator->get_string( 'listings' );

The code example below changes the "Listings" word in HivePress along with its themes and extensions. In the same way, you can change any of the available strings or add a new one by adding an array item.

add_filter(
	'hivepress/v1/strings',
	function( $strings ) {
		$strings['listings'] = 'Custom Text';

		return $strings;
	}
);
PreviousSettingsNextStyles

Last updated 2 years ago

Was this helpful?