'addons-for-divi' ), admin_url( 'admin.php' ) ); } function ba_get_svg_user_icon() { return ' '; } function ba_get_svg_clock_icon() { return ' '; } function ba_get_img_masking_shapes( $shape ) { $masking_shapes = array( 'none' => '', 'shape_1' => '', 'shape_2' => '', 'shape_3' => '', ); return $masking_shapes[ $shape ]; } function brainaddons_login_page() { $options = get_option( 'brainaddons_settings', array() ); $page = array_key_exists( 'login_page', $options ) ? get_post( $options['login_page'] ) : false; return $page; } function ba_get_post_types() { $post_types = get_post_types( array( 'public' => true, ), 'objects' ); $options = array(); foreach ( $post_types as $post_type ) { $options[ $post_type->name ] = $post_type->label; } // Deprecated 'Media' post type. $key = array_search( 'Media', $options, true ); if ( 'attachment' === $key ) { unset( $options[ $key ] ); } return apply_filters( 'uael_loop_post_types', $options ); } function ba_get_taxonomies() { $taxonomies = get_taxonomies( array( 'show_in_nav_menus' => true ), 'objects' ); $options = array( '' => '' ); foreach ( $taxonomies as $taxonomy ) { $options[ $taxonomy->name ] = $taxonomy->label; } return $options; } function ba_get_date_link( $post_id = null ) { if ( empty( $post_id ) ) { $post_id = get_the_ID(); } $year = get_the_date( 'Y', $post_id ); $month = get_the_time( 'm', $post_id ); $day = get_the_time( 'd', $post_id ); $url = get_day_link( $year, $month, $day ); return $url; } function ba_get_excerpt( $post_id = null, $length = null ) { if ( empty( $length ) ) { $length = 35; } return wpautop( strip_shortcodes( truncate_post( $length, false, '', true ) ) ); } function ba_prev_arrow_icon() { return ''; } function ba_next_arrow_icon() { return ''; } function ba_related_posts_args( $post_id ) { $categories = get_the_terms( $post_id, 'category' ); if ( empty( $categories ) || is_wp_error( $categories ) ) { $categories = array(); } $category_list = wp_list_pluck( $categories, 'term_id' ); $related_args = array( 'post_type' => 'post', 'posts_per_page' => 6, 'no_found_rows' => true, 'post_status' => 'publish', 'post__not_in' => array( $post_id ), 'orderby' => 'rand', 'category__in' => $category_list, ); return $related_args; } function dt_if_not_migrated() { $not_migrated = get_option( 'ba_version' ); if ( $not_migrated ) { return true; } return false; } function dt_backend_helpers( $helpers ) { $helpers['ifMigrated'] = dt_if_not_migrated() ? 'false' : 'true'; return $helpers; } add_filter( 'et_fb_backend_helpers', 'dt_backend_helpers' ); function dtq_global_assets_list( $global_list ) { $assets_list = array(); $assets_prefix = et_get_dynamic_assets_path(); $assets_list['et_icons_fa'] = array( 'css' => "{$assets_prefix}/css/icons_fa_all.css", ); return array_merge( $global_list, $assets_list ); } function dtq_inject_fa_icons( $icon_data ) { if ( function_exists( 'et_pb_maybe_fa_font_icon' ) && et_pb_maybe_fa_font_icon( $icon_data ) ) { add_filter( 'et_global_assets_list', 'dtq_global_assets_list' ); add_filter( 'et_late_global_assets_list', 'dtq_global_assets_list' ); } }