WordPress.org

Ready to get started?Download WordPress

Forums

Front-end Editor
[resolved] Users in editable select dropdown (3 posts)

  1. tcfza
    Member
    Posted 1 year ago #

    Hi there

    Great plugin!

    Is there an easier way to do the below?

    Any help would be greatly appreciated, thank you

    $userargs = array(
    					'exclude' => 1,
    				);
    				$fvusers = get_users($userargs);
    
        				foreach ($fvusers as $user) {
            				$myusriddd[] = $user->ID;
    					$myusrndd[] = $user->display_name;
        				}
    
      				editable_post_meta( $mycustid, 'assigned_rep_code', array(
    					'type' => 'select',
    					'values' => array(
    						$myusriddd[0] => $myusrndd[0],
    						$myusriddd[1] => $myusrndd[1],
    						$myusriddd[2] => $myusrndd[2],
    						$myusriddd[3] => $myusrndd[3],
    						$myusriddd[4] => $myusrndd[4],
    						$myusriddd[5] => $myusrndd[5],
    						$myusriddd[6] => $myusrndd[6],
    						$myusriddd[7] => $myusrndd[7],
    						$myusriddd[8] => $myusrndd[8],
    						$myusriddd[9] => $myusrndd[9],
    						$myusriddd[10] => $myusrndd[10],
    						$myusriddd[11] => $myusrndd[11],
    						$myusriddd[12] => $myusrndd[12],
    						$myusriddd[13] => $myusrndd[13],
    						$myusriddd[14] => $myusrndd[14],
    						$myusriddd[15] => $myusrndd[15],
    						$myusriddd[16] => $myusrndd[16],
    						$myusriddd[17] => $myusrndd[17],
    						$myusriddd[18] => $myusrndd[18],
    						$myusriddd[19] => $myusrndd[19],
    						$myusriddd[20] => $myusrndd[20],
    						$myusriddd[21] => $myusrndd[21],
    						$myusriddd[22] => $myusrndd[22],
    						$myusriddd[23] => $myusrndd[23],
    						$myusriddd[24] => $myusrndd[24],
    						$myusriddd[25] => $myusrndd[25],
    						$myusriddd[26] => $myusrndd[26],
    						$myusriddd[27] => $myusrndd[27],
    						$myusriddd[28] => $myusrndd[28],
    						$myusriddd[29] => $myusrndd[29],
    					)
    				) );

    http://wordpress.org/extend/plugins/front-end-editor/

  2. scribu
    Member
    Plugin Author

    Posted 1 year ago #

    Yes:

    ...
    
    $user_choices = array();
    
    foreach ( $fvusers as $user ) {
      $user_choices[ $user->ID ] = $user->display_name;
    }
    
    editable_post_meta( $mycustid, 'assigned_rep_code', array(
      'type' => 'select',
      'values' => $user_choices
    ) );
  3. tcfza
    Member
    Posted 1 year ago #

    Brilliant!

    Thank you very much Scribu

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic