: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
$options = apply_filters( 'herald_modify_module_columns', $options ); //Allow child themes or plugins to modify
* @param array $default Enable defaults i.e. array('date', 'comments')
* @return array List of available options
if ( !function_exists( 'herald_get_meta_opts' ) ):
function herald_get_meta_opts( $default = array() ) {
$options['date'] = esc_html__( 'Date', 'herald' );
$options['modified_date'] = esc_html__( 'Modified date', 'herald' );
$options['time'] = esc_html__( 'Time', 'herald' );
$options['comments'] = esc_html__( 'Comments', 'herald' );
$options['author'] = esc_html__( 'Author', 'herald' );
$options['views'] = esc_html__( 'Views', 'herald' );
$options['rtime'] = esc_html__( 'Reading time', 'herald' );
if ( herald_is_wp_review_active() ) {
$options['reviews'] = esc_html__( 'Reviews', 'herald' );
if ( !empty( $default ) ) {
foreach ( $options as $key => $option ) {
if ( in_array( $key, $default ) ) {
$options = apply_filters( 'herald_modify_meta_opts', $options ); //Allow child themes or plugins to modify
* Get image ratio options
* @param bool $original Wheter to include "original (not cropped)" ratio option
* @return array List of available options
if ( !function_exists( 'herald_get_image_ratio_opts' ) ):
function herald_get_image_ratio_opts( $original = false ) {
$options['original'] = esc_html__( 'Original (ratio as uploaded - do not crop)', 'herald' );
$options['16_9'] = esc_html__( '16:9', 'herald' );
$options['3_2'] = esc_html__( '3:2', 'herald' );
$options['4_3'] = esc_html__( '4:3', 'herald' );
$options['1_1'] = esc_html__( '1:1 (square)', 'herald' );
$options['custom'] = esc_html__( 'Your custom ratio', 'herald' );
$options = apply_filters( 'herald_modify_image_ratio_opts', $options ); //Allow child themes or plugins to modify
* Functions gets the list (array) of elements which can be placed in header
* @param string $type top|main|bottom|sticky
* @return array List of available elements
if ( !function_exists( 'herald_get_header_elements' ) ):
function herald_get_header_elements( $type = 'top' , $position = 'left', $default = false ) {
'logo' => array( 'title' => esc_html__( 'Logo/Title', 'herald' ), 'dep' => array( 'middle' => array( 'left' ), 'sticky' => array() ) ),
'logo-mini' => array( 'title' => esc_html__( 'Mini logo', 'herald' ), 'dep' => array( 'bottom' => array(), 'sticky' => array( 'left' ) ) ),
'main-menu' => array( 'title' => esc_html__( 'Main menu', 'herald' ), 'dep' => array( 'middle' => array(), 'bottom' => array( 'left' ), 'sticky' => array( 'right' ) ) ),
'social-menu' => array( 'title' => esc_html__( 'Social menu (icons list)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array( 'right' ), 'sticky' => array() ) ),
'social-menu-drop' => array( 'title' => esc_html__( 'Social menu (icon/dropdown)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
'ad' => array( 'title' => esc_html__( 'Ad', 'herald' ), 'dep' => array( 'middle' => array( 'right' ) ) ),
'search' => array( 'title' => esc_html__( 'Search (form)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
'search-drop' => array( 'title' => esc_html__( 'Search (icon/dropdown)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array( 'left' ), 'sticky' => array() ) ),
'secondary-menu-1' => array( 'title' => esc_html__( 'Secondary menu 1', 'herald' ), 'dep' => array( 'top' => array( 'left' ), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
'secondary-menu-2' => array( 'title' => esc_html__( 'Secondary menu 2', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
'secondary-menu-3' => array( 'title' => esc_html__( 'Secondary menu 3', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
'site-desc' => array( 'title' => esc_html__( 'Site desription', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
'date' => array( 'title' => esc_html__( 'Current date', 'herald' ), 'dep' => array( 'top' => array( 'right' ), 'bottom' => array() ) ),
'login-form' => array( 'title' => esc_html__( 'Login form (icon/dropdown)', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) ),
if ( herald_is_woocommerce_active() ) {
$options['woocommerce-cart-icon'] = array( 'title' => esc_html__( 'WooCommerce Cart Icon', 'herald' ), 'dep' => array( 'top' => array(), 'middle' => array(), 'bottom' => array(), 'sticky' => array() ) );
$options = apply_filters( 'herald_modify_header_elements', $options ); //Allow child themes or plugins to modify
foreach ( $options as $opt => $data ) {
if ( array_key_exists( $type, $data['dep'] ) ) {
$output[$opt] = $data['title'];
if ( in_array( $position, $data['dep'][$type] ) ) {
* Functions gets the list (array) of elements which can be placed in responsive header
* @return array List of available elements
if ( !function_exists( 'herald_get_header_responsive_actions' ) ):
function herald_get_header_responsive_actions() {
'search-drop' => esc_html__( 'Search (icon/dropdown)', 'herald' ),
'login-form' => esc_html__( 'Login form (icon/dropdown)', 'herald' ),
if ( herald_is_woocommerce_active() ) {
$options['woocommerce-cart-icon'] = esc_html__( 'WooCommerce Cart Icon', 'herald' );
$options = apply_filters( 'herald_modify_header_responsive_actions', $options ); //Allow child themes or plugins to modify
* Functions gets the list (array) of elements which can be placed in footer copyright bar
* @param string $type top|main|bottom|sticky
* @return array List of available elements
if ( !function_exists( 'herald_get_footer_elements' ) ):
function herald_get_footer_elements( $position = 'left', $default = false ) {
'copyright' => array( 'title' => esc_html__( 'Copyright text', 'herald' ), 'dep' => array( 'left' ) ),
'social-menu' => array( 'title' => esc_html__( 'Social menu', 'herald' ), 'dep' => array( 'right' ) ),
'secondary-menu-1' => array( 'title' => esc_html__( 'Secondary menu 1', 'herald' ), 'dep' => array() ),
'secondary-menu-2' => array( 'title' => esc_html__( 'Secondary menu 2', 'herald' ), 'dep' => array() ),
'secondary-menu-3' => array( 'title' => esc_html__( 'Secondary menu 3', 'herald' ), 'dep' => array() ),
'date' => array( 'title' => esc_html__( 'Current date', 'herald' ), 'dep' => array() ),
$options = apply_filters( 'herald_modify_footer_elements', $options ); //Allow child themes or plugins to modify
foreach ( $options as $opt => $data ) {
$output[$opt] = $data['title'];
if ( in_array( $position, $data['dep'] ) ) {
* Check if there is available theme update
* @return string HTML output with update notification and the link to change log
if ( !function_exists( 'herald_get_update_notification' ) ):
function herald_get_update_notification() {
$current = get_site_transient( 'update_themes' );
if ( isset( $current->response['herald'] ) ) {
$message_html = '<span class="update-message">New update available!</span>
<span class="update-actions">Version '.$current->response['herald']['new_version'].': <a href="http://demo.mekshq.com/herald/documentation#changelog" target="blank">See what\'s new</a><a href="'.admin_url( 'update-core.php' ).'">Update</a></span>';
$message_html = '<a class="theme-version-label" href="https://mekshq.com/docs/herald-change-log" target="blank">Version '.HERALD_THEME_VERSION.'</a>';
* Use this function to properly order sortable options like in categories and series module
* @param array $items Array of items
* @param array $selected Array of IDs of currently selected items
* @return array ordered items
if ( !function_exists( 'herald_sort_option_items' ) ):
function herald_sort_option_items( $items, $selected, $field = 'term_id' ) {
if ( empty( $selected ) ) {
$temp_items_ids = array();
foreach ( $selected as $selected_item_id ) {
foreach ( $items as $item ) {
if ( $selected_item_id == $item->$field ) {
if ( !in_array( $item->$field, $selected ) && !in_array( $item->$field, $temp_items_ids ) ) {
$temp_items_ids[] = $item->$field;
$new_items = array_merge( $new_items, $temp_items );
* Get Admin JS localized variables
* Function creates list of variables from theme to pass
* them to global JS variable so we can use it in JS files
* @return array List of JS settings
if ( !function_exists( 'herald_get_admin_js_settings' ) ):
function herald_get_admin_js_settings() {
$js_settings['ajax_url'] = admin_url( 'admin-ajax.php' );
$js_settings['is_gutenberg'] = herald_is_gutenberg_page();
* Get author social links
* @param array $default Enable defaults i.e. array('twitter')
* @return array List of available options
if ( !function_exists( 'herald_get_author_social_opts' ) ):
function herald_get_author_social_opts( $default = array() ) {
$options['twitter'] = esc_html__( 'Twitter', 'herald' );
$options['facebook'] = esc_html__( 'Facebook', 'herald' );
$options['instagram'] = esc_html__( 'Instagram', 'herald' );
if ( !empty( $default ) ) {
foreach ( $options as $key => $option ) {
if ( in_array( $key, $default ) ) {
$options = apply_filters( 'herald_modify_author_social_opts', $options );
* Check if Envato Market plugin is active
if ( !function_exists( 'herald_is_envato_market_active' ) ):
function herald_is_envato_market_active() {
return function_exists('envato_market');
* Check if Redux Options framework is active
if ( !function_exists( 'herald_is_redux_active' ) ):
function herald_is_redux_active() {
return class_exists( 'ReduxFramework' );