This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
/
image-hashtag-feed.php
81 lines (65 loc) · 2.89 KB
/
image-hashtag-feed.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
77
78
79
80
81
<?php
/**
*
* Plugin Name: Image hashtag feed
* Plugin URI: https://github.com/digitoimistodude/image-hashtag-feed
* Description: Get Instagram hashtag feeds working again by bypassing the API.
* Version: 2.1.2
* Author: Digitoimisto Dude Oy, Timi Wahalahti
* Author URI: https://www.dude.fi
* GitHub Plugin URI: digitoimistodude/image-hashtag-feed
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: dude-img-hashfeed
* Domain Path: /languages
*/
if( !defined( 'ABSPATH' ) )
exit();
Class Dude_Img_Hashfeed {
private static $_instance = null;
protected $plugin_path;
public function __construct() {
$this->plugin_path = plugin_dir_path( __FILE__ );
add_action( 'init', array( $this, 'load_depencies' ) );
add_action( 'init', array( $this, 'load_plugin_textdomain' ) );
add_action( 'init', array( 'Dude_Img_Hashfeed_Admin_Settings_Page', 'instance' ) );
add_action( 'init', array( 'Dude_Img_Hashfeed_Fetch_Instagram', 'instance' ) );
} // end function __construct
public function __clone () {
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'dude-img-hashfeed' ) );
} // end function __clone
public function __wakeup() {
_doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?', 'dude-img-hashfeed' ) );
} // end function __wakeup
public static function instance() {
if( is_null( self::$_instance ) ) {
self::$_instance = new self();
}
return self::$_instance;
} // end function instance
public function load_plugin_textdomain() {
load_plugin_textdomain( 'dude-img-hashfeed', false, $this->plugin_path.'/languages/' );
} // end function load_plugin_textdomain
public function load_depencies() {
require_once( $this->plugin_path.'/libraries/simple-admin-pages/simple-admin-pages.php' );
require_once( $this->plugin_path.'/includes/admin/settings-page.php' );
require_once( $this->plugin_path.'/includes/fetch-instagram.php' );
require_once( $this->plugin_path.'/includes/get-from-cache.php' );
} // end function load_depencies
} // end class Dude_Img_Hashfeed
$plugin = new Dude_Img_Hashfeed();
if( !function_exists( 'get_the_dude_img_hashfeed_raw' ) ) {
function get_the_dude_img_hashfeed_raw( $hashtag = null ) {
return Dude_Img_Hashfeed_Get_From_Cache::get_raw( $hashtag );
} // end function dude_img_hashfeed_get_raw
}
if( !function_exists( 'get_the_dude_img_hashfeed_thumbnails' ) ) {
function get_the_dude_img_hashfeed_thumbnails( $hashtag = null ) {
return Dude_Img_Hashfeed_Get_From_Cache::get_thumbnails( $hashtag );
} // end function dude_img_hashfeed_thumbnails
}
if( !function_exists( 'the_dude_img_hashfeed_thumbnails' ) ) {
function the_dude_img_hashfeed_thumbnails( $hashtag = null ) {
echo Dude_Img_Hashfeed_Get_From_Cache::get_thumbnails( $hashtag );
} // end function dude_img_hashfeed_thumbnails
}