-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrentfetch.php
76 lines (67 loc) · 2.27 KB
/
rentfetch.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/**
Plugin Name: Rent Fetch
Plugin URI: http://wordpress.org/plugins/rentfetch/
Description: Displays searchable rental properties, floorplans, and unit availability.
Version: 0.18.7
Author: Brindle Digital
Author URI: https://www.brindledigital.com
Text Domain: rentfetch
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
*
@package rentfetch
*/
// Prevent direct access to the plugin.
if ( ! defined( 'ABSPATH' ) ) {
die( 'Sorry, you are not allowed to access this page directly.' );
}
// Define the version of the plugin.
define( 'RENTFETCH_VERSION', '0.18.7' );
// Set up plugin directories.
define( 'RENTFETCH_DIR', plugin_dir_path( __FILE__ ) );
define( 'RENTFETCH_PATH', plugin_dir_url( __FILE__ ) );
define( 'RENTFETCH_BASENAME', plugin_basename( __FILE__ ) );
define( 'RENTFETCH_FILE', __FILE__ );
/**
* Load the files
*
* @param string $directory the path to the directory to load.
* @return void
*/
function rentfetch_require_files_recursive( $directory ) {
$iterator = new RecursiveIteratorIterator(
new RecursiveDirectoryIterator( $directory, RecursiveDirectoryIterator::SKIP_DOTS ),
RecursiveIteratorIterator::LEAVES_ONLY
);
foreach ( $iterator as $file ) {
if ( $file->isFile() && $file->getExtension() === 'php' ) {
require_once $file->getPathname();
}
}
}
// Require_once all files in /lib and its subdirectories.
rentfetch_require_files_recursive( RENTFETCH_DIR . 'lib' );
/**
* Flush the permalinks after plugin is activated.
*
* @return void
*/
function rentfetch_flush_permalinks_on_activation() {
add_action( 'init', 'flush_rewrite_rules', 999 );
}
register_activation_hook( RENTFETCH_BASENAME, 'rentfetch_flush_permalinks_on_activation' );
/**
* Admin footer text override
*
* @param string $data the data to override.
*
* @return string
*/
function rentfetch_override_admin_footer( $data ) {
$data = '<div id="rentfetch-footer" role="contentinfo">';
$data .= '<span>Made with 🤍 by <a href="https://brindledigital.com/" target="_blank">Brindle</a></span>';
$data .= '<span><a href="https://rentfetch.io" target="_blank">Website</a> / <a href="https://rentfetch.io/get-started/" target="_blank">Support</a></span>';
$data .= '</div>';
return $data;
}