Created
April 20, 2013 14:41
-
-
Save netaustin/5426205 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// using Fieldmanager for a slideshow - any number of slides, with any number of related links | |
add_action( 'init', function() { | |
$fm = new Fieldmanager_Group( array( | |
'name' => 'slideshow', | |
'limit' => 0, | |
'label' => 'New Slide', | |
'label_macro' => array( 'Slide: %s', 'title' ), | |
'add_more_label' => 'Add another slide', | |
'collapsed' => True, | |
'children' => array( | |
'title' => new Fieldmanager_Textfield( 'Slide Title' ), | |
'slide' => new Fieldmanager_Media( 'Slide' ), | |
'description' => new Fieldmanager_RichTextarea( 'Description' ), | |
'posts' => new Fieldmanager_Autocomplete( 'Related Posts', array( | |
'limit' => 0, | |
'one_label_per_item' => False, | |
'add_more_label' => 'Add another related link', | |
'datasource' => new Fieldmanager_Datasource_Post( array( | |
'query_args' => array( | |
'post_status' => 'any', | |
), | |
) ), | |
) ), | |
), | |
) ); | |
$fm->add_meta_box( 'Slides', array( 'post' ) ); | |
} ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment