Forum Replies Created
-
This reply has been marked as private.in reply to: Unexpected token '
NOTE:The js code snippet above does not actually have the ', etc. but actually has the symbols
in reply to: Unexpected token 'Ahh, I see now..
You could always put something like this in your functions.php file.
NOTE:This is untested and will require a little more tweaking to get the output desired.
function custom_userpro_sc( $atts ) {
extract( shortcode_atts(
array(
‘user_id’ => ”,
), $atts )
);if ( isset( $user_id ) ) {
echo userpro_profile_data(‘custom_field_1’, $user_id);
}
add_shortcode( ‘cf_1’, ‘custom_userpro_sc’ );Then you could use the [cf_1 user_id=””] shortcode once you pass the $user_id as an attribute, possibly using a global var.
in reply to: Shortcodes for custom fieldsOoops.. I forgot to login to my account. Well atleast the test account has been tested..
in reply to: Shortcodes for custom fields<?php
$user_id = 66; // or the get any user ID you want to retrieve by setting this variable..
echo userpro_profile_data(‘custom field’, $user_id);
?>`in reply to: get the value of Custom Field – how?I’m currently trying to solve this as well. Unless it’s a feature built in that we haven’t found, it’ll probably have to be customized in the front-end publisher PHP file…
Forgot to mention.
- Site installed on a subfolder
- Also has the WP-content folder renamed
in reply to: Profile background & Image Upload ErrorI figured I’d lend my solution to you guys and it may or may not be a similar situation..
I was getting the same errors that Rushi was getting, or “not getting” as the upload would just pause, never getting pass the 100% loaded bar.
After going through, changing around the UserPro’s API.PHP, Ajax.PHP, and a few other /lib files I was able to finally get the error to raise and be visible in Chrome’s console.
In my situation, the files wouldn’t load properly due to my site’s URL being different then the source origin. To be more specific, I was getting the ” No ‘Access-Control-Allow-Origin’ header is present on the requested resource.” error after UserPro tried to pull the file-upload.php file.
For those who don’t know, this basically falls under the old ‘CORS’ Cross-Origin Resource Sharing policy, preventing a document or script loaded from one origin from getting or setting properties of a document from another origin.
If you domain settings in WordPress are set to http://www….. but your code is calling http://……. or any other similar scenario which could cause a difference between the two, you’ll get the error. There are a number of different workarounds to allow this to work as shown here from StackOverFlow.. Alternatively, if you can adjust your site address settings, that may do the trick .
in reply to: Profile background & Image Upload Error