PluginProbe
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings / 5.8.6
MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings v5.8.6
7.2.1 7.2 7.1.2 7.1.1 7.1 7.0.4 7.0.6 7.0.7 6.3.8 6.3.7 6.3.6 6.3.5 6.3.4 6.3.3 6.3.1 trunk 5.7.3 5.7.5 5.8.1 5.8.2 5.8.3 5.8.4 5.8.6 6.0.4 6.0.5 All 36 releases
mlsimport / public / class-mlsimport-public.php

class-mlsimport-public.php in MLSImport: IDX Plugin & MLS Plugin for Real Estate Listings 5.8.6, at public/class-mlsimport-public.php

102 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 if ( ! defined( 'ABSPATH' ) ) {
3 exit; // Exit if accessed directly
4 }
5
6 /**
7 *
8 *
9 * @link http://mlsimport.com/
10 * @since 1.0.0
11 *
12 * @package Mlsimport
13 * @subpackage Mlsimport/public
14 */
15
16 /**
17 * @package Mlsimport
18 * @subpackage Mlsimport/public
19 * @author MlsImport <office@mlsimport.com>
20 */
21 class Mlsimport_Public {
22
23 /**
24 * The ID of this plugin.
25 *
26 * @since 1.0.0
27 * @access private
28 * @var string $plugin_name The ID of this plugin.
29 */
30 private $plugin_name;
31
32 /**
33 * The version of this plugin.
34 *
35 * @since 1.0.0
36 * @access private
37 * @var string $version The current version of this plugin.
38 */
39 private $version;
40
41 /**
42 * Initialize the class and set its properties.
43 *
44 * @since 1.0.0
45 * @param string $plugin_name The name of the plugin.
46 * @param string $version The version of this plugin.
47 */
48 public function __construct( $plugin_name, $version ) {
49
50 $this->plugin_name = $plugin_name;
51 $this->version = $version;
52 }
53
54 /**
55 * Register the stylesheets for the public-facing side of the site.
56 *
57 * @since 1.0.0
58 */
59 public function enqueue_styles() {
60 global $mlsimport;
61 $theme_enviroment = $mlsimport->get_plugin_data( 'theme_enviroment' );
62 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/mlsimport-public.css', array(), $this->version, 'all' );
63
64 if ( isset( $options['enviroment'] ) ) {
65 wp_enqueue_style( $this->plugin_name . strtolower( $theme_enviroment ), plugin_dir_url( __FILE__ ) . 'css/mlsimport-public-' . strtolower( $theme_enviroment ) . '.css', array(), $this->version, 'all' );
66 }
67 }
68
69 /**
70 * Register the JavaScript for the public-facing side of the site.
71 *
72 * @since 1.0.0
73 */
74 public function enqueue_scripts() {
75 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/mlsimport-public.js', array( 'jquery' ), $this->version, false );
76 }
77
78
79 /**
80 * ReWrite Image url
81 *
82 * @since 1.0.0
83 */
84 /**
85 * ReWrite Image url
86 *
87 * @since 1.0.0
88 */
89 public function mlsimport_wp_get_attachment_url( $url, $post_id ) {
90
91
92 if( intval(get_post_meta($post_id,'is_mlsimport',true)) === 1){
93
94 $explode = explode('/wp-content/uploads/', $url);
95 return $explode[1];
96
97 }
98
99 return $url;
100 }
101 }
102