WP Manifestindependent plugin directory
manifest / content / cmb-field-gallery

CMB Field Type: Gallery WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA

Gallery field type for Custom Metaboxes and Fields for WordPress

★ 35stars
v2.0.2latest · 12 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/mustardbees/cmb-field-gallery/archive/refs/heads/master.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

[DEPRECATED] CMB Field Type: Gallery

IMPORTANT - this project is no longer supported

CMB2's file_list provides similar functionality and is probably the way to go.

I've written a quick tool to convert existing data from the pw_gallery to file_list format.

Description

Gallery field type for CMB2.

Running an older version of CMB? Check the previous releases.

Installation

You can install this field type as you would a WordPress plugin:

  1. Download the plugin
  2. Place the plugin folder in your /wp-content/plugins/ directory
  3. Activate the plugin in the Plugin dashboard

Alternatively, you can place the plugin folder in with your theme/plugin. After you call CMB:

require_once 'init.php';

Add another line to include the cmb-field-gallery.php file. Something like:

require_once 'cmb-field-gallery/cmb-field-gallery.php';

Usage

pw_gallery - Save a list of attachment IDs. Example:

array(
    'name' => 'Gallery Images',
    'desc' => 'Upload and manage gallery images',
    'button' => 'Manage gallery', // Optionally set button label
    'id'   => $prefix . 'gallery_images',
    'type' => 'pw_gallery',
    'sanitization_cb' => 'pw_gallery_field_sanitise',
),

Screenshots

Image

Image

To-do

  • Add a clear gallery button
  • Thumbnail previews

Example front-end output

<?php $gallery_images = get_post_meta( get_the_ID(), '_cmb_gallery_images', true ); ?>
<?php if ( ! empty( $gallery_images ) ) : ?>
    <ul>
        <?php foreach ( $gallery_images as $gallery_image ) : ?>
            <li><?php echo wp_get_attachment_image( $gallery_image, 'thumbnail' ); ?></li>
        <?php endforeach; ?>
    </ul>
<?php endif; ?>

Releases

5 releases.

Tag
Published
v2.0.2 latest
Sep 20, 2014 12 years ago
Sep 18, 2014 12 years ago
Sep 17, 2014 12 years ago
Apr 1, 2014 12 years ago
Apr 1, 2014 12 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.

A grade

Security

CMB Field Type: Gallery 2.0.2 · audited by WP Registry

No security issues found.

Audited release
2.0.2
Findings
none
Worst severity
—
Content hash
63a8a829aba9bbdb6943d0ce…

WP Registry hashes the installable build and reports on that exact bytes-for-bytes copy. Embargoed findings are withheld until they are disclosed, so a clean verdict means nothing public is outstanding. WP Manifest does not audit code itself.