';
} else {
return '';
}
} elseif ( $type === 'likes' ) {
if ( $icon_type === 'svg' ) {
return '';
} else {
return '';
}
} elseif ( $type === 'comments' ) {
if ( $icon_type === 'svg' ) {
return '';
} else {
return '';
}
} elseif ( $type === 'newlogo' ) {
return '';
//return '';
} elseif ( $type === 'map_marker' ) {
if ( $icon_type === 'svg' ) {
return '';
} else {
return '';
}
} elseif ( $type === 'photo' ) {
if ( $icon_type === 'svg' ) {
return '';
} else {
return '';
}
} elseif ( $type === 'user' ) {
if ( $icon_type === 'svg' ) {
return '';
} else {
return '';
}
} elseif ( $type === 'views' ) {
if ( $icon_type === 'svg' ) {
return '';
} else {
return '';
}
} else {
return '';
}
}
/**
* A not very elegant but useful method to abstract out how the settings
* work for displaying certain elements in the feed.
*
* @param string $element specific key, view below for supported ones
* @param $settings
*
* @return bool
*
* @since 5.0
*/
public static function should_show_element( $element, $context, $settings ) {
if ( sby_doing_customizer( $settings ) ) {
return true;
}
//user, views, date
if ( $context === 'item-hover' ) {
if ( $settings['layout'] === 'list' ) {
$include_array = array();
} else {
$include_array = $settings['hoverinclude'];
}
} elseif ( $context === 'result' ) {
$include_array = array();
} elseif ( $context === 'single' ) {
$cpt_settings = SBY_CPT::get_sby_cpt_settings();
$include_array = $cpt_settings['include'];
} else {
$include_array = $settings['include'];
}
$include_array = is_array( $include_array ) ? $include_array : explode( ',', str_replace( ' ', '', $include_array ) );
if ( $element === 'meta' ) {
if ( in_array( 'user', $include_array, true )
|| in_array( 'views', $include_array, true )
|| in_array( 'date', $include_array, true ) ) {
return true;
} else {
return false;
}
} elseif ( in_array( $element, $include_array, true ) ) {
return true;
}
return false;
}
/**
* Not used with the core feed but can be used for customizations.
*
* @param $settings
*
* @return string
*
* @since 5.0
*/
public static function get_feed_type_class( $settings ) {
return 'sby_feed_type_' . esc_attr( $settings['type'] );
}
/**
* Boxed style headers have more color options - primary color
*
* @param $settings
*
* @return string
*
* @since 5.0
*/
public static function get_boxed_header_styles( $settings ) {
if ( ! empty( $settings['headerprimarycolor'] ) ) {
return 'style="background: rgb(' . esc_attr( sby_hextorgb( $settings['headerprimarycolor'] ) ). ');"';
}
return '';
}
/**
* Boxed style headers have more color options - secondary color
*
* @param $settings
*
* @return string
*
* @since 5.0
*/
public static function get_header_bar_styles( $settings ) {
if ( ! empty( $settings['headersecondarycolor'] ) ) {
return 'style="background: rgb(' . esc_attr( sby_hextorgb( $settings['headersecondarycolor'] ) ). ');"';
}
return '';
}
/**
* For text, likes counts, post counts
*
* @param $settings
*
* @return string
*
* @since 5.0
*/
public static function get_header_info_styles( $settings ) {
if ( ! empty( $settings['headerprimarycolor'] ) ) {
return 'style="color: rgb(' . esc_attr( sby_hextorgb( $settings['headerprimarycolor'] ) ). ');"';
}
return '';
}
/**
* Layout for mobile feeds altered with the class added here based on settings.
*
* @param $settings
*
* @return string
*
* @since 5.0
*/
public static function get_mobilecols_class( $settings ) {
$disable_mobile = $settings['disablemobile'];
( $disable_mobile == 'on' || $disable_mobile == 'true' || $disable_mobile == true ) ? $disable_mobile = true : $disable_mobile = false;
if( $settings[ 'disablemobile' ] === 'false' ) $disable_mobile = '';
if ( $disable_mobile !== ' sby_disable_mobile' && $settings['colsmobile'] !== 'same' ) {
$colsmobile = (int)( $settings['colsmobile'] ) > 0 ? (int)$settings['colsmobile'] : 'auto';
return ' sby_mob_col_' . $colsmobile;
} else {
$colsmobile = (int)( $settings['cols'] ) > 0 ? (int)$settings['cols'] : 4;
return ' sby_disable_mobile sby_mob_col_' . (int)$settings['cols'];
}
}
public static function get_list_type_subscribe_bar_attr( $settings ) {
$customizer = sby_doing_customizer( $settings );
if ( ! $customizer ) {
return;
}
return self::create_condition_show_vue( $customizer, '$parent.valueIsEnabled($parent.customizerFeedData.settings.layout == \'list\' && $parent.customizerFeedData.settings.enablesubscriberlink)');
}
/**
* Comment data attributes
*
* @param array $settings
*
* @return string
*
* @since 2.3.3
*/
public static function get_comment_data_attributes( $settings ) {
if ( ! sby_doing_customizer( $settings ) ) {
return '';
}
return ' ' . self::display_vue_condition( 'enablecomments' );
}
}