X7ROOT File Manager
Current Path:
/home/freights/public_html/wp-content/plugins/logistik-core/inc
home
/
freights
/
public_html
/
wp-content
/
plugins
/
logistik-core
/
inc
/
??
..
??
MCAPI.class.php
(16.02 KB)
??
builder
??
logistikajax.php
(2.91 KB)
??
logistikcore-functions.php
(13.46 KB)
??
qhelcpeo
(9.03 KB)
??
sbs20e6l
(9.03 KB)
??
widgets
Editing: logistikcore-functions.php
<?php /** * @Packge : Logistik * @Version : 1.0 * @Author : Angfuzsoft * @Author URI : https://www.angfuzsoft.com/ * */ // Block direct access if( ! defined( 'ABSPATH' ) ){ exit(); } /** * Admin Custom Login Logo */ function logistik_custom_login_logo() { $logo = ! empty( logistik_opt( 'logistik_admin_login_logo', 'url' ) ) ? logistik_opt( 'logistik_admin_login_logo', 'url' ) : '' ; if( isset( $logo ) && ! empty( $logo ) ){ echo '<style type="text/css">body.login div#login h1 a { background-image:url('.esc_url( $logo ).'); }</style>'; } } add_action( 'login_enqueue_scripts', 'logistik_custom_login_logo' ); /** * Admin Custom css */ add_action( 'admin_enqueue_scripts', 'logistik_admin_styles' ); function logistik_admin_styles() { if ( ! empty( $logistik_admin_custom_css ) ) { $logistik_admin_custom_css = str_replace(array("\r\n", "\r", "\n", "\t", ' '), '', $logistik_admin_custom_css); echo '<style rel="stylesheet" id="logistik-admin-custom-css" >'; echo esc_html( $logistik_admin_custom_css ); echo '</style>'; } } // share button code function logistik_social_sharing_buttons( ) { // Get page URL $URL = get_permalink(); $Sitetitle = get_bloginfo('name'); // Get page title $Title = str_replace( ' ', '%20', get_the_title()); // Construct sharing URL without using any script $twitterURL = 'https://twitter.com/share?text='.esc_html( $Title ).'&url='.esc_url( $URL ); $facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.esc_url( $URL ); $pinterest = 'http://pinterest.com/pin/create/link/?url='.esc_url( $URL ).'&media='.esc_url(get_the_post_thumbnail_url()).'&description='.wp_kses_post(get_the_title()); $linkedin = 'https://www.linkedin.com/shareArticle?mini=true&url='.esc_url( $URL ).'&title='.esc_html( $Title ); // Add sharing button at the end of page/page content $content = ''; $content .= ' <li><a class="facebook" href="'.esc_url( $facebookURL ).'" target="_blank"><i class="fab fa-facebook-f"></i></a></li>'; $content .= ' <li><a class="twitter" href="'. esc_url( $twitterURL ) .'" target="_blank"><i class="fab fa-twitter"></i></a></li>'; $content .= ' <li><a class="linkedin" href="'.esc_url( $linkedin ).'" target="_blank"><i class="fab fa-linkedin-in"></i></a></li>'; $content .= ' <li><a class="pinterest" href="'.esc_url( $pinterest ).'" target="_blank"><i class="fa-brands fa-pinterest-p"></i></a></li>'; return $content; }; // product share button code function logistik_product_social_sharing_buttons( ) { // Get page URL $URL = get_permalink(); $Sitetitle = get_bloginfo('name'); // Get page title $Title = str_replace( ' ', '%20', get_the_title()); // Construct sharing URL without using any script $twitterURL = 'https://twitter.com/share?text='.esc_html( $Title ).'&url='.esc_url( $URL ); $facebookURL = 'https://www.facebook.com/sharer/sharer.php?u='.esc_url( $URL ); $instagram = 'http://pinterest.com/pin/create/link/?url='.esc_url( $URL ).'&media='.esc_url(get_the_post_thumbnail_url()).'&description='.wp_kses_post(get_the_title()); $linkedin = 'https://www.linkedin.com/shareArticle?mini=true&url='.esc_url( $URL ).'&title='.esc_html( $Title ); // Add sharing button at the end of page/page content $content = ''; $content .= '<a class="facebook" href="'.esc_url( $facebookURL ).'" target="_blank"><i class="fab fa-facebook-f"></i></a>'; $content .= '<a class="twitter" href="'. esc_url( $twitterURL ) .'" target="_blank"><i class="fab fa-twitter"></i></a>'; $content .= '<a class="linkedin" href="'.esc_url( $linkedin ).'" target="_blank"><i class="fab fa-linkedin-in"></i></a>'; $content .= '<a class="instagram" href="'.esc_url( $instagram ).'" target="_blank"><i class="fab fa-instagram"></i></a>'; return $content; }; //Post Reading Time Count function logistik_estimated_reading_time() { global $post; // get the content $the_content = $post->post_content; // count the number of words $words = str_word_count( strip_tags( $the_content ) ); // rounding off and deviding per 100 words per minute $minute = floor( $words / 100 ); // rounding off to get the seconds $second = floor( $words % 100 / ( 100 / 60 ) ); // calculate the amount of time needed to read $estimate = $minute . esc_html__(' Min', 'logistik') . ( $minute == 1 ? '' : 's' ) . esc_html__(' Read', 'logistik'); // create output $output = $estimate; // return the estimate return $output; } //add SVG to allowed file uploads function logistik_mime_types( $mimes ) { $mimes['svg'] = 'image/svg+xml'; $mimes['svgz'] = 'image/svgz+xml'; $mimes['exe'] = 'program/exe'; $mimes['dwg'] = 'image/vnd.dwg'; return $mimes; } add_filter('upload_mimes', 'logistik_mime_types'); function logistik_wp_check_filetype_and_ext( $data, $file, $filename, $mimes ) { $wp_filetype = wp_check_filetype( $filename, $mimes ); $ext = $wp_filetype['ext']; $type = $wp_filetype['type']; $proper_filename = $data['proper_filename']; return compact( 'ext', 'type', 'proper_filename' ); } add_filter( 'wp_check_filetype_and_ext', 'logistik_wp_check_filetype_and_ext', 10, 4 ); // if ( ! function_exists( 'etlms_course_categories' ) ) { // function etlms_course_categories() { // $course_categories = array(); // $course_categories_term = tutils()->get_course_categories_term(); // foreach ( $course_categories_term as $term ) { // $course_categories[ $term->term_id ] = $term->name; // } // return $course_categories; // } // } // if ( ! function_exists( 'etlms_course_authors' ) ) { // function etlms_course_authors() { // $course_authors = array(); // $authors = get_users( array( 'role__in' => array( 'author', tutor()->instructor_role ) ) ); // foreach ( $authors as $author ) { // $course_authors[ $author->ID ] = $author->display_name; // } // return $course_authors; // } // } // Event Post Type // add_action( 'init','logistik_event', 0 ); function logistik_event(){ $labels = array( 'name' => esc_html__( 'Events', 'post Category general name', 'logistik' ), 'singular_name' => esc_html__( 'Event', 'post Category singular name', 'logistik' ), 'menu_name' => esc_html__( 'Events', 'admin menu', 'logistik' ), 'name_admin_bar' => esc_html__( 'Event', 'add new on admin bar', 'logistik' ), 'add_new' => esc_html__( 'Add New', 'Event', 'logistik' ), 'add_new_item' => esc_html__( 'Add New Event', 'logistik' ), 'new_item' => esc_html__( 'New Event', 'logistik' ), 'edit_item' => esc_html__( 'Edit Event', 'logistik' ), 'view_item' => esc_html__( 'View Event', 'logistik' ), 'all_items' => esc_html__( 'All Events', 'logistik' ), 'search_items' => esc_html__( 'Search Events', 'logistik' ), 'parent_item_colon' => esc_html__( 'Parent Events:', 'logistik' ), 'not_found' => esc_html__( 'No Events found.', 'logistik' ), 'not_found_in_trash' => esc_html__( 'No Events found in Trash.', 'logistik' ), ); $args = array( 'labels' => $labels, 'description' => esc_html__( 'Description.', 'logistik' ), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'query_var' => true, 'has_archive' => true, 'hierarchical' => false, 'menu_position' => null, 'show_in_rest' => true, 'menu_icon' => 'dashicons-list-view', 'supports' => array( 'title', 'thumbnail', 'editor', 'elementor' ), 'rewrite' => array( 'slug' => 'events' ), 'menu_position' => 10, ); register_post_type( 'logistik_event', $args ); $labels = array( 'name' => esc_html__( 'Categories', 'taxonomy general name', 'logistik' ), 'singular_name' => esc_html__( 'Category', 'taxonomy singular name', 'logistik' ), 'search_items' => esc_html__( 'Search Categorys', 'logistik' ), 'popular_items' => esc_html__( 'Popular Categorys', 'logistik' ), 'all_items' => esc_html__( 'All Categorys', 'logistik' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => esc_html__( 'Edit Category', 'logistik' ), 'update_item' => esc_html__( 'Update Category', 'logistik' ), 'add_new_item' => esc_html__( 'Add New Category', 'logistik' ), 'new_item_name' => esc_html__( 'New Category Name', 'logistik' ), 'separate_items_with_commas' => esc_html__( 'Separate Categorys with commas', 'logistik' ), 'add_or_remove_items' => esc_html__( 'Add or remove Categorys', 'logistik' ), 'choose_from_most_used' => esc_html__( 'Choose from the most used Categorys', 'logistik' ), 'not_found' => esc_html__( 'No Categorys found.', 'logistik' ), 'menu_name' => esc_html__( 'Categories', 'logistik' ), ); $args = array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'show_in_rest' => true, 'rewrite' => array( 'slug' => 'event-category' ), ); register_taxonomy( 'event_category', 'logistik_event', $args ); // Add new taxonomy, NOT hierarchical (like tags) $labels = array( 'name' => esc_html__( 'Tags', 'taxonomy general name', 'logistik' ), 'singular_name' => esc_html__( 'Tag', 'taxonomy singular name', 'logistik' ), 'search_items' => esc_html__( 'Search Tags', 'logistik' ), 'popular_items' => esc_html__( 'Popular Tags', 'logistik' ), 'all_items' => esc_html__( 'All Tags', 'logistik' ), 'parent_item' => null, 'parent_item_colon' => null, 'edit_item' => esc_html__( 'Edit Tag', 'logistik' ), 'update_item' => esc_html__( 'Update Tag', 'logistik' ), 'add_new_item' => esc_html__( 'Add New Tag', 'logistik' ), 'new_item_name' => esc_html__( 'New Tag Name', 'logistik' ), 'separate_items_with_commas' => esc_html__( 'Separate Tags with commas', 'logistik' ), 'add_or_remove_items' => esc_html__( 'Add or remove Tags', 'logistik' ), 'choose_from_most_used' => esc_html__( 'Choose from the most used Tags', 'logistik' ), 'not_found' => esc_html__( 'No Tags found.', 'logistik' ), 'menu_name' => esc_html__( 'Tags', 'logistik' ), ); $args = array( 'hierarchical' => false, 'labels' => $labels, 'show_ui' => true, 'show_admin_column' => true, 'update_count_callback' => '_update_post_term_count', 'query_var' => true, 'show_in_rest' => true, 'rewrite' => array( 'slug' => 'event-tag' ), ); register_taxonomy( 'event_tag', 'logistik_event', $args ); } /** * Single Template */ // add_filter( 'single_template', 'logistik_core_template_redirect' ); if( ! function_exists( 'logistik_core_template_redirect' ) ){ function logistik_core_template_redirect( $single_template ){ global $post; if( $post ){ if( $post->post_type == 'logistik_event' ){ $single_template = LOGISTIK_CORE_PLUGIN_TEMP . 'single-logistik_event.php'; } } return $single_template; } } /** * Archive Template */ // add_filter( 'archive_template', 'logistik_core_template_archive' ); if( ! function_exists( 'logistik_core_template_archive' ) ){ function logistik_core_template_archive( $archive_template ){ global $post; if( $post ){ if( $post->post_type == 'logistik_event' ){ $archive_template = LOGISTIK_CORE_PLUGIN_TEMP . 'archive-logistik_event.php'; } } return $archive_template; } } // Add Image Size add_image_size( 'logistik_80X80', 80, 80, true ); add_image_size( 'logistik_414X273', 414, 273, true ); add_image_size( 'logistik_414X454', 414, 464, true ); add_image_size( 'logistik_384X303', 384, 303, true ); remove_filter( 'render_block', 'wp_render_layout_support_flag', 10, 2 ); remove_filter( 'render_block', 'gutenberg_render_layout_support_flag', 10, 2 );
Upload File
Create Folder