Skip to content

bobbingwide/oik-media

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

oik-media

banner

Description

Implements media related field types for oik-fields.

Field types supported

  • media - stored as a post ID - e.g. noderef. Displayed as the image thumbnail or filename if not an image.

Shortcodes

Media fields are displayable using [bw_field], [bw_fields], [bw_new] and other shortcodes that support field display.

Action and filter hooks

Follow this code...

add_action( "oik_pre_theme_field", "oik_media_pre_theme_field" ); add_action( "oik_pre_form_field", "oik_media_pre_form_field" ); add_filter( "bw_field_validation_date", "oik_media_field_validation_date", 10, 3 ); add_filter( "oik_query_field_types", "oik_media_query_field_types" ); add_filter( "oik_default_meta_value_date", "oik_media_default_meta_value_date", 10, 2 ); add_action( "oik_loaded", "oik_media_oik_loaded" );

Installation

  1. Upload the contents of the oik-media plugin to the `/wp-content/plugins/oik-media' directory
  2. Activate the oik-media plugin through the 'Plugins' menu in WordPress

Frequently Asked Questions

What are the dependencies?

oik-media is an extension to the oik-fields plugin. It is dependent upon oik-fields and oik. You can use it with oik-types.

When would I need to use oik-media?

When you want to add an attachment of a particular type to a custom post type ( CPT ) and rather not do it just by using Add Media.

What other plugins support media?

Here are some that provide a field type with a programming interface

  • AdvancedCustomFields/acf - image, media

Here are some that use attachments in their user interface:

  • easydigitaldownloads/easy-digital-downloads - download
  • WooCommerce - product images and product gallery?

These plugins are directly aimed at supporting media upload:

What does it need to make it work?

  • The meta box needs a form which will support multipart upload using AJAX
  • The meta box should also have selection box from which to choose an existing attachment
  • The front end also needs a form which will support multipart upload

Screenshots

  1. oik-media in action

Upgrade Notice

0.1.1

Update for support for PHP 8.1 and PHP 8.2

0.1.0

Update to avoid the Warning message from exit_read_data()

0.0.1

Required for bigram.co.uk

0.0.0

New plugin, available from GitHub.

Changelog

0.1.1

  • Changed: Add PHPUnit tests for PHP 8.1 and PHP 8.2 #6
  • Tested: With WordPress 6.4.1 and WordPress Multisite
  • Tested: With Gutenberg 17.0.2
  • Tested: With PHP 8.1 and PHP 8.2
  • Tested: With PHPUnit 9.6

0.1.0

  • Fixed: Avoid warnings from exif_read_data #4
  • Changed: Add support to set/change image orientation
  • Tested: With WordPress 5.9.3 and WordPress Multi Site
  • Tested: With Gutenberg 13.1.0
  • Tested: With PHP 8.0

0.0.1

  • Added: Form and validation functions for media #1
  • Added: Develop oik_media_get_file_date() #2
  • Added: Create the attachment as part of the validation
  • Changed: Move oik_media_upload_form to oik-media.php
  • Changed: Write oik_media_lazy_upload_form() to support a single file

0.0.0

  • Added: New plugin

Further reading

If you want to read more about the oik plugins then please visit the oik plugin "the oik plugin - for often included key-information"

About

oik-fields extension for Media - attached images and other files

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages