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 2121define ( 'WBITLY_BASENAME ' , plugin_basename ( __FILE__ ) );
2222define ( 'WBITLY_SETTINGS_URL ' , admin_url ( 'tools.php?page=wbitly ' ) );
2323
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-
2824
2925/**
3026 * Load Admin Assets
6359 */
6460
6561
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 66 * @Last Modified by: Codehaveli
77 * @Website: www.codehaveli.com
88 * @Email: hello@codehaveli.com
9- * @Last Modified time: 2020-06-30 19:03:04
9+ * @Last Modified time: 2020-08-27 13:44:51
1010 */
1111
1212
@@ -22,7 +22,7 @@ function wbitly_generate_shorten_url($permalink){
2222 if ( ! class_exists ( 'WbitlyURLSettings ' ) ) {
2323 return ;
2424 }
25- global $ wbitly_settings ;
25+ $ wbitly_settings = new WbitlyURLSettings () ;
2626
2727 $ permalink = apply_filters ( 'wbitly_url_before_process ' , $ permalink );
2828 $ access_token = $ wbitly_settings ->get_wbitly_access_token ();
@@ -122,7 +122,7 @@ function wbitly_shorten_url ($permalink) {
122122
123123
124124
125- global $ wbitly_settings ;
125+ $ wbitly_settings = new WbitlyURLSettings () ;
126126
127127 $ access_token = $ wbitly_settings ->get_wbitly_access_token ();
128128 $ guid = $ wbitly_settings ->get_wbitly_guid ();
Original file line number Diff line number Diff line change 66 * @Last Modified by: Codehaveli
77 * @Website: www.codehaveli.com
88 * @Email: hello@codehaveli.com
9- * @Last Modified time: 2020-08-20 09:27:42
9+ * @Last Modified time: 2020-08-27 13:51:35
1010 */
1111
1212
1313
1414class WbitlyURLSettings {
15+
1516 private $ bitly_url_options ;
1617
1718 public function __construct () {
@@ -358,7 +359,7 @@ public function add_wbitly_social_share_button() {
358359
359360 $ wbitly_social_share = '' ;
360361
361- if ($ this ->bitly_url_options ['wbitly_socal_share ' ]){
362+ if (isset ( $ this ->bitly_url_options ['wbitly_socal_share ' ]) ){
362363 $ wbitly_social_share = $ this ->bitly_url_options ['wbitly_socal_share ' ] == "enable " ? "checked " : '' ;
363364 }
364365
@@ -416,18 +417,15 @@ public function get_wbitly_socal_share_status(){
416417 return $ wbitly_socal_share === "enable " ? true : false ;
417418 }
418419
420+ }
419421
420422
421423
424+ $ wbitly_settings = new WbitlyURLSettings ();
422425
423426
424427
425428
426- }
427- if ( is_admin () )
428- $ wbitly_settings = new WbitlyURLSettings ();
429-
430-
431429
432430
433431
Original file line number Diff line number Diff line change 66 * @Last Modified by: Codehaveli
77 * @Website: www.codehaveli.com
88 * @Email: hello@codehaveli.com
9- * @Last Modified time: 2020-06-29 17:26:28
9+ * @Last Modified time: 2020-08-27 13:36:38
1010 */
1111
1212
@@ -50,8 +50,8 @@ function wbitly_remove_http($url) {
5050
5151function get_wbitly_headers (){
5252
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 ();
5555
5656 $ headers = array (
5757 "Host " => "api-ssl.bitly.com " ,
Original file line number Diff line number Diff line change 11<?php
22
3- $ bitly_url = get_wbitly_short_url ($ post_id );
3+ global $ post_id ;
4+
5+ $ bitly_url = get_wbitly_short_url ($ post_id );
46
57?>
68
You can’t perform that action at this time.
0 commit comments