PluginProbe
WP Directory Kit / 1.2.6
WP Directory Kit v1.2.6
1.5.6 1.5.5 1.5.4 1.5.3 trunk 1.1.0 1.1.6 1.1.8 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.8 1.4.0 1.4.1 All 35 releases
wpdirectorykit / actions.php

actions.php in WP Directory Kit 1.2.6, at actions.php

89 lines 3.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit; // Exit if accessed directly.
5 }
6
7 require_once WPDIRECTORYKIT_PATH . 'extensions/wdk-dependfields.php';
8 new \Wdk\Extensions\WdkDependfields();
9
10
11 if(file_exists(WPDIRECTORYKIT_PATH . 'extensions/wdk-cached-users.php')) {
12 require_once WPDIRECTORYKIT_PATH . 'extensions/wdk-cached-users.php';
13 new \Wdk\Extensions\WdkCachedUsers();
14 }
15
16 /* remove wdk data on remove user */
17 add_action('delete_user', function($user_id ){
18 if(!empty($user_id)) {
19 global $Winter_MVC_WDK;
20 $Winter_MVC_WDK->model('user_m');
21 $Winter_MVC_WDK->user_m->remove_user_data(intval($user_id));
22 }
23 });
24
25 /* home, results page, dash/login, menu for hamburger */
26 add_action('wp_footer', function(){
27 if(wdk_get_option('wdk_mobile_bottom_navbar_enable')) {
28 wp_enqueue_style( 'dashicons' );
29 ?>
30 <div class="wdk_mobile_footer_menu">
31 <a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr__('Home','nexproperty' ); ?>"><span class="dashicons dashicons-admin-home"></span></a>
32 <?php if(wdk_get_option('wdk_results_page')):?>
33 <a href="<?php echo esc_url(get_permalink(wdk_get_option('wdk_results_page'))); ?>" title="<?php echo esc_attr__('Search','nexproperty' ); ?>"><span class="dashicons dashicons-search"></span></a>
34 <?php endif;?>
35 <?php if (!is_user_logged_in()): ?>
36 <a href="<?php echo (get_option('wdk_membership_login_page')) ? esc_url(get_permalink(wdk_get_option('wdk_membership_login_page'))) : esc_url(wp_login_url());?>" class="sign_in sign-btn"><i class="fas fa-user" aria-hidden="true"></i></a>
37 <?php else:?>
38 <?php
39 $dash_url = get_admin_url() . "admin.php?page=wdk";
40 if(function_exists('wdk_dash_url') && get_option('wdk_membership_dash_page') && wdk_dash_url()){
41 $dash_url = wdk_dash_url();
42 }
43 ?>
44 <a href="<?php echo esc_url($dash_url);?>" class="sign_in dash-btn" title="<?php echo esc_attr__('Dash','nexproperty' ); ?>" class="wdk-element-button logout">
45 <i aria-hidden="true" class="fas fa-tachometer-alt"></i>
46 </a>
47 <a href="<?php echo esc_url(wp_logout_url( get_permalink() )); ?>" class="sign_in sign-btn" title="<?php echo esc_attr__('Log Out','nexproperty' ); ?>"><i class="fas fa-user-times" aria-hidden="true"></i></a>
48 <?php endif;?>
49
50 <div class="wdk-footer-menu">
51 <?php
52 $menus = wp_get_nav_menus();
53
54 $available_menus = [];
55 foreach ($menus as $menu) {
56 $available_menus[$menu->slug] = $menu->name;
57 }
58
59 ?>
60
61 <input id="wdk_mobile_footer_menu_gumb" type="checkbox" class="wdk_mobile_footer_menu_gumb">
62
63 <?php if(!empty($available_menus)):?>
64 <label for="wdk_mobile_footer_menu_gumb" class="wdk_mobile_footer_menu_gumb-open">
65 <span class="dashicons dashicons-menu"></span>
66 </label>
67 <?php endif;?>
68
69 <div class="menu__box">
70 <?php echo wp_nav_menu( array(
71 'menu' => array_keys($available_menus)[0],
72 'menu_class' => 'wl-nav-menu wl-nav-menu',
73 'menu_id' => 'menu-' . array_keys($available_menus)[0] . '-wdk-bottom-menu',
74 'fallback_cb' => '__return_empty_string',
75 ));?>
76 </div>
77 </div>
78 </div>
79 <?php
80 }
81 });
82
83 add_filter( 'intermediate_image_sizes_advanced', function( $sizes ){
84 if(get_option('wdk_install_images_sizes_disable') == 1) {
85 return array();
86 }
87 return $sizes;
88 } );
89 ?>