Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- Plugin Name: Your Plugin Name Here
- Plugin URI: http://your-site.com
- Description: Your description here.
- Version: 1.0
- Author: Your Name
- Author URI: ttp://your-site.com
- License: A "Slug" license name e.g. GPL2
- */
- add_action('save_post','ez_portfolio_gallery_save');
- add_action( 'add_meta_boxes', 'ez_portfolio_gallery_box' );
- function ez_portfolio_gallery_save($post_ID){
- global $post;
- $ez_portfolio_gallery = $_POST['ez_portfolio_gallery'];
- //verify post is not a revision
- if ( !wp_is_post_revision( $post_ID ) ) {
- add_post_meta($post_ID, 'ez_portfolio_gallery', $ez_portfolio_gallery);
- }
- }
- function ez_portfolio_gallery_box(){
- add_meta_box( 'ez_portfolio_gallery_box', 'Portfolio Gallery', 'ez_portfolio_gallery_fields', 'post' );
- }
- function ez_portfolio_gallery_fields(){
- ?>
- <label for="ez_portfolio_gallery">Image URL:</label><br />
- <input type="text" class="widefat" id="ez_portfolio_gallery" name="ez_portfolio_gallery" value="" /><br />
- <?php
- $mykey_values = get_post_custom_values( 'ez_portfolio_gallery', $post_ID );
- foreach ( $mykey_values as $key => $value ) {
- echo "$key => $value <br />";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement