Commit inicial - WordPress Análisis de Precios Unitarios

- WordPress core y plugins
- Tema Twenty Twenty-Four configurado
- Plugin allow-unfiltered-html.php simplificado
- .gitignore configurado para excluir wp-config.php y uploads

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-03 21:04:30 -06:00
commit a22573bf0b
24068 changed files with 4993111 additions and 0 deletions

View File

@@ -0,0 +1,59 @@
<?php
add_action('wp_ajax_opanda_avatar', 'opanda_avatar');
function opanda_avatar() {
$leadId = isset( $_GET['opanda_lead_id'] ) ? intval( $_GET['opanda_lead_id'] ) : 0;
if ( empty( $leadId) ) exit;
$size = isset( $_GET['opanda_size'] ) ? intval( $_GET['opanda_size'] ) : 40;
if ( $size > 500 ) $size = 500;
if ( $size <= 0 ) $size = 40;
require_once OPANDA_BIZPANDA_DIR . '/admin/includes/leads.php';
$imageSource = OPanda_Leads::getLeadField( $leadId, 'externalImage' );
if ( empty( $imageSource ) || !function_exists('wp_get_image_editor') ) exit;
$upload_dir = wp_upload_dir();
$basePath = $upload_dir['path'] . '/bizpanda/avatars/';
if (!file_exists($basePath) && !is_dir($basePath)) mkdir($basePath, 0777, true );
$pathAvatar = $basePath . $leadId . 'x' . $size . '.jpeg';
$pathOriginal = $basePath . $leadId . 'x' . $size . '_org.jpeg';
$response = wp_remote_get($imageSource);
if (
is_wp_error( $response ) ||
!isset( $response['headers']['content-type'] ) ||
!isset( $response['body'] ) ||
empty( $response['body'] ) ||
!preg_match( "/image/i", $response['headers']['content-type'] ) ) {
OPanda_Leads::removeLeadField($leadId, 'externalImage');
exit;
}
file_put_contents($pathOriginal, $response['body']);
$image = wp_get_image_editor( $pathOriginal );
if ( is_wp_error( $image ) ) {
OPanda_Leads::removeLeadField($leadId, 'externalImage');
exit;
}
$image->resize( $size, $size, true );
$image->set_quality( 90 );
$image->save( $pathAvatar );
$imageSource = OPanda_Leads::updateLeadField( $leadId, '_image' . $size, $leadId . 'x' . $size . '.jpeg' );
$image->stream();
exit;
}

View File

@@ -0,0 +1,27 @@
<?php
function opanda_debug_log() {
// this feature is not ready yet
return;
$dsid = isset( $_POST['opanda_dsid'] ) ? $_POST['opanda_dsid'] : null;
$message = isset( $_POST['opanda_message'] ) ? $_POST['opanda_message'] : null;
if ( empty( $dsid ) ) return;
global $wpdb;
$wpdb->insert(
$wpdb->prefix . 'opanda_debug_log',
array(
'SessionId' => $dsid,
'Message' => $message,
'RecordTime' => time()
),
array( '%s', '%s', '%d' )
);
}
add_action('wp_ajax_opanda_debug_log', 'opanda_debug_log');
add_action('wp_ajax_nopriv_opanda_debug_log', 'opanda_debug_log');

View File

@@ -0,0 +1,47 @@
<?php
/**
* Ajax requests to get a list of Panda Items to insert.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
/**
* Returns a list of the lockers.
*/
function opanda_ajax_get_lockers() {
$lockers = get_posts(array(
'post_type' => OPANDA_POST_TYPE,
'meta_key' => 'opanda_item',
'meta_value' => OPanda_Items::getAvailableNames(),
'numberposts' => -1
));
$shortcode = isset( $_REQUEST['shortcode'] ) ? $_REQUEST['shortcode'] : false;
$result = array();
foreach($lockers as $locker)
{
$itemType = get_post_meta( $locker->ID, 'opanda_item', true );
$item = OPanda_Items::getItem($itemType);
if ( !empty( $shortcode ) && $shortcode !== $item['shortcode'] ) continue;
$result[] = array(
'id' => $locker->ID,
'title' => empty( $locker->post_title ) ? '(no titled, ID=' . $locker->ID . ')' : $locker->post_title,
'shortcode' => $item['shortcode'],
'isDefault' => get_post_meta( $locker->ID, 'opanda_is_default', true )
);
}
echo json_encode($result);
die();
}
add_action('wp_ajax_get_opanda_lockers', 'opanda_ajax_get_lockers');

