WordPress Plugin: Create Custom Post Types and Custom Fields with scaffolds.
Download: http://wordpress.org/extend/plugins/magic-posts/
- Test Suite
- Scaffolding
- Retrieving Data
- Retrieving Images
- Image Data Reference
- Migrations
- Command Reference
- Custom Post Types Features
- Demos
'Singular Term' description:mini-editor
Product Price:string 'In Stock':string Shipping:string Description:editor
'Travel Album' photos:gallery
Celebrity Profile:image[200x200:crop] Album:gallery[150x150:crop, 800x600, 1024x768]
Article editor:true
[post] Photos:gallery
[page] Illustration:image Credits:string
[378] Name:string Profile:image
Article Name:string
<h4><?php echo magic_posts('Name'); ?></h4>
<h4><?php echo magic_posts(137, 'Name'); ?></h4>
Travel Album:gallery[150x150:crop, 800x600, 1024x768] Profile:image[200x200:crop]
<?php $image = magic_posts('Profile'); ?>
<img src="<?php echo $image->url('200x200:crop'); ?>" alt="<?php echo $image->alt(); ?>" />
<?php foreach(magic_posts('Album') as $image) { ?>
<a target="_blank" href="<?php echo $image->url('800x600'); ?>">
<img src="<?php echo $image->url('150x150:crop'); ?>" alt="<?php echo $image->alt(); ?>" />
</a>
<br />
<?php } ?>
$image = magic_posts(169, 'Profile');
foreach(magic_posts(169, 'Album') as $image)
Travel Profile:image Album:gallery
$image = magic_posts('Profile');
foreach(magic_posts('Album') as $image)
echo $image->url() . '<br />';
echo $image->url('800x600') . '<br />';
echo $image->url('100x100:crop') . '<br />';
echo $image->id() . '<br />';
echo $image->title() . '<br />';
echo $image->legend() . '<br />';
echo $image->alt() . '<br />';
echo $image->description() . '<br />';
print_r($image->post());
echo $image->post('ID') . '<br />';
/*
All [post] attributes:
ID, post_author, post_date, post_date_gmt, post_content, post_title,
post_excerpt, post_status, comment_status, ping_status, post_password,
post_name, to_ping, pinged, post_modified, post_modified_gmt,
post_content_filtered, post_parent, guid, menu_order, post_type,
post_mime_type, comment_count, filter
*/
print_r($image->post_meta());
echo $image->post_meta('_wp_attachment_image_alt') . '<br />';
/*
All [post_meta] attributes:
_wp_attached_file, _wp_attachment_metadata,
_wp_attachment_image_alt, _edit_lock
*/
print_r($image->metadata());
echo $image->metadata('height') . '<br />';
/*
All [metadata] attributes:
width, height, file, sizes, image_meta
*/
print_r($image->image_meta());
echo $image->image_meta('focal_length') . '<br />';
/*
All [image_meta] attributes:
aperture, credit, camera, caption, created_timestamp,
copyright, focal_length, iso, shutter_speed, title
*/
'Old Post Type' => 'New Post Type'
'Post Type' ['Old Field' => 'New Field', 'Old FieldB' => 'New FieldB']
[136] [OldField => NewField]
[post] [TheOldField => 'My NewField']
[page] ['My OldField' => TheNewField]
Command | Description |
---|---|
title:false |
Disable WordPress Title. default:true |
editor:true |
Enable WordPress Editor. default:false |
'My Field':string |
Text field. |
'My Field':text |
Textarea field. |
'My Field':editor |
Custom Wordpress Editor. |
'My Field':mini-editor |
Custom Wordpress Mini-Editor (teeny). |
'My Field':image |
Unique image from Media Library. |
'My Field':image[100x100:crop, 800x600] |
Unique image custom sizes. |
'My Field':gallery |
Multiple images from Media Library. |
'My Field':gallery[80x70:crop, 500x400, 10x20:crop] |
Multiple images custom sizes. |
WordPress Post Feature | Default |
---|---|
title | true |
editor | false |
author | false |
thumbnail | false |
excerpt | false |
trackbacks | false |
custom-fields | false |
comments | false |
revisions | false |
page-attributes | false |
post-formats | false |
Online Demo: http://gbaptista.com/galeria-de-imagens/