Tagged: , ,

Viewing 1 reply thread
  • Author
    Posts
    • #5938
      wandev
      Member

      Hi all!

      I am looking to re-develop a couple of my plugins on a new framework so all future plugins are on the same framework.

      One of my plugins uses a repeatable color picker.

      I wanted to know if it is possible to echo out each of the color values within the WordPress admin area.

      This is a sample of what I currently do.

      foreach($my_options['repeatable_tabbed_section']['my_color'] as $idx => $color){
          
          echo "
      
              <div class='swatch' data-hex='". $color . "' data-toggle='tooltip' data-placement='left' data-original-title='".$color." copied to clipboard!'>
      
                  <div class='swatchIcon' style='background-color:" . $color . "'></div>
                  
                  <div class='swatchHex'>" . $color . "</div>
              </div>";

      Is this sort of thing possible, if so do you have any examples of how to get the values from the array?

      This framework looks great! Looking forward to using it.

    • #5969
      Steve
      Keymaster

      @wandev– Welcome to the Piklist community!

      This is absolutely possible.

      Here’s the field:

        piklist('field', array(
          'type' => 'datepicker'
          ,'field' => 'demo_add_more_date'
          ,'label' => __('Date Picker', 'piklist-demo')
          ,'add_more' => true
        ));
      

      Then pull the values using get_post_meta(), and loop through them to display your HTML.

Viewing 1 reply thread
  • You must be logged in to reply to this topic.