Git Product home page Git Product logo

user-field-acf-add-on's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

user-field-acf-add-on's Issues

Basic installation question

Sorry - I know I should know this but to install the add on, I have uploaded it into my plugins folder, but where do I put the registration code? And if it is in my plugins folder are you able to give an example of what I might enter as the direct path please?

Thank you and sorry again!
James

Basic installation question

Sorry - I know I should know this but to install the add on, I have uploaded it into my plugins folder, but where do I put the registration code? And if it is in my plugins folder are you able to give an example of what I might enter as the direct path please?

Thank you and sorry again!
James

Storing data as array

Any chance you could store just the user ID, its making it impossible to query posts based on this field?

$values and $value->user_description

When i print out $values i get data for everything except user_description?

In addition to this would be really nice if we could grab the user gravatar if possible?

Using "Filter By Role" always returns empty

Hi,

this is a very nice plugin, but I found a issue in "filter by role".
I am working with the italian translation of Wordpress, and the query at line 225 ($users = get_users( $args )) always returns an empty array.
I notice that also the values of the select field are the translated ones, and I think this could be the reason.

Thank you,

Fabio

User field for v4

Hi Lewis,

I'm Elliot, the dev behind ACF and just wanted to say hi, thank you for making this field and also chat about the new ACF v4.

Unfortunately, in v4, I have had to change the way in which we define custom field types, this means your field is not compatible with the new ACF and wont work.

This said, it will not require much work at all to create a v4 compatible field type!
Please read the new documentation for creating a field type here:
http://www.advancedcustomfields.com/docs/tutorials/creating-a-new-field-type/

You will find that some functions have changed names. I advise that you start with a blank dummy.php field file and copy across your old functions one by one into the new function spaces.

I'm more than happy to help out with creating a v4 compatible field type, just let me know.

I'm not sure if you would want to create a new repository or just a new branch, but either way, both versions will need a url for users to find.

I'm sorry about causing any extra work and hassle, thanks for all your hard work, it's greatly appreciated!

Cheers
Elliot

PHP error on line 407

Thanks for creating this extension. It's saving me tons of time.

Here's my code (it's within the author.php template).

ID ); $next = get_field('_user', 'user_'.$curauth->ID ); if ( !empty($prev) ) : print_r($prev); endif; if ( !empty($next) ) : print_r($next); endif; ?>

This results in the following error:

Warning: Invalid argument supplied for foreach() in .../acf_users_field.php on line 407

I have a single user selected for each of the fields, but get this error no matter what I do. Any ideas?

Thanks,
Jacob

Custom roles

Hi,

Might have to add a role separator field? or use $wp_roles->role_objects.

i.e. If you have a custom role labeled Contract Manager and named contract_manager or even contractmanager, get_editable_roles() always return the label instead of role-name, this will cause get_users(array('role' => 'Contract Manager')) to not return the users for the role, as get_users actually fetches based on the role-name, not label.

FATAL ERROR: CANNOT USE OBJECT OF TYPE STDCLASS AS ARRAY...

I keep getting the following error:

FATAL ERROR: CANNOT USE OBJECT OF TYPE STDCLASS AS ARRAY IN

I added this to my functions.php file

` function get_author() {
$postid = get_the_ID();
$authors = get_field('author', $postid);

if($authors) {    
    foreach($authors as $author) {
        echo 'By '. $author['user_email'] .' on ';      
    }     
}

}`

and this in my page template:

echo get_author();

Any suggestions?

Reference ACF User Field on Front-End Form

Hello,

I am using your user field code to add a new field to the Advanced Custom Fields Wordpress plugin. Works great in the WP admin interface, but I am also trying to use the new front-end form feature in ACF, where you can include ACF forms in page templates. When I display a form containing the custom user field, I receive the following error:

Fatal error: Call to undefined function get_editable_roles() in /nfs/c07/h02/mnt/99917/domains/alert.washingtonandlee.net/html/wp-content/themes/wlualert/fields/users-field.php on line 182

Can you help me to properly define the get_editable_roles() function when used inside the loop?

Thanks,
Eric Owsley

Change from Select to Checkboxes

I would like to change the formatting from the multi-select box to a scrollable list of checkboxes (just like the default scrollable boxes to choose pages to add to a menu in the admin).

This will make things much safer to hand over to a client - with multiSelect, if a user accidentally clicks another name without holding down the CTRL button, all the previously selected options are undone. I know that a user could just refresh the page without saving, but the option to have this in a checkbox format would be greatly appreciated.

Thanks!

Saving field from front end repeater.

I am having a problem with the user field add on, where if you save via the backend post section it saves into the db as a user id, where as if you use the the update_field within a repeater, it saves as an array with all sorts of user info.

Problems to show users in admin

Got this problem to show all users in my panel in admin, when "Filter by role" is set to "-All-" or when I select them all. In my panel, the administrators will show up.

What I have done is:
In my functions.php I have this code

if(function_exists('register_field'))
{
register_field('Users_field', dirname(File) . '/admin/acf_addon/users_field.php');
}

When I have my Custom Field I add a field and choose 'User' as 'Field Type'.
Mark all and save.
And when I look at the posts panel only administrators will show up.

How ever I try to change the 'Filter by Role'-option only the ones that are Administrators will be displayed and selectable.

WordPress plugin vs?

I've tried modifying the script to turn it into an activatable WordPress plugin but keep getting errors.
Do you have plans on releasing a vs. that I can simply activate as a plugin?

Add custom fields to user

Hi

I'm trying to add custom fields to my users - phone, cell and the like. This works fine in the back end, the form elements appear and seem to save, but I can't seem to get the values back in a template.
If I use

 <?php 

 foreach($values as $value)
 {
      echo '<pre >';
           print_r($value);
      echo '</pre >';
 }

?>

I can only see the native user fields.

Array
 (
      [ID] => 3
      [user_firstname] => 
      [user_lastname] => 
      [nickname] =>
      [user_nicename] =>
      [display_name] => 
      [user_email] => 
      [user_url] => 
      [user_registered] => 2012-08-21 21:53:18
      [user_description] => This is my description field.
  )

(values redacted)

Can't seem to get this working.

I am having a bit of an issue trying to get this to work on my site.

I added the following code

'$author = get_field('author');
if ($author) {
echo 'By '. $author["display_name"] .' on ';
}'

But I get the following error:
Fatal error: Cannot use object of type WP_User as array

Anything I am doing wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.