Skip to content

Extension for awesome OptionTree plugin to display images attached to post, used in Meta Box API

Notifications You must be signed in to change notification settings

purethemes/optiontree-attachments-checkbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

OptionTree Attachments Checkbox

Extension for OptionTree WordPress plugin. Displays list of attached images to post if used in meta-boxes.php in theme mode. ( it's also possible to use in Settings Mode but doesn't make any sense ;) )

How to use it

You need to use OptionTree in "theme mode" and with meta boxes. Just add to your meta-boxes.php

 $meta_boxes = array(
    'id'        => 'metabox_slider',
    'title'     => 'Slider settings',
    'desc'      => '',
    'pages'     => array( 'post' ),
    'context'   => 'normal',
    'priority'  => 'high',
    'fields'    => array(
  		array(
	        'label' => 'Exlude photos from slider',
	        'id' => 'exluded_photos',
	        'type' => 'attachments-checkbox',
	        'desc' => 'By default all photos you have uploaded to post will be displayed in slider, here you can choose which one you want to exclude, simply by just clicking them (blue border should appear).',
	        'post_type' => 'post',
	 
	      )
    );

  ot_register_meta_box( $meta_boxes );    
$excluded = get_post_meta($post->ID, 'exluded_photos', true);

returns array with ID of selected images.

alt text

About

Extension for awesome OptionTree plugin to display images attached to post, used in Meta Box API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published