'bi '.$match[1], 'label' => $match[1]);
}
//Flaticon
$et_matches = get_et_icons();
foreach($et_matches as $match)
{
$icons[] = array('value' => 'icon '.$match[1], 'label' => $match[1]);
}
$icons = array_column($icons, 'label', 'value');
//print_r($icons); exit('hellow');
return $icons;
}
//Icomoon Icons
function get_et_icons()
{
$pattern = '/\.(icon-(?:\w+(?:-)?)+):before\s*{\s*content/';
$subject = file_get_contents(get_template_directory() . '/assets/vendors/thm-icons/style.css');
preg_match_all($pattern, $subject, $matches, PREG_SET_ORDER);
return $matches;
}
//get blog categories
function get_blog_categories() {
$options = array();
$taxonomy = 'category';
if (!empty($taxonomy)) {
$terms = get_terms(
array(
'parent' => 0,
'taxonomy' => $taxonomy,
'hide_empty' => false,
)
);
if (!empty($terms)) {
foreach ($terms as $term) {
if (isset($term)) {
$options[''] = 'Select';
if (isset($term->slug) && isset($term->name)) {
$options[$term->slug] = $term->name;
}
}
}
}
}
return $options;
}
//get Project categories
function get_project_categories() {
$options = array();
$taxonomy = 'project_cat';
if (!empty($taxonomy)) {
$terms = get_terms(
array(
'parent' => 0,
'taxonomy' => $taxonomy,
'hide_empty' => false,
)
);
if (!empty($terms)) {
foreach ($terms as $term) {
if (isset($term)) {
$options[''] = 'Select';
if (isset($term->slug) && isset($term->name)) {
$options[$term->slug] = $term->name;
}
}
}
}
}
return $options;
}
//get Testimonials categories
function get_testimonials_categories() {
$options = array();
$taxonomy = 'testimonials_cat';
if (!empty($taxonomy)) {
$terms = get_terms(
array(
'parent' => 0,
'taxonomy' => $taxonomy,
'hide_empty' => false,
)
);
if (!empty($terms)) {
foreach ($terms as $term) {
if (isset($term)) {
$options[''] = 'Select';
if (isset($term->slug) && isset($term->name)) {
$options[$term->slug] = $term->name;
}
}
}
}
}
return $options;
}
//get Product categories
function get_product_categories() {
$options = array();
$taxonomy = 'product_cat';
if (!empty($taxonomy)) {
$terms = get_terms(
array(
'parent' => 0,
'taxonomy' => $taxonomy,
'hide_empty' => false,
)
);
if (!empty($terms)) {
foreach ($terms as $term) {
if (isset($term)) {
$options[''] = 'Select';
if (isset($term->slug) && isset($term->name)) {
$options[$term->slug] = $term->name;
}
}
}
}
}
return $options;
}
//get Team categories
function get_team_categories() {
$options = array();
$taxonomy = 'team_cat';
if (!empty($taxonomy)) {
$terms = get_terms(
array(
'parent' => 0,
'taxonomy' => $taxonomy,
'hide_empty' => false,
)
);
if (!empty($terms)) {
foreach ($terms as $term) {
if (isset($term)) {
$options[''] = 'Select';
if (isset($term->slug) && isset($term->name)) {
$options[$term->slug] = $term->name;
}
}
}
}
}
return $options;
}
function thinkai_the_pagination2($args = array(), $echo = 1)
{
global $wp_query;
$default = array('base' => str_replace( 99999, '%#%', esc_url( get_pagenum_link( 99999 ) ) ), 'format' => '?paged=%#%', 'current' => max( 1, get_query_var('paged') ),
'total' => $wp_query->max_num_pages, 'next_text' => '»', 'prev_text' => '«', 'type'=>'list','add_args' => false);
$args = wp_parse_args($args, $default);
$pagination = str_replace("
'array'),$args)))
{
if($echo) echo wp_kses_post($pagination);
return $pagination;
}
}
function student2_plugin_fonticons() {
return json_decode( student2_filesystem()->get_contents( STUDENT2_PLUGIN_PATH . '/resource/fonticons.json' ), true );
$file = wp_remote_get( get_template_directory_uri() . '/assets/css/bootstrap-icons.min.css' );
$pattern = '/\.(fa-(?:\w+(?:-)?)+):before\s+{\s*content:\s*"(.+)";\s+}/';
preg_match_all( $pattern, wp_remote_retrieve_body( $file ), $matches );
$icons = array_combine( $matches[1], $matches[1] );
file_put_contents( STUDENT2_PLUGIN_PATH . '/resource/fonticons.json', json_encode( $icons ) );
return $icons;
}
function student2_filesystem() {
require_once ABSPATH . '/wp-admin/includes/file.php';
/* you can safely run request_filesystem_credentials() without any issues and don't need to worry about passing in a URL */
$creds = request_filesystem_credentials( site_url() . '/wp-admin/', '', false, false, array() );
/* initialize the API */
if ( ! WP_Filesystem( $creds ) ) {
/* any problems and we exit */
return false;
}
global $wp_filesystem;
/* do our file manipulations below */
return $wp_filesystem;
}
add_filter('thinkai_redux_custom_fonts_load', 'thinkai_redux_custom_fonts_load');
function thinkai_redux_custom_fonts_load( $custom_font ) {
$custom_style = '';
$pathinfo = pathinfo( $custom_font );
if ( $filename = thinkai_set( $pathinfo, 'filename' ) ) {
$custom_style .= '@font-face{
font-family:"' . $filename . '";';
$extensions = array( 'eot', 'woff', 'woff2', 'ttf', 'svg' );
$count = 0;
foreach ( $extensions as $extension ) {
$file_path = esc_url(home_url('/')) . '/wp-content/themes/thinkai/assets/css/custom-fonts/' . $filename . '.' . $extension;
$file_url = esc_url(get_template_directory_uri()) . '/assets/css/custom-fonts/' . $filename . '.' . $extension;
if ( $file_path ) {
$format = $extension;
if ( $extension === 'eot' ) {
$format = 'embedded-opentype';
}
if ( $extension === 'ttf' ) {
$format = 'truetype';
}
$terminated = ( $count > 0 ) ? ';' : '';
$custom_style .= $terminated . 'src:url("' . $file_url . '") format("' . $format . '")';
$count ++;
}
}
$custom_style .= ';}';
}
return $custom_style;
}
/**
* [thinkai_social_share_output description]
*
* @param [type] $comment [description].
* @param [type] $args [description].
* @param [type] $depth [description].
*
* @return void [description]
*/
function thinkai_social_share_output( $icon, $color = false ) {
$permalink = get_permalink( get_the_ID() );
$titleget = get_the_title();
$allowed_html = wp_kses_allowed_html( 'post' );
if ( $icon == 'facebook' ) {
$fb = ( $color == 1 ) ? 'style="color:#3b5998"' : '';
?>
-
>
-
', 'Twitter share', 'width=600,height=300,left=' + (screen.availWidth / 2 - 300) + ',top=' + (screen.availHeight / 2 - 150) + '');
return false;" href="http://twitter.com/share?url=&text=">
-
>
-
', 'Reddit', 'width=617,height=514,left=' + (screen.availWidth / 2 - 308) + ',top=' + (screen.availHeight / 2 - 257) + '');
return false;" href="http://reddit.com/submit?url=&title=">
>
-
>
-
>
-
', 'Stumbleupon', 'width=600,height=300,left=' + (screen.availWidth / 2 - 300) + ',top=' + (screen.availHeight / 2 - 150) + '');
return false;" href="http://www.stumbleupon.com/submit?url=&title=">
>
-
', 'Tumblr', 'width=600,height=300,left=' + (screen.availWidth / 2 - 300) + ',top=' + (screen.availHeight / 2 - 150) + '');
return false;" href="http://www.tumblr.com/share/link?url=&name=">
>
-
&Body=">>
'."\n";
$count++;
}
}
return $output;
}
add_action('thinkai_social_share_output_two', 'thinkai_social_share_output_two');
function bunch_share_us_two($PostID = '', $PostName = '')
{
$options = thinkai_WSH()->option();
?>
get( 'facebook_sharing' )):?>
get( 'twitter_sharing' )):?>
get( 'linkedin_sharing' )):?>
get( 'pinterest_sharing' )):?>
get( 'reddit_sharing' )):?>
get( 'tumblr_sharing' )):?>
get( 'digg_sharing' )):?>
option();
$icons = $options->get( 'social_media_tabs_v3' );
if ( $icons ) : ?>
- ">
option();
$icons = $options->get( 'social_media_tabs_v3' );
if ( $icons ) : ?>
-
first">
second">
option();
$icons = $options->get( 'social_media_tabs_v3' );
if ( $icons ) : ?>
- ">
'page',
'numberposts' => -1,
) );
$posts = get_posts( $args );
$post_options = array( esc_html__( '-- Select Page --', 'thinkai' ) => '' );
if ( $posts ) {
foreach ( $posts as $post ) {
$post_options[$post->ID] = $post->post_title;
}
}
return $post_options;
}