elementor
3 years ago
admin-create-shortcode.php
7 years ago
admin-create-user.php
3 years ago
admin-custom-function.php
3 years ago
admin-rest-api.php
4 years ago
admin-settings.php
3 years ago
admin-social-button.php
3 years ago
admin-social-enque-script.php
5 years ago
counter-widget.php
3 years ago
counter.php
3 years ago
custom-function.php
4 years ago
login-widget.php
3 years ago
login.php
5 years ago
share-widget.php
3 years ago
share.php
3 years ago
admin-social-button.php
391 lines
| 1 | <?php |
| 2 | |
| 3 | defined('ABSPATH') || exit; |
| 4 | |
| 5 | /** |
| 6 | * Class Name : xs_button_in_login_page; |
| 7 | * Class Details : this class for showing login button in login and register page for wp, woocommerce, buddyPress and others |
| 8 | * |
| 9 | * @params : void |
| 10 | * @return : void |
| 11 | * |
| 12 | * @since : 1.0 |
| 13 | */ |
| 14 | class xs_button_in_login_page { |
| 15 | |
| 16 | /** |
| 17 | * Method Name : xs_addLoginButton |
| 18 | * Method Details : added social button with hide Current URL |
| 19 | * |
| 20 | * @params : void |
| 21 | * @return : void |
| 22 | * |
| 23 | * @since : 1.0 |
| 24 | */ |
| 25 | public static function xs_addLoginButton() { |
| 26 | echo xs_social_login_shortcode_widget(['all'], '', 'hide'); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- ignoring due to shortcode |
| 27 | } |
| 28 | |
| 29 | /** |
| 30 | * Method Name : xs_addLoginButton_on |
| 31 | * Method Details : added social button with Show Current URL |
| 32 | * |
| 33 | * @params : void |
| 34 | * @return : void |
| 35 | * |
| 36 | * @since : 1.0 |
| 37 | */ |
| 38 | public static function xs_addLoginButton_on() { |
| 39 | echo xs_social_login_shortcode_widget(['all'], '', 'show'); //phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- ignoring due to shortcode |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * Method Name : xs_login_form_login_wp |
| 44 | * Method Details : For added social button in wp-login page |
| 45 | * |
| 46 | * @params : String $type. |
| 47 | * @return : void |
| 48 | * |
| 49 | * @since : 1.0 |
| 50 | */ |
| 51 | public static function xs_login_form_login_wp($type = 'login_form') { |
| 52 | |
| 53 | add_action('login_enqueue_scripts', 'xs_my_global_stylesheet'); |
| 54 | |
| 55 | switch($type): |
| 56 | case 'login_form': |
| 57 | add_action('login_enqueue_scripts', 'xs_my_login_stylesheet'); |
| 58 | add_filter('login_form', 'xs_button_in_login_page::xs_addLoginButton'); |
| 59 | break; |
| 60 | case 'login_footer': |
| 61 | add_filter('login_footer', 'xs_button_in_login_page::xs_addLoginButton'); |
| 62 | break; |
| 63 | case 'login_head_top': |
| 64 | //add_action( 'login_enqueue_scripts', 'xs_my_login_stylesheet' ); |
| 65 | add_filter('login_head', 'xs_button_in_login_page::xs_addLoginButton'); |
| 66 | break; |
| 67 | case 'login_form_middle': |
| 68 | add_filter('login_form_middle', 'xs_button_in_login_page::xs_addLoginButton'); |
| 69 | break; |
| 70 | case 'login_form_bottom': |
| 71 | add_filter('login_form_bottom', 'xs_button_in_login_page::xs_addLoginButton'); |
| 72 | break; |
| 73 | case 'login_head': |
| 74 | add_filter('login_head', 'xs_button_in_login_page::xs_addLoginButton'); |
| 75 | break; |
| 76 | case 'login_message': |
| 77 | add_filter('login_message', 'xs_button_in_login_page::xs_addLoginButton'); |
| 78 | break; |
| 79 | default: |
| 80 | add_action('login_enqueue_scripts', 'xs_my_login_stylesheet'); |
| 81 | add_filter('login_form', 'xs_button_in_login_page::xs_addLoginButton'); |
| 82 | break; |
| 83 | endswitch; |
| 84 | |
| 85 | } |
| 86 | |
| 87 | /** |
| 88 | * Method Name : xs_login_form_register_wp |
| 89 | * Method Details : For added social button in wp-register page |
| 90 | * |
| 91 | * @params : String $type. |
| 92 | * @return : void |
| 93 | * |
| 94 | * @since : 1.0 |
| 95 | */ |
| 96 | public static function xs_login_form_register_wp($type = 'register_form') { |
| 97 | |
| 98 | add_action('login_enqueue_scripts', 'xs_my_global_stylesheet'); |
| 99 | |
| 100 | switch($type): |
| 101 | case 'register_form': |
| 102 | add_filter('register_form', 'xs_button_in_login_page::xs_addLoginButton'); |
| 103 | break; |
| 104 | case 'register_head': |
| 105 | add_action('login_enqueue_scripts', 'xs_my_login_stylesheet'); |
| 106 | add_filter('register_form', 'xs_button_in_login_page::xs_addLoginButton'); |
| 107 | break; |
| 108 | case 'register_footer': |
| 109 | add_filter('login_footer', 'xs_button_in_login_page::xs_addLoginButton'); |
| 110 | break; |
| 111 | default: |
| 112 | add_filter('register_form', 'xs_button_in_login_page::xs_addLoginButton'); |
| 113 | break; |
| 114 | endswitch; |
| 115 | |
| 116 | } |
| 117 | |
| 118 | /** |
| 119 | * Method Name : xs_login_form_login_wp |
| 120 | * Method Details : For added social button in wp-login page |
| 121 | * |
| 122 | * @params : String $type. |
| 123 | * @return : void |
| 124 | * |
| 125 | * @since : 1.0 |
| 126 | */ |
| 127 | public static function wfp_login_form_login_wp($type = 'wfp_login_form_end') { |
| 128 | add_action('login_enqueue_scripts', 'xs_my_global_stylesheet'); |
| 129 | switch($type): |
| 130 | case 'wfp_login_form_before_outer': |
| 131 | //add_action( 'login_enqueue_scripts', 'xs_my_login_stylesheet' ); |
| 132 | add_action('wfp_login_form_before_outer', 'xs_button_in_login_page::xs_addLoginButton'); |
| 133 | break; |
| 134 | case 'wfp_login_form_after_outer': |
| 135 | //add_action( 'login_enqueue_scripts', 'xs_my_login_stylesheet' ); |
| 136 | add_action('wfp_login_form_after_outer', 'xs_button_in_login_page::xs_addLoginButton'); |
| 137 | break; |
| 138 | case 'wfp_login_form_before_inner': |
| 139 | //add_action( 'login_enqueue_scripts', 'xs_my_login_stylesheet' ); |
| 140 | add_action('wfp_login_form_before_inner', 'xs_button_in_login_page::xs_addLoginButton'); |
| 141 | break; |
| 142 | case 'wfp_login_form_after_inner': |
| 143 | add_action('wfp_login_form_after_inner', 'xs_button_in_login_page::xs_addLoginButton'); |
| 144 | break; |
| 145 | case 'wfp_login_form_start': |
| 146 | add_action('wfp_login_form_start', 'xs_button_in_login_page::xs_addLoginButton'); |
| 147 | break; |
| 148 | case 'wfp_login_form_end': |
| 149 | add_action('wfp_login_form_end', 'xs_button_in_login_page::xs_addLoginButton'); |
| 150 | break; |
| 151 | case 'wfp_login_form_button_before': |
| 152 | add_action('wfp_login_form_button_before', 'xs_button_in_login_page::xs_addLoginButton'); |
| 153 | break; |
| 154 | case 'wfp_login_form_button_after': |
| 155 | add_action('wfp_login_form_button_after', 'xs_button_in_login_page::xs_addLoginButton'); |
| 156 | break; |
| 157 | case 'wfp_login_form_message': |
| 158 | add_action('wfp_login_form_message', 'xs_button_in_login_page::xs_addLoginButton'); |
| 159 | break; |
| 160 | default: |
| 161 | //add_action( 'login_enqueue_scripts', 'xs_my_login_stylesheet' ); |
| 162 | add_filter('wfp_login_form_button_after', 'xs_button_in_login_page::xs_addLoginButton'); |
| 163 | break; |
| 164 | endswitch; |
| 165 | |
| 166 | } |
| 167 | |
| 168 | /** |
| 169 | * Method Name : xs_login_form_comment_wp |
| 170 | * Method Details : For added social button in wp-comment page |
| 171 | * |
| 172 | * @params : String $type. |
| 173 | * @return : void |
| 174 | * |
| 175 | * @since : 1.0 |
| 176 | */ |
| 177 | public static function xs_login_form_comment_wp($type = 'comment_form_top') { |
| 178 | |
| 179 | switch($type): |
| 180 | case 'comment_form_top': |
| 181 | add_filter('comment_form_top', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 182 | break; |
| 183 | case 'comment_form_must_log_in_after': |
| 184 | add_filter('comment_form_must_log_in_after', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 185 | break; |
| 186 | |
| 187 | default: |
| 188 | add_filter('comment_form_top', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 189 | break; |
| 190 | |
| 191 | endswitch; |
| 192 | |
| 193 | |
| 194 | } |
| 195 | |
| 196 | |
| 197 | /** |
| 198 | * Method Name : xs_login_form_login_woo |
| 199 | * Method Details : For added social button in woocommerce login form page |
| 200 | * |
| 201 | * @params : String $type. |
| 202 | * @return : void |
| 203 | * |
| 204 | * @since : 1.0 |
| 205 | */ |
| 206 | public static function xs_login_form_login_woo($type = 'woocommerce_login_form') { |
| 207 | |
| 208 | switch($type): |
| 209 | case 'woocommerce_register_form': |
| 210 | add_filter('woocommerce_register_form', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 211 | break; |
| 212 | case 'woocommerce_register_form_start': |
| 213 | add_filter('woocommerce_register_form_start', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 214 | break; |
| 215 | case 'woocommerce_register_form_end': |
| 216 | add_filter('woocommerce_register_form_end', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 217 | break; |
| 218 | case 'woocommerce_login_form': |
| 219 | add_filter('woocommerce_login_form', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 220 | break; |
| 221 | case 'woocommerce_login_form_start': |
| 222 | add_filter('woocommerce_login_form_start', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 223 | break; |
| 224 | case 'woocommerce_login_form_end': |
| 225 | add_filter('woocommerce_login_form_end', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 226 | break; |
| 227 | case 'woocommerce_before_checkout_billing_form': |
| 228 | add_filter('woocommerce_before_checkout_billing_form', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 229 | break; |
| 230 | case 'woocommerce_after_checkout_billing_form': |
| 231 | add_filter('woocommerce_after_checkout_billing_form', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 232 | break; |
| 233 | default : |
| 234 | add_filter('woocommerce_login_form', 'xs_button_in_login_page::xs_addLoginButton_on'); |
| 235 | break; |
| 236 | endswitch; |
| 237 | |
| 238 | } |
| 239 | |
| 240 | |
| 241 | /** |
| 242 | * Method Name : xs_login_form_login_buddy |
| 243 | * Method Details : For added social button in BuddyPress form page |
| 244 | * |
| 245 | * @params : String $type. |
| 246 | * @return : void |
| 247 | * |
| 248 | * @since : 1.0 |
| 249 | */ |
| 250 | public static function xs_login_form_login_buddy($type = 'bp_before_register_page') { |
| 251 | |
| 252 | switch($type): |
| 253 | case 'bp_before_register_page': |
| 254 | add_filter('bp_before_register_page', 'xs_button_in_login_page::xs_addLoginButton'); |
| 255 | break; |
| 256 | case 'bp_before_account_details_fields': |
| 257 | add_filter('bp_before_account_details_fields', 'xs_button_in_login_page::xs_addLoginButton'); |
| 258 | break; |
| 259 | case 'bp_after_register_page': |
| 260 | add_filter('bp_after_register_page', 'xs_button_in_login_page::xs_addLoginButton'); |
| 261 | break; |
| 262 | default: |
| 263 | add_filter('bp_before_register_page', 'xs_button_in_login_page::xs_addLoginButton'); |
| 264 | break; |
| 265 | |
| 266 | endswitch; |
| 267 | |
| 268 | |
| 269 | } |
| 270 | |
| 271 | |
| 272 | } |
| 273 | |
| 274 | if(class_exists('xs_button_in_login_page')) { |
| 275 | |
| 276 | // action hooks for load global css file |
| 277 | add_action('wp_enqueue_scripts', 'xs_my_global_stylesheet'); |
| 278 | /** |
| 279 | * Variable Name : $xs_login_admin_page |
| 280 | * Variable Type : Array |
| 281 | * @return : array() $xs_login_admin_page . Get array from socail global setting data "xs_global_setting_data" |
| 282 | * |
| 283 | * @since : 1.0 |
| 284 | */ |
| 285 | $xs_login_admin_page = get_option('xs_global_setting_data'); |
| 286 | |
| 287 | /** |
| 288 | * Variable Name : $enable_woocmarce_login |
| 289 | * Variable Type : int() |
| 290 | * @return : int $enable_woocmarce_login Enable 0,1 |
| 291 | * |
| 292 | * @since : 1.0 |
| 293 | */ |
| 294 | $enable_woocmarce_login = isset($xs_login_admin_page['woocommerce_login_page']['enable']) ? $xs_login_admin_page['woocommerce_login_page']['enable'] : 0; |
| 295 | if($enable_woocmarce_login) { |
| 296 | $enable_woocmarce_login_type = isset($xs_login_admin_page['woocommerce_login_page']['data']) ? $xs_login_admin_page['woocommerce_login_page']['data'] : 'woocommerce_login_form_end'; |
| 297 | xs_button_in_login_page::xs_login_form_login_woo($enable_woocmarce_login_type); |
| 298 | } |
| 299 | /** |
| 300 | * Variable Name : $enable_woocmarce_register |
| 301 | * Variable Type : int() |
| 302 | * @return : int $enable_woocmarce_register Enable 0,1 |
| 303 | * |
| 304 | * @since : 1.0 |
| 305 | */ |
| 306 | $enable_woocmarce_register = isset($xs_login_admin_page['woocommerce_register_page']['enable']) ? $xs_login_admin_page['woocommerce_register_page']['enable'] : 0; |
| 307 | if($enable_woocmarce_register) { |
| 308 | $enable_woocmarce_register_type = isset($xs_login_admin_page['woocommerce_register_page']['data']) ? $xs_login_admin_page['woocommerce_register_page']['data'] : 'woocommerce_register_form_end'; |
| 309 | xs_button_in_login_page::xs_login_form_login_woo($enable_woocmarce_register_type); |
| 310 | } |
| 311 | /** |
| 312 | * Variable Name : $enable_woocmarce_billing |
| 313 | * Variable Type : int() |
| 314 | * @return : int $enable_woocmarce_billing Enable 0,1 |
| 315 | * |
| 316 | * @since : 1.0 |
| 317 | */ |
| 318 | $enable_woocmarce_billing = isset($xs_login_admin_page['woocommerce_billing_page']['enable']) ? $xs_login_admin_page['woocommerce_billing_page']['enable'] : 0; |
| 319 | if($enable_woocmarce_billing) { |
| 320 | $enable_woocmarce_billing_type = isset($xs_login_admin_page['woocommerce_billing_page']['data']) ? $xs_login_admin_page['woocommerce_billing_page']['data'] : 'woocommerce_after_checkout_billing_form'; |
| 321 | xs_button_in_login_page::xs_login_form_login_woo($enable_woocmarce_billing_type); |
| 322 | } |
| 323 | /** |
| 324 | * Variable Name : $enable_wp_login |
| 325 | * Variable Type : int() |
| 326 | * @return : int $enable_wp_login Enable 0,1 |
| 327 | * |
| 328 | * @since : 1.0 |
| 329 | */ |
| 330 | $enable_wp_login = isset($xs_login_admin_page['wp_login_page']['enable']) ? $xs_login_admin_page['wp_login_page']['enable'] : 0; |
| 331 | if($enable_wp_login) { |
| 332 | $enable_wp_login_type = isset($xs_login_admin_page['wp_login_page']['data']) ? $xs_login_admin_page['wp_login_page']['data'] : 'login_form'; |
| 333 | xs_button_in_login_page::xs_login_form_login_wp($enable_wp_login_type); |
| 334 | } |
| 335 | |
| 336 | /** |
| 337 | * Variable Name : $enable_wp_register |
| 338 | * Variable Type : int() |
| 339 | * @return : int $enable_wp_register Enable 0,1 |
| 340 | * |
| 341 | * @since : 1.0 |
| 342 | */ |
| 343 | $enable_wp_register = isset($xs_login_admin_page['wp_register_page']['enable']) ? $xs_login_admin_page['wp_register_page']['enable'] : 0; |
| 344 | if($enable_wp_register) { |
| 345 | //xs_button_in_login_page::$showFilter = 'hide'; |
| 346 | $enable_wp_register_type = isset($xs_login_admin_page['wp_register_page']['data']) ? $xs_login_admin_page['wp_register_page']['data'] : 'register_form'; |
| 347 | xs_button_in_login_page::xs_login_form_register_wp($enable_wp_register_type); |
| 348 | } |
| 349 | |
| 350 | /** |
| 351 | * Variable Name : $enable_wfp_login |
| 352 | * Variable Type : int() |
| 353 | * @return : int $enable_wp_register Enable 0,1 |
| 354 | * |
| 355 | * @since : 1.0 |
| 356 | */ |
| 357 | $enable_wfp_login = isset($xs_login_admin_page['wfp_fund_login_page']['enable']) ? $xs_login_admin_page['wfp_fund_login_page']['enable'] : 0; |
| 358 | if($enable_wfp_login) { |
| 359 | $enable_wfp_login_type = isset($xs_login_admin_page['wfp_fund_login_page']['data']) ? $xs_login_admin_page['wfp_fund_login_page']['data'] : 'wfp_login_form_end'; |
| 360 | xs_button_in_login_page::wfp_login_form_login_wp($enable_wfp_login_type); |
| 361 | } |
| 362 | |
| 363 | /** |
| 364 | * Variable Name : $enable_wp_comment |
| 365 | * Variable Type : int() |
| 366 | * @return : int $enable_wp_comment Enable 0,1 |
| 367 | * |
| 368 | * @since : 1.0 |
| 369 | */ |
| 370 | $enable_wp_comment = isset($xs_login_admin_page['wp_comment_page']['enable']) ? $xs_login_admin_page['wp_comment_page']['enable'] : 0; |
| 371 | if($enable_wp_comment) { |
| 372 | $enable_wp_comment_type = isset($xs_login_admin_page['wp_comment_page']['data']) ? $xs_login_admin_page['wp_comment_page']['data'] : 'comment_form_top'; |
| 373 | xs_button_in_login_page::xs_login_form_comment_wp($enable_wp_comment_type); |
| 374 | } |
| 375 | |
| 376 | |
| 377 | /** |
| 378 | * Variable Name : $enable_buddyPress_register |
| 379 | * Variable Type : int() |
| 380 | * @return : int $enable_buddyPress_register Enable 0,1 |
| 381 | * |
| 382 | * @since : 1.0 |
| 383 | */ |
| 384 | $enable_buddyPress_register = isset($xs_login_admin_page['buddypress_page']['enable']) ? $xs_login_admin_page['buddypress_page']['enable'] : 0; |
| 385 | if($enable_buddyPress_register) { |
| 386 | $enable_buddyPress_register_type = isset($xs_login_admin_page['buddypress_page']['data']) ? $xs_login_admin_page['buddypress_page']['data'] : 'bp_before_register_page'; |
| 387 | xs_button_in_login_page::xs_login_form_login_buddy($enable_buddyPress_register_type); |
| 388 | } |
| 389 | |
| 390 | } |
| 391 |