title: Save custom meta box data more organized way in Wordpress
body: <p>I have added a meta box on the <code>new-post</code> page which allows users to add photos and write some description. See the attached image.</p>
  
  <p><a href="https://i.stack.imgur.com/7wZCz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/7wZCz.png" alt="enter image description here"></a></p>
  
  <p>So, now I want to save this data. As you can see, A photo itself has its own meta data too (Title, URL and Description) So, storing these values in a multidimensional array will make more sense I guess. </p>
  
  <pre><code>$photo_meta_data = array(
               'photo1' =&gt; array('title'=&gt;'aaa', 'url'=&gt;'http://..', 'desc'=&gt;'ffff'),
               'photo2' =&gt; array('title'=&gt;'aaa', 'url'=&gt;'http://..', 'desc'=&gt;'ffff'),
               'photo3' =&gt; array('title'=&gt;'aaa', 'url'=&gt;'http://..', 'desc'=&gt;'ffff'),
  
          )
  </code></pre>
  
  <p>But, how to do this ? This is the code I'm stucked in my metabox. </p>
  
  <pre><code>    if( isset( $_POST[ 'photo-title1' ] ) ) {
              update_post_meta( $post_id, 'photo-title1', sanitize_text_field( $_POST[ 'photo-title1' ] ) );
     }
  </code></pre>
  
  <p>I'm just saving field data just like a single value. </p>
  
  <p>And currently I'm storing values in the <code>wp_postmeta</code> table like this...</p>
  
  <pre><code>PostId   MetaKey       Value
   175   photo-title1    .....
   175   photo-URL1      .....
   175   photo-desc1     ..... 
  
   175   photo-title2    .....
   175   photo-URL2      .....
   175   photo-desc2     ..... 
  
   176   photo-title1    .....
   176   photo-URL1      .....
   176   photo-desc1     ..... 
  </code></pre>
  
  <p>So, this is lot of data for the <code>wp_postmeta</code> table isn't it ? </p>
  
  <p>Is there a more organized way of doing this ? Should I use a separate table for these custom meta data ? Or just do like I've done ? </p>
  
  <p>Thanks!</p>