View File

@@ -0,0 +1,306 @@
<?php
add_action("wp_ajax_onp_sl_preview", 'onp_lock_preview');
function onp_lock_preview()
{
$resOptions = array(
'confirm_like_screen_header',
'confirm_like_screen_message',
'confirm_like_screen_button',
'confirm_screen_title',
'confirm_screen_instructiont',
'confirm_screen_note1',
'confirm_screen_note2',
'confirm_screen_cancel',
'confirm_screen_open',
'misc_data_processing',
'misc_or_enter_email',
'misc_enter_your_email',
'misc_enter_your_name',
'misc_your_agree_with',
'misc_terms_of_use',
'misc_privacy_policy',
'misc_or_wait',
'misc_close',
'misc_or',
'errors_empty_email',
'errors_inorrect_email',
'errors_empty_name',
'errors_subscription_canceled',
'misc_close',
'misc_or',
'onestep_screen_title',
'onestep_screen_instructiont',
'onestep_screen_button',
'errors_not_signed_in',
'errors_not_granted',
'signin_long',
'signin_short',
'signin_facebook_name',
'signin_twitter_name',
'signin_google_name',
'signin_linkedin_name'
);
$resources = array();
foreach($resOptions as $resName) {
$resValue = get_option('opanda_res_' . $resName, false);
if( empty($resValue) )
continue;
$resources[$resName] = $resValue;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<style>
body {
padding: 0px;
margin: 0px;
font: normal normal 400 14px/170% Arial;
color: #333333;
text-align: justify;
}
* {
padding: 0px;
margin: 0px;
}
#wrap {
padding: 20px;
overflow: hidden;
}
p {
margin: 0px;
}
p + p {
margin-top: 8px;
}
.content-to-lock a {
color: #3185AB;
}
.content-to-lock {
text-shadow: 1px 1px 1px #fff;
padding: 20px 40px;
}
.content-to-lock .header {
margin-bottom: 20px;
}
.content-to-lock .header strong {
font-size: 16px;
text-transform: capitalize;
}
.content-to-lock .image {
text-align: center;
background-color: #f9f9f9;
border-bottom: 3px solid #f1f1f1;
margin: auto;
padding: 30px 20px 20px 20px;
}
.content-to-lock .image img {
display: block;
margin: auto;
margin-bottom: 15px;
max-width: 460px;
max-height: 276px;
height: 100%;
width: 100%;
}
.content-to-lock .footer {
margin-top: 20px;
}
</style>
<?php if( !empty($resources) ) { ?>
<script>
window.__pandalockers = {};
window.__pandalockers.lang = <?php echo json_encode($resources) ?>;
</script>
<?php } ?>
<script type="text/javascript" src="<?php echo get_site_url() ?>/wp-includes/js/jquery/jquery.js"></script>
<?php if( file_exists(includes_url() . 'js/jquery/ui/jquery.ui.core.min.js') ) { ?>
<script type="text/javascript" src="<?php echo get_site_url() ?>/wp-includes/js/jquery/ui/jquery.ui.core.min.js"></script>
<script type="text/javascript" src="<?php echo get_site_url() ?>/wp-includes/js/jquery/ui/jquery.ui.effect.min.js"></script>
<script type="text/javascript" src="<?php echo get_site_url() ?>/wp-includes/js/jquery/ui/jquery.ui.effect-highlight.min.js"></script>
<?php } else { ?>
<script type="text/javascript" src="<?php echo get_site_url() ?>/wp-includes/js/jquery/ui/core.min.js"></script>
<script type="text/javascript" src="<?php echo get_site_url() ?>/wp-includes/js/jquery/ui/effect.min.js"></script>
<script type="text/javascript" src="<?php echo get_site_url() ?>/wp-includes/js/jquery/ui/effect-highlight.min.js"></script>
<?php } ?>
<script type="text/javascript" src="<?php echo OPANDA_BIZPANDA_URL ?>/assets/admin/js/libs/json2.js"></script>
<?php ?>
<script type="text/javascript" src="<?php echo OPANDA_BIZPANDA_URL ?>/assets/js/lockers.min.js?<?php echo BIZPANDA_VERSION ?>"></script>
<link rel="stylesheet" type="text/css" href="<?php echo OPANDA_BIZPANDA_URL ?>/assets/css/lockers.min.css?<?php echo BIZPANDA_VERSION ?>">
<link rel="stylesheet" type="text/css" href="<?php echo OPANDA_BIZPANDA_URL ?>/assets/css/theme.all.min.css?<?php echo BIZPANDA_VERSION ?>">
<?php
?>
<?php do_action('onp_sl_preview_head') ?>
</head>
<body class="onp-sl-demo factory-fontawesome-320">
<div id="wrap" style="text-align: center; margin: 0 auto; max-width: 800px;">
<div class="content-to-lock" style="text-align: center; margin: 0 auto; max-width: 700px;">
<div class="header">
<p><strong>Lorem ipsum dolor sit amet, consectetur adipiscing</strong></p>
<p>
Maecenas sed consectetur tortor. Morbi non vestibulum eros, at posuere nisi praesent consequat.
</p>
</div>
<div class="image">
<img src="<?php echo OPANDA_BIZPANDA_URL ?>/assets/admin/img/preview-image.jpg" alt="Preview image"/>
<i>Aenean vel sodales sem. Morbi et felis eget felis vulputate placerat.</i>
</div>
<div class="footer">
<p>Curabitur a rutrum enim, sit amet ultrices quam.
Morbi dui leo, euismod a diam vitae, hendrerit ultricies arcu.
Suspendisse tempor ultrices urna ut auctor.</p>
</div>
</div>
</div>
<div style="clear: both;"></div>
</body>
<?php do_action('opanda_preview_print_scripts', !empty($_GET)
? $_GET
: null); ?>
<script>
(function($) {
var callback = '<?php echo(isset($_POST['callback'])
? $_POST['callback']
: '') ?>';
var $originalContent = $("#wrap").clone();
window.setOptions = function(options) {
$("#wrap").remove();
$("body").prepend($originalContent.clone());
options.demo = true;
var locker = $(".content-to-lock").pandalocker(options);
locker.bind('opanda-unlock', function() {
window.alertFrameSize();
});
locker.bind('opanda-size-changed', function() {
window.alertFrameSize();
});
window.alertFrameSize();
setTimeout(function() {
window.alertFrameSize();
}, 300);
};
window.alertFrameSize = function() {
if( !parent || !callback ) {
return;
}
var height = jQuery("#wrap").height();
height += 50;
if( parent[callback] ) {
parent[callback](height);
}
};
window.dencodeOptions = function(options) {
for( var optionName in options ) {
if( !$.isPlainObject(options[optionName]) ) {
continue;
}
if( typeof options[optionName] === 'object' ) {
options[optionName] = dencodeOptions(options[optionName]);
} else {
if( options[optionName] ) {
options[optionName] = decodeURI(options[optionName]);
}
}
}
return options;
};
window.defaultOptions = {
demo: true,
text: {},
locker: {},
overlap: {},
groups: {},
socialButtons: {
buttons: {},
effects: {}
},
connectButtons: {
facebook: {},
twitter: {},
google: {},
linkedin: {}
},
subscrioption: {},
events: {
ready: function() {
alertFrameSize();
},
unlock: function() {
alertFrameSize();
},
unlockByTimer: function() {
alertFrameSize();
},
unlockByClose: function() {
alertFrameSize();
}
}
};
$(document).trigger('onp-sl-filter-preview-options-php');
$(function() {
setTimeout(function() {
alertFrameSize(true);
}, 2000);
});
var postOptions = dencodeOptions(JSON.parse('<?php echo $_POST['options'] ?>'));
var options = $.extend(window.defaultOptions, postOptions);
$(function() {
var locker = $(".content-to-lock").pandalocker(options);
locker.bind('opanda-unlock', function() {
window.alertFrameSize();
});
locker.bind('opanda-size-changed', function() {
window.alertFrameSize();
});
});
jQuery(document).click(function() {
if( parent && window.removeProfilerSelector ) {
window.removeProfilerSelector();
}
});
})(jQuery);
</script>
</html>
<?php
exit;
}

