{"id":28383858,"url":"https://github.com/cedaro/metamedia","last_synced_at":"2025-06-25T22:31:11.527Z","repository":{"id":8642981,"uuid":"10292280","full_name":"cedaro/metamedia","owner":"cedaro","description":"A WordPress plugin to register media selection meta boxes.","archived":false,"fork":false,"pushed_at":"2014-09-19T19:05:01.000Z","size":236,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":5,"default_branch":"develop","last_synced_at":"2025-05-30T08:15:01.092Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cedaro.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-05-26T01:45:49.000Z","updated_at":"2023-08-24T15:00:20.000Z","dependencies_parsed_at":"2022-08-22T10:00:44.322Z","dependency_job_id":null,"html_url":"https://github.com/cedaro/metamedia","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/cedaro/metamedia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedaro%2Fmetamedia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedaro%2Fmetamedia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedaro%2Fmetamedia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedaro%2Fmetamedia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cedaro","download_url":"https://codeload.github.com/cedaro/metamedia/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cedaro%2Fmetamedia/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261962190,"owners_count":23236884,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-30T07:38:09.648Z","updated_at":"2025-06-25T22:31:11.518Z","avatar_url":"https://github.com/cedaro.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Metamedia #\n\nA WordPress plugin to register media selection meta boxes.\n\n__Contributors:__ [Brady Vercher](https://github.com/bradyvercher)  \n__Requires:__ 3.5  \n__Tested up to:__ 4.0  \n__License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)\n\nWith the release of WordPress 3.5, an effort was made to decouple attachments from the posts where they were uploaded, which was a shift from previous versions, and a greater emphasis was placed on the `[gallery]` shortcode. Backward compatibility was maintained, but it became a little less intuitive to manage a gallery of images that were simply attached to a post. In any case it has always been a little difficult to select multiple featured images, or multiple galleries, for use in different areas in a template.\n\nMetamedia allows for registering simple meta boxes like the \"Featured Image\" meta box for selecting a single image or gallery of images to be stored in a post meta field for easy retrieval and usage in templates. It can be used with any post type and uses the native media frame.\n\n![Gallery Meta Box](https://raw.github.com/cedaro/metamedia/master/screenshot-1.png)  \n_An example gallery meta box. The images can be sorted directly in the meta box._\n\n![Featured Image Meta Box](https://raw.github.com/cedaro/metamedia/master/screenshot-2.png)  \n_An example meta box with custom labels for selecting a single image._\n\n## Usage ##\n\nTo add a meta box similar to the \"Featured Post\" meta box, simply register it using `register_metamedia_metabox()` like this:\n\n```php\nfunction themename_register_metamedia() {\n\tif ( ! is_admin() || ! function_exists( 'register_metamedia_meta_box' ) ) {\n\t\treturn;\n\t}\n\n\t// Register a meta box for assigning a 'hero' image to posts.\n\tregister_metamedia_meta_box( 'hero', 'post' );\n}\nadd_action( 'init', 'themename_register_metamedia' );\n```\n\nNow in a template, the image ID can be retrieved using `get_post_meta( $post_id, 'hero', true )`.\n\n### Methods\n\nThe parameters for both methods are the same. Most labels and properties of registered meta boxes and the media modal can be customized using the optional `$args` parameter.\n\n__`register_metamedia_meta_box( $meta_key, $post_type, $args = array() )`__\n\n__`register_metamedia_gallery_meta_box( $meta_key, $post_type, $args = array() )`__\n\n\u003ctable\u003e\u003ccaption\u003e\u003ch3\u003eArguments\u003c/h3\u003e\u003c/caption\u003e\n  \u003cthead\u003e\n    \u003ctr\u003e\n      \u003cth\u003eKey\u003c/th\u003e\n      \u003cth\u003eDescription\u003c/th\u003e\n      \u003cth\u003eExample\u003c/th\u003e\n    \u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cstrong\u003e\u003ccode\u003emeta_box_title\u003c/code\u003e\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd\u003eThe title of the meta box.\u003c/td\u003e\n\t  \u003ctd\u003e\u003cem\u003e\u003ccode\u003eHero Image\u003c/code\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cstrong\u003e\u003ccode\u003emeta_box_context\u003c/code\u003e\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd\u003eWhere the meta box should appear.\u003c/td\u003e\n      \u003ctd\u003e\u003cem\u003e\u003ccode\u003eside\u003c/code\u003e\u003c/em\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\t\u003ctr\u003e\n\t\t\u003ctd\u003e\u003cstrong\u003e\u003ccode\u003echoose_label\u003c/code\u003e\u003c/strong\u003e\u003c/td\u003e\n\t\t\u003ctd\u003eLabel of the button used to open the media frame.\u003c/td\u003e\n\t\t\u003ctd\u003e\u003cem\u003e\u003ccode\u003eSelect Image\u003c/code\u003e\u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e\u003cstrong\u003e\u003ccode\u003eremove_label\u003c/code\u003e\u003c/strong\u003e\u003c/td\u003e\n\t  \u003ctd\u003eLabel of the link used to remove a selected image.\u003c/td\u003e\n\t  \u003ctd\u003e\u003cem\u003e\u003ccode\u003eRemove image\u003c/code\u003e\u003c/em\u003e\u003c/td\u003e\n\t\u003c/tr\u003e\n    \u003ctr\u003e\n      \u003ctd\u003e\u003cstrong\u003e\u003ccode\u003eframe_title\u003c/code\u003e\u003c/strong\u003e\u003c/td\u003e\n      \u003ctd\u003eThe title of the media frame.\u003c/td\u003e\n\t  \u003ctd\u003e\u003cem\u003e\u003ccode\u003e2-10\u003c/code\u003e\u003c/em\u003e\u003c/td\u003e\n    \u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003ctd\u003e\u003cstrong\u003e\u003ccode\u003eframe_button\u003c/code\u003e\u003c/strong\u003e\u003c/td\u003e\n\t  \u003ctd\u003eThe label of the button used to select an image in the media frame.\u003c/td\u003e\n\t  \u003ctd\u003e\u003cem\u003e\u003ccode\u003eUpdate Image\u003c/code\u003e\u003c/em\u003e\u003c/td\u003e\n\t\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n*Some arguments may not work with the gallery meta box. Additional arguments are available for more advanced usage.*\n\n## Installation ##\n\nMetamedia is available in the [WordPress plugin repository](https://wordpress.org/plugins/metamedia/), so it can be installed from within your admin panel like any other plugin. You may also download it directly from GitHub using one of the following methods:\n\n### Upload ###\n\n1. Download the [latest release](https://github.com/cedaro/metamedia/archive/master.zip) from GitHub.\n2. Go to the __Plugins \u0026rarr; Add New__ screen in your WordPress admin panel and click the __Upload__ tab at the top.\n3. Upload the zipped archive.\n4. Click the __Activate Plugin__ link after installation completes.\n\n### Manual ###\n\n1. Download the [latest release](https://github.com/cedaro/metamedia/archive/master.zip) from GitHub.\n2. Unzip the archive.\n3. Copy the folder to `/wp-content/plugins/`.\n4. Go to the __Plugins__ screen in your WordPress admin panel and click the __Activate__ link under Metamedia.\n\nRead the Codex for more information about [installing plugins manually](http://codex.wordpress.org/Managing_Plugins#Manual_Plugin_Installation).\n\n### Git ###\n\nClone this repository in `/wp-content/plugins/`:\n\n`git clone git@github.com:cedaro/metamedia.git`\n\nThen go to the __Plugins__ screen in your WordPress admin panel and click the __Activate__ link under Metamedia.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedaro%2Fmetamedia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcedaro%2Fmetamedia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcedaro%2Fmetamedia/lists"}