Title: Custom Fields implementation
Last modified: August 30, 2016

---

# Custom Fields implementation

 *  [jay3wpb](https://wordpress.org/support/users/jay3wpb/)
 * (@jay3wpb)
 * [10 years, 6 months ago](https://wordpress.org/support/topic/custom-fields-implementation/)
 * Hello, I would like to add metadata for when the film was watched and who chose
   the film. I would like it to appear in the post and also would like to be able
   to sort by them. I think I can achieve this with custom fields but am a little
   shaky on exactly how. I haven’t seen anything on this in the documentation or
   in this forum. Thank you for your time.
 * [https://wordpress.org/plugins/wpmovielibrary/](https://wordpress.org/plugins/wpmovielibrary/)

Viewing 1 replies (of 1 total)

 *  [electrohad](https://wordpress.org/support/users/electrohad/)
 * (@electrohad)
 * [10 years, 3 months ago](https://wordpress.org/support/topic/custom-fields-implementation/#post-6797875)
 * Hello
 * I’m a beginner in wordpress and with the plugin
    But I succed to add a personal
   MetaData for my movie ISBN I dunno if it ‘s the best way But i have new value
   in mysql base with the key “_wpmoly_movie_isbn” in the table wp_postmeta
 * I modified the followg files
 * File : wpmpoly-shortcodes
    – array **movies **and **movie **in value my new meta
   ISBN
 * _
    ‘meta’ => array( ‘default’ => null, ‘values’ => array( ‘director’, ‘runtime’,‘
   release\_date’, ‘genres’, ‘actors’, ‘overview’, ‘title’, ‘original\_title’, ‘
   production’, ‘country’, ‘language’, ‘producer’, ‘photography’, ‘composer’, ‘author’,‘
   writer’, ‘isbn’ ), ‘filter’ => null – array movie\_meta I ad a key ‘key’ => array(‘
   default’ => null, ‘values’ => array( ‘director’, ‘runtime’, ‘release\_date’, ‘
   genres’, ‘actors’, ‘cast’, ‘overview’, ‘title’, ‘original\_title’, ‘production’,‘
   country’, ‘language’, ‘producer’, ‘photography’, ‘composer’, ‘author’, ‘writer’,‘
   isbn’ ), ‘filter’ => ‘esc\_attr’
 * – and a alias
    _ ‘aliases’ => array( … ‘movie\_homepage’, ‘movie\_isbn’
 * File: wpmoly-movies.php
    _ $wpmoly\_movie\_meta = array(…. ‘homepage’ => array(‘
   title’ => \_\_( ‘Homepage’, ‘wpmovielibrary’ ), ‘type’ => ‘text’, ‘filter’ =>‘
   esc\_html’, ‘filter\_args’ => null, ‘size’ => ‘half’, ‘group’ => ‘meta’, ‘rewrite’
   => null ), ‘isbn’ => array( ‘title’ => \_\_( ‘Isbn’, ‘wpmovielibrary’ ), ‘type’
   => ‘text’, ‘filter’ => ‘esc\_html’, ‘filter\_args’ => null, ‘size’ => ‘half’,‘
   group’ => ‘meta’, ‘rewrite’ => null ) );
 * File: class-wpmoly-formatting-meta.php
 * I add a function in class WPMOLY_Formatting_Meta {
 * _public static function format\_movie\_isbn( $data ) {_
 *  $output = array();
 *  $data = explode( ‘,’, $data );
    $data = array_map( ‘trim’, $data );
 *  foreach ( $data as $d ) {
    $output[] = apply_filters( ‘wpmoly_movie_meta_link’,
   array( ‘key’ => ‘isbn’, ‘value’ => $d, ‘type’ => ‘meta’, ‘text’ => $d, ‘title’
   => sprintf( __( ‘Movie ISBN %s’, ‘wpmovielibrary’ ), $d ) ) ); }
 *  if ( ! empty( $output ) )
    $output = implode( ‘, ‘, $output );
 *  $output = self::format_movie_field( $output );
 *  return $output;
    }
 * To add setting on the new metadata
    File : wpmoly-settings.php
 * // Default movie meta to show
    ‘sort-meta’ => array( ‘id’ => ‘wpmoly-sort-meta’,‘
   type’ => ‘sorter’, ‘title’ => __( ‘Movie metadata’, ‘wpmovielibrary’ ), ‘desc’
   => __( ‘Which metadata to display in posts: director, genres, runtime, rating…’,‘
   wpmovielibrary’ ), //’callback’ => ‘sorted_markup_fields’, ‘compiler’ => ‘true’,‘
   options’ => array( ‘used’ => array( ….. ‘director’ => __( ‘Director’, ‘wpmovielibrary’),‘
   runtime’ => __( ‘Runtime’, ‘wpmovielibrary’ ), ‘release_date’ => __( => __( ‘
   Adult’, ‘wpmovielibrary’ ), ‘homepage’ => __( ‘Homepage’, ‘wpmovielibrary’ ),‘
   isbn’ => __( ‘Isbn’, ‘wpmovielibrary’ ) ) ),

Viewing 1 replies (of 1 total)

The topic ‘Custom Fields implementation’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wpmovielibrary_f6ad77.svg)
 * [WPMovieLibrary](https://wordpress.org/plugins/wpmovielibrary/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wpmovielibrary/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wpmovielibrary/)
 * [Active Topics](https://wordpress.org/support/plugin/wpmovielibrary/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wpmovielibrary/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wpmovielibrary/reviews/)

## Tags

 * [custom fields](https://wordpress.org/support/topic-tag/custom-fields/)

 * 1 reply
 * 2 participants
 * Last reply from: [electrohad](https://wordpress.org/support/users/electrohad/)
 * Last activity: [10 years, 3 months ago](https://wordpress.org/support/topic/custom-fields-implementation/#post-6797875)
 * Status: not resolved