View File

@@ -0,0 +1,257 @@
<?php
add_action('wp_ajax_opanda_connect', 'opanda_connect');
add_action('wp_ajax_nopriv_opanda_connect', 'opanda_connect');
/**
* Handles requests from the jQuery version of the locker plugin.
*/
function opanda_connect() {
// shows errors in the development mode
if ( defined('ONP_DEVELOPING_MODE') && ONP_DEVELOPING_MODE ) {
error_reporting(E_ALL);
ini_set('display_errors', 'On');
} else {
error_reporting(-1);
}
$handlerName = isset( $_REQUEST['opandaHandler'] ) ? $_REQUEST['opandaHandler'] : null;
$requestType = isset( $_REQUEST['opandaRequestType'] ) ? $_REQUEST['opandaRequestType'] : null;
$socialHandlers = ['facebook', 'twitter', 'google', 'linkedin', 'fblike', 'fbshare'];
$actionHandlers = ['subscription', 'signup', 'lead'];
$isSocialHandler = in_array( $handlerName, $socialHandlers );
$allowed = array_merge($socialHandlers, $actionHandlers);
if ( empty( $handlerName ) || !in_array( $handlerName, $allowed ) ) {
header( 'Status: 403 Forbidden' );
header( 'HTTP/1.1 403 Forbidden' );
exit;
}
if ( 'fblike' === $handlerName ) {
include OPANDA_BIZPANDA_DIR . "/includes/gates/facebook/LikeDialog.html";
exit;
} elseif ( 'fbshare' === $handlerName ) {
include OPANDA_BIZPANDA_DIR . "/includes/gates/facebook/ShareDialog.html";
exit;
}
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/Gate.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/GateBridge.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/ActionGate.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/OAuthGate.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/OAuthGateBridge.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/context/IContextReader.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/context/IContextReaderWriter.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/context/ConfigService.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/context/RequestService.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/context/SessionService.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/exceptions/GateExceptionPriority.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/exceptions/GateException.php";
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/exceptions/GateBridgeException.php";
if ( 'linkedin' === $handlerName ) {
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/$handlerName/LinkedinScope.php";
}
if ( $isSocialHandler ) {
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/$handlerName/" . ucwords( $handlerName ) . "Bridge.php";
}
require_once OPANDA_BIZPANDA_DIR . "/includes/gates/$handlerName/" . ucwords( $handlerName ) . "Gate.php";
$handlerClass = 'bizpanda\\includes\\gates\\' . $handlerName . '\\' . ucwords( $handlerName ) . 'Gate';
try {
if ( $isSocialHandler ) {
if ( empty( $requestType ) ) {
include OPANDA_BIZPANDA_DIR . "/includes/gates/$handlerName/OAuthDialog.html";
exit;
}
}
@header('Content-Type: application/json');
$gate = new $handlerClass();
$result = $gate->handleRequest();
$result['success'] = true;
echo json_encode( $result );
} catch ( Exception $exception ) {
if (
$exception instanceof bizpanda\includes\gates\exceptions\GateBridgeException ||
$exception instanceof bizpanda\includes\gates\exceptions\GateException ) {
$result = [
'success' => false,
'code' => $exception->getExceptionCode(),
'error' => $exception->getExceptionVisibleMessage(),
'details' => $exception->getExceptionDetails()
];
} else {
$result = [
'success' => false,
'error' => __('Something weird happened. We will fix it soon. Please try again later.', 'bizpanda'),
'details' => [
'clarification' => $exception->getMessage()
]
];
}
if ( defined('ONP_DEVELOPING_MODE') && ONP_DEVELOPING_MODE ) {
$result['trace'] = $exception->getTraceAsString();
}
echo json_encode( $result );
}
exit;
}
/**
* Returns the handler options.
* @param $handlerName string
* @return array
*/
function opanda_get_handler_options( $handlerName ) {
switch ( $handlerName ) {
case 'facebook':
$callbackUrl = !( defined('ONP_DEVELOPING_MODE') && ONP_DEVELOPING_MODE )
? opanda_local_proxy_url(['opandaHandler' => $handlerName])
: 'https://gate.sociallocker.app/fauth-wp-dev';
return [
'clientId' => get_option('opanda_facebook_app_id'),
'clientSecret' => get_option('opanda_facebook_secret'),
'callbackUrl' => $callbackUrl
];
case 'twitter':
$callbackUrl = !( defined('ONP_DEVELOPING_MODE') && ONP_DEVELOPING_MODE )
? opanda_local_proxy_url(['opandaHandler' => $handlerName])
: 'https://gate.sociallocker.app/tauth-wp-dev';
$params = [
'read' => [
'clientId' => get_option('opanda_twitter_social_app_consumer_key'),
'clientSecret' => get_option('opanda_twitter_social_app_consumer_secret')
],
'write' => [
'clientId' => get_option('opanda_twitter_signin_app_consumer_key'),
'clientSecret' => get_option('opanda_twitter_signin_app_consumer_secret'),
],
'callbackUrl' => $callbackUrl
];
if ( empty( $params['read']['clientId'] ) ) {
$params['read'] = $params['write'];
}
return $params;
case 'google':
$callbackUrl = !( defined('ONP_DEVELOPING_MODE') && ONP_DEVELOPING_MODE )
? opanda_local_proxy_url(['opandaHandler' => $handlerName])
: 'https://gate.sociallocker.app/gauth-wp-dev';
return [
'clientId' => get_option('opanda_google_client_id'),
'clientSecret' => get_option('opanda_google_client_secret'),
'callbackUrl' => $callbackUrl
];
case 'linkedin':
$callbackUrl = !( defined('ONP_DEVELOPING_MODE') && ONP_DEVELOPING_MODE )
? opanda_local_proxy_url(['opandaHandler' => $handlerName])
: 'https://gate.sociallocker.app/lauth-wp-dev';
return [
'clientId' => get_option('opanda_linkedin_client_id'),
'clientSecret' => get_option('opanda_linkedin_client_secret'),
'callbackUrl' => $callbackUrl
];
case 'subscription':
return array(
'service' => get_option('opanda_subscription_service', 'database')
);
case 'signup':
return array();
}
}
/**
* Returns the lists available for the current subscription service.
*
* @since 1.0.0
* @return void
*/
function opanda_get_subscrtiption_lists() {
require OPANDA_BIZPANDA_DIR.'/admin/includes/subscriptions.php';
try {
$service = OPanda_SubscriptionServices::getCurrentService();
$lists = $service->getLists();
echo json_encode($lists);
} catch (Exception $ex) {
echo json_encode( array('error' => 'Unable to get the lists: ' . $ex->getMessage() ) );
}
exit;
}
add_action( 'wp_ajax_opanda_get_subscrtiption_lists', 'opanda_get_subscrtiption_lists' );
/**
* Returns the lists available for the current subscription service.
*
* @since 1.0.0
* @return void
*/
function opanda_get_custom_fields() {
require OPANDA_BIZPANDA_DIR.'/admin/includes/subscriptions.php';
try {
$listId = isset( $_POST['opanda_list_id'] ) ? $_POST['opanda_list_id'] : null;
$service = OPanda_SubscriptionServices::getCurrentService();
$fields = $service->getCustomFields( $listId );
echo json_encode($fields);
} catch (Exception $ex) {
echo json_encode( array('error' => $ex->getMessage() ) );
}
exit;
}
add_action( 'wp_ajax_opanda_get_custom_fields', 'opanda_get_custom_fields' );

