Skip to content

Commit 6be33c4

Browse files
committed
project updated
1 parent 629859d commit 6be33c4

File tree

13 files changed

+74
-102
lines changed

13 files changed

+74
-102
lines changed

about.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
$template = "<div class='about'><p class='big'>Custom Profile Avatar</p>";
2727
$template .= "<p>Version: 1.0</p>";
2828
$template .= "<p>Developer: en0ndev</p>";
29-
$template .= "<a target='_blank' href='https://www.youtube.com/channel/UC3CSOAThanO-LvYKFwJ24RQ'>My YouTube Channel</a></div>";
29+
$template .= "<a class='link' target='_blank' href='https://www.youtube.com/channel/UC3CSOAThanO-LvYKFwJ24RQ'>My YouTube Channel</a></div>";
3030

31-
use template\page__template;
31+
use cpa__template\cpa__page__template;
3232

33-
$page = new page__template;
33+
$page = new cpa__page__template;
3434

35-
$page->get__template("About", $template, 0);
35+
$page->cpa__get__template("About", $template, 0);

assets/css/style.css

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@
55
66
This file is part of Custom Profile Avatar.
77
8-
Plugin Name: Custom Profile Avatar
9-
Plugin URI: http://wordpress.org/plugins/
10-
Description: Change profile avatar to your custom avatar.
11-
Author: en0ndev
12-
Version: 1.0
13-
Author URI: https://github.com/en0ndev
14-
158
Custom Profile Avatar is free software: you can redistribute it and/or modify
169
it under the terms of the GNU General Public License as published by
1710
the Free Software Foundation, either version 3 of the License, or
@@ -184,13 +177,18 @@ input[type="button"],
184177
.about>a {
185178
font-size: 15px;
186179
font-weight: 500;
180+
color: #000;
187181
}
188182

189183
.about>.big {
190184
font-size: 20px;
191185
font-weight: 600;
192186
}
193187

188+
.about>.link {
189+
color: #2271b1;
190+
}
191+
194192
#notf {
195193
position: absolute;
196194
right: 15px;

assets/js/modules.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,6 @@
44
** Author: en0ndev
55
This file is part of Custom Profile Avatar.
66
7-
Plugin Name: Custom Profile Avatar
8-
Plugin URI: http://wordpress.org/plugins/
9-
Description: Change profile avatar to your custom avatar.
10-
Author: en0ndev
11-
Version: 1.0
12-
Author URI: https://github.com/en0ndev
13-
147
Custom Profile Avatar is free software: you can redistribute it and/or modify
158
it under the terms of the GNU General Public License as published by
169
the Free Software Foundation, either version 3 of the License, or

index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
/*
44
Plugin Name: Custom Profile Avatar
5-
Plugin URI: http://wordpress.org/plugins/
5+
Plugin URI: https://wordpress.org/plugins/custom-profile-avatar
66
Description: Change profile avatar to your custom avatar.
7-
Author: en0ndev
87
Version: 1.0
8+
Author: en0ndev
99
Author URI: https://github.com/en0ndev
1010
1111
This file is part of Custom Profile Avatar.
@@ -30,3 +30,4 @@
3030
require_once __DIR__ . '/modules/template.php';
3131
require_once __DIR__ . '/modules/chooser.php';
3232
require_once __DIR__ . '/modules/get_avatar.php';
33+
require_once __DIR__ . '/modules/get_style.php';

main.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
*/
2424
defined('ABSPATH') || exit; // Exit if accessed directly
2525

26-
$template = "<div class='user__avatar'>" . htmlspecialchars_decode(get__avatar__new()) . "</div>";
27-
$template .= "<input type='text' class='hidden' name='avatar__val' value='" . get__value() . "' />";
26+
$template = "<div class='user__avatar'>" . htmlspecialchars_decode(cpa__get__avatar__new()) . "</div>";
27+
$template .= "<input type='text' class='hidden' name='avatar__val' value='" . cpa__get__value() . "' />";
2828
$template .= "<input id='change' type='button' value='" . esc_html__("Change Avatar") . "' /></div>";
29-
$template .= "<input id='save' type='submit' name='save__avatar' value='" . esc_html__("Save") . "' />";
29+
$template .= "<input id='save' type='submit' name='cpa__save__avatar' value='" . esc_html__("Save") . "' />";
3030

31-
use template\page__template;
31+
use cpa__template\cpa__page__template;
3232

33-
$page = new page__template;
33+
$page = new cpa__page__template;
3434

35-
$page->get__template("Settings", $template, 1);
35+
$page->cpa__get__template("Settings", $template, 1);

modules/admin_footer.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
/*
99
This file is part of Custom Profile Avatar.
1010
11-
Plugin Name: Custom Profile Avatar
12-
Plugin URI: http://wordpress.org/plugins/
13-
Description: Change profile avatar to your custom avatar.
14-
Author: en0ndev
15-
Version: 1.0
16-
Author URI: https://github.com/en0ndev
17-
1811
Custom Profile Avatar is free software: you can redistribute it and/or modify
1912
it under the terms of the GNU General Public License as published by
2013
the Free Software Foundation, either version 3 of the License, or
@@ -30,7 +23,7 @@
3023
*/
3124
defined('ABSPATH') || exit; // Exit if accessed directly
3225

33-
function admin_footer($text)
26+
function cpa__admin__footer($text)
3427
{
3528

3629
$get_url = $_SERVER['QUERY_STRING'];
@@ -45,4 +38,4 @@ function admin_footer($text)
4538
return $text;
4639
}
4740

48-
add_filter('admin_footer_text', 'admin_footer');
41+
add_filter('admin_footer_text', 'cpa__admin__footer');

modules/admin_menu_join.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
/*
99
This file is part of Custom Profile Avatar.
1010
11-
Plugin Name: Custom Profile Avatar
12-
Plugin URI: http://wordpress.org/plugins/
13-
Description: Change profile avatar to your custom avatar.
14-
Author: en0ndev
15-
Version: 1.0
16-
Author URI: https://github.com/en0ndev
17-
1811
Custom Profile Avatar is free software: you can redistribute it and/or modify
1912
it under the terms of the GNU General Public License as published by
2013
the Free Software Foundation, either version 3 of the License, or
@@ -30,12 +23,12 @@
3023
*/
3124
defined('ABSPATH') || exit; // Exit if accessed directly
3225

33-
function main__settings()
26+
function cpa__main__settings()
3427
{
3528
include_once(__DIR__ . '/../main.php');
3629
include_once(__DIR__ . '/change_avatar.php');
3730
}
38-
function about__author()
31+
function cpa__about__author()
3932
{
4033
include_once(__DIR__ . '/../about.php');
4134
}

modules/change_avatar.php

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
/*
99
This file is part of Custom Profile Avatar.
1010
11-
Plugin Name: Custom Profile Avatar
12-
Plugin URI: http://wordpress.org/plugins/
13-
Description: Change profile avatar to your custom avatar.
14-
Author: en0ndev
15-
Version: 1.0
16-
Author URI: https://github.com/en0ndev
17-
1811
Custom Profile Avatar is free software: you can redistribute it and/or modify
1912
it under the terms of the GNU General Public License as published by
2013
the Free Software Foundation, either version 3 of the License, or
@@ -30,9 +23,9 @@
3023
*/
3124
defined('ABSPATH') || exit; // Exit if accessed directly
3225

33-
if (isset($_POST['save__avatar'])) {
26+
if (isset($_POST['cpa__save__avatar'])) {
3427
try {
35-
change__avatar();
28+
cpa__change__avatar();
3629
echo '<div id="notf" class="scs">' . 'Avatar Successfully Saved!' . '</div>';
3730
echo '<script>location.reload();</script>';
3831
} catch (Exception $e) {

modules/chooser.php

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
/*
99
This file is part of Custom Profile Avatar.
1010
11-
Plugin Name: Custom Profile Avatar
12-
Plugin URI: http://wordpress.org/plugins/
13-
Description: Change profile avatar to your custom avatar.
14-
Author: en0ndev
15-
Version: 1.0
16-
Author URI: https://github.com/en0ndev
17-
1811
Custom Profile Avatar is free software: you can redistribute it and/or modify
1912
it under the terms of the GNU General Public License as published by
2013
the Free Software Foundation, either version 3 of the License, or
@@ -30,13 +23,11 @@
3023
*/
3124
defined('ABSPATH') || exit; // Exit if accessed directly
3225

33-
function choose__avatar()
26+
function cpa__choose__avatar()
3427
{
3528
$src = plugin_dir_url(__FILE__) . '../assets/js/modules.js';
36-
//Core media script
3729
wp_enqueue_media();
38-
// Your custom js file
39-
wp_register_script('media-lib-uploader-js-avatar', $src, array('jquery'));
40-
wp_enqueue_script('media-lib-uploader-js-avatar');
30+
wp_register_script('cpa-media-lib-uploader-js', $src, array('jquery'));
31+
wp_enqueue_script('cpa-media-lib-uploader-js');
4132
}
42-
add_action('admin_enqueue_scripts', 'choose__avatar');
33+
add_action('admin_enqueue_scripts', 'cpa__choose__avatar');

modules/get_avatar.php

Lines changed: 6 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,6 @@
88
/*
99
This file is part of Custom Profile Avatar.
1010
11-
Plugin Name: Custom Profile Avatar
12-
Plugin URI: http://wordpress.org/plugins/
13-
Description: Change profile avatar to your custom avatar.
14-
Author: en0ndev
15-
Version: 1.0
16-
Author URI: https://github.com/en0ndev
17-
1811
Custom Profile Avatar is free software: you can redistribute it and/or modify
1912
it under the terms of the GNU General Public License as published by
2013
the Free Software Foundation, either version 3 of the License, or
@@ -33,14 +26,14 @@
3326
$usr = new WP_User;
3427
$current_user = $usr->wp_get_current_user();
3528

36-
function get__old($id)
29+
function cpa__get__old($id)
3730
{
3831
$args = get_avatar_data($id);
3932
$url = $args['url'];
4033
return $url;
4134
}
4235

43-
function change__avatar()
36+
function cpa__change__avatar()
4437
{
4538
global $current_user;
4639
if (!get_user_meta($current_user->id, 'custom_profile_avatar')) {
@@ -50,22 +43,22 @@ function change__avatar()
5043
}
5144
}
5245

53-
function get__avatar__new()
46+
function cpa__get__avatar__new()
5447
{
5548
global $current_user;
5649
if (empty(get_user_meta($current_user->id, 'custom_profile_avatar')[0]) || !get_user_meta($current_user->id, 'custom_profile_avatar')[0]) {
5750
$out = get_avatar($current_user->id, 110);
5851
} else {
5952
$out = '<img class="avatar" src="' . get_user_meta($current_user->id, 'custom_profile_avatar')[0] . '" /><div class="remove"></div>';
6053
}
61-
$out .= '<div id="pull" class="hidden"><img src="' . get__old($current_user->id) . '" /></div>';
54+
$out .= '<div id="pull" class="hidden"><img src="' . cpa__get__old($current_user->id) . '" /></div>';
6255
return $out;
6356
}
6457

65-
function get__value()
58+
function cpa__get__value()
6659
{
6760
global $current_user;
68-
if (get_user_meta($current_user->id, 'custom_profileavatar')[0])
61+
if (get_user_meta($current_user->id, 'custom_profile_avatar')[0])
6962
return get_user_meta($current_user->id, 'custom_profile_avatar')[0];
7063
else
7164
return 0;

0 commit comments

Comments
 (0)