File tree Expand file tree Collapse file tree 5 files changed +17
-19
lines changed Expand file tree Collapse file tree 5 files changed +17
-19
lines changed Original file line number Diff line number Diff line change 21
21
define ( 'WBITLY_BASENAME ' , plugin_basename ( __FILE__ ) );
22
22
define ( 'WBITLY_SETTINGS_URL ' , admin_url ( 'tools.php?page=wbitly ' ) );
23
23
24
- // https://raventools.com/marketing-reports/google-analytics/url-builder/?utm_source=Social%20Network&utm_medium=link&utm_campaign=Bitly&utm_term=Term&utm_content=Content
25
-
26
-
27
-
28
24
29
25
/**
30
26
* Load Admin Assets
63
59
*/
64
60
65
61
66
- require_once 'inc/wbitly-wp-functions.php ' ;
62
+ require_once 'inc/wbitly-wp-functions.php ' ;
63
+
64
+
Original file line number Diff line number Diff line change 6
6
* @Last Modified by: Codehaveli
7
7
* @Website: www.codehaveli.com
8
8
* @Email: hello@codehaveli.com
9
- * @Last Modified time: 2020-06-30 19:03:04
9
+ * @Last Modified time: 2020-08-27 13:44:51
10
10
*/
11
11
12
12
@@ -22,7 +22,7 @@ function wbitly_generate_shorten_url($permalink){
22
22
if ( ! class_exists ( 'WbitlyURLSettings ' ) ) {
23
23
return ;
24
24
}
25
- global $ wbitly_settings ;
25
+ $ wbitly_settings = new WbitlyURLSettings () ;
26
26
27
27
$ permalink = apply_filters ( 'wbitly_url_before_process ' , $ permalink );
28
28
$ access_token = $ wbitly_settings ->get_wbitly_access_token ();
@@ -122,7 +122,7 @@ function wbitly_shorten_url ($permalink) {
122
122
123
123
124
124
125
- global $ wbitly_settings ;
125
+ $ wbitly_settings = new WbitlyURLSettings () ;
126
126
127
127
$ access_token = $ wbitly_settings ->get_wbitly_access_token ();
128
128
$ guid = $ wbitly_settings ->get_wbitly_guid ();
Original file line number Diff line number Diff line change 6
6
* @Last Modified by: Codehaveli
7
7
* @Website: www.codehaveli.com
8
8
* @Email: hello@codehaveli.com
9
- * @Last Modified time: 2020-08-20 09:27:42
9
+ * @Last Modified time: 2020-08-27 13:51:35
10
10
*/
11
11
12
12
13
13
14
14
class WbitlyURLSettings {
15
+
15
16
private $ bitly_url_options ;
16
17
17
18
public function __construct () {
@@ -358,7 +359,7 @@ public function add_wbitly_social_share_button() {
358
359
359
360
$ wbitly_social_share = '' ;
360
361
361
- if ($ this ->bitly_url_options ['wbitly_socal_share ' ]){
362
+ if (isset ( $ this ->bitly_url_options ['wbitly_socal_share ' ]) ){
362
363
$ wbitly_social_share = $ this ->bitly_url_options ['wbitly_socal_share ' ] == "enable " ? "checked " : '' ;
363
364
}
364
365
@@ -416,18 +417,15 @@ public function get_wbitly_socal_share_status(){
416
417
return $ wbitly_socal_share === "enable " ? true : false ;
417
418
}
418
419
420
+ }
419
421
420
422
421
423
424
+ $ wbitly_settings = new WbitlyURLSettings ();
422
425
423
426
424
427
425
428
426
- }
427
- if ( is_admin () )
428
- $ wbitly_settings = new WbitlyURLSettings ();
429
-
430
-
431
429
432
430
433
431
Original file line number Diff line number Diff line change 6
6
* @Last Modified by: Codehaveli
7
7
* @Website: www.codehaveli.com
8
8
* @Email: hello@codehaveli.com
9
- * @Last Modified time: 2020-06-29 17:26:28
9
+ * @Last Modified time: 2020-08-27 13:36:38
10
10
*/
11
11
12
12
@@ -50,8 +50,8 @@ function wbitly_remove_http($url) {
50
50
51
51
function get_wbitly_headers (){
52
52
53
- $ bitly_settings = new WbitlyURLSettings ();
54
- $ access_token = $ bitly_settings ->get_wbitly_access_token ();
53
+ $ wbitly_settings = new WbitlyURLSettings ();
54
+ $ access_token = $ wbitly_settings ->get_wbitly_access_token ();
55
55
56
56
$ headers = array (
57
57
"Host " => "api-ssl.bitly.com " ,
Original file line number Diff line number Diff line change 1
1
<?php
2
2
3
- $ bitly_url = get_wbitly_short_url ($ post_id );
3
+ global $ post_id ;
4
+
5
+ $ bitly_url = get_wbitly_short_url ($ post_id );
4
6
5
7
?>
6
8
You can’t perform that action at this time.
0 commit comments