View File

@@ -0,0 +1,40 @@
<?php
/**
* Ajax requests linked with shortcodes.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
add_action('wp_ajax_opanda_loader', 'onp_sl_load_ajax_content');
add_action('wp_ajax_nopriv_opanda_loader', 'onp_sl_load_ajax_content');
/**
* Returns content of a locker shortcode.
*
* @since 1.0.0
* @return void
*/
function onp_sl_load_ajax_content() {
$hash = isset( $_POST['hash'] ) ? $_POST['hash'] : null;
$lockerId = isset( $_POST['lockerId'] ) ? intval( $_POST['lockerId'] ) : 0;
if (empty($hash) || empty($lockerId)) return;
global $wpdb;
$content = $wpdb->get_var( $wpdb->prepare(
"SELECT meta_value FROM $wpdb->postmeta WHERE meta_key = %s",
'opanda_locker_content_hash_' . $hash
));
$content = apply_filters('opanda_ajax_content', $content);
echo $content;
exit;
}

View File

@@ -0,0 +1,75 @@
<?php
/**
* Ajax requests linked with collecting statistics.
*
* @author Paul Kashtanoff <paul@byonepress.com>
* @copyright (c) 2014, OnePress Ltd
*
* @package core
* @since 1.0.0
*/
add_action('wp_ajax_opanda_statistics', 'opanda_statistics');
add_action('wp_ajax_nopriv_opanda_statistics', 'opanda_statistics');
/**
* Increases counters in a database after unlocking content.
*
* @since 1.0.0
* @return void
*/
function opanda_statistics() {
global $wpdb;
$statsItem = isset( $_POST['opandaStats'] ) ? $_POST['opandaStats'] : array();
$contextData = isset( $_POST['opandaContext'] ) ? $_POST['opandaContext'] : array();
// event name
$eventName = isset( $statsItem['eventName'] ) ? $statsItem['eventName'] : null;
$eventName = opanda_normilize_value( $eventName );
// sender type
$eventType = isset( $statsItem['eventType'] ) ? $statsItem['eventType'] : null;
$eventType = opanda_normilize_value( $eventType );
// visitor id
$visitorId = isset( $statsItem['visitorId'] ) ? $statsItem['visitorId'] : null;
$visitorId = opanda_normilize_value( $visitorId );
// context data
$context = isset( $_POST['opandaContext'] ) ? $_POST['opandaContext'] : array();
$context = opanda_normilize_values( $context );
$itemId = isset( $context['itemId'] ) ? $context['itemId'] : null;
$postId = isset( $context['postId'] ) ? $context['postId'] : null;
if ( empty( $itemId ) ) {
echo json_encode( array( 'error' => __('Item ID is not specified.', 'bizpanda') ) );
exit;
}
// stats for form unlocks is counted only once for a give visitor ID,
// against multiple counting when the confirmation is used
if ( $eventName == 'form' && $eventType == 'unlock' ) {
$key = 'opanda_' . md5($visitorId . $eventName . $eventType );
$unlocked = get_transient($key);
if ( $unlocked ) return json_encode( array( 'error' => __('Already counted.', 'bizpanda') ) );
set_transient($key, 1, 10);
}
// counts the stats
include_once(OPANDA_BIZPANDA_DIR . '/admin/includes/stats.php');
OPanda_Stats::processEvent( $itemId, $postId, $eventName, $eventType );
echo json_encode( array('success' => true) );
exit;
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* Returns a list of available roles.
*/
function bp_ajax_get_user_roles() {
global $wp_roles;
$roles = $wp_roles->roles;
$values = array();
foreach( $roles as $roleId => $role ) {
$values[] = array(
'value' => $roleId,
'title' => $role['name']
);
}
$values[] = array(
'value' => 'guest',
'title' => __('Guest', 'bizpanda')
);
$result = array(
'values' => $values
);
echo json_encode($result);
exit;
}
add_action('wp_ajax_bp_ajax_get_user_roles', 'bp_ajax_get_user_roles');