Download the PHP package maheshwaghmare/wp-meta-fields without Composer

On this page you can find all versions of the php package maheshwaghmare/wp-meta-fields. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-meta-fields

WP Meta Fields

Register meta fields for WordPress theme and plugns. Build for WordPress developers.

Using with Composer

Install Library

If you have not composer.json then initialize it with command composer init.

if you already have the composer.json then use below command to install the package.

How to use?

Here, We have added a one Text Field for page and post types.

Our text field meta key is prefix-1-text.

We can get the meta filed value with shortcode like [mf meta_key="prefix-1-text"]

We can register many other input fields like text, textarea, password, color etc. See Field Types.

Remove package

How to add into theme/plugin?

  1. Download latest zip of framework and unzip into your theme/plugin.
  2. Add below code to initialize framework.

You can organize your directory structure as per your requirement. Instead of adding framework in root directory of plugin/theme, I'll use the inc directory. To add the framework.

  1. Create inc directory in your plugin/theme.
  2. Unzip latest release of WP Meta Fields into inc directory.
  3. Include it into your plugin/theme by adding below code.

NOTE: Make sure you have the latest version wp-meta-fields. Get the latest version from wp-meta-fields

Use sample plugin

To know how to integrate meta field framework into plugin, Use the sample plugin

How to add meta box?

Use function mf_add_meta_box() to register meta box and its meta fields. It contain parameters which are used for WordPress function add_meta_box()

E.g.

Register meta box for post type Post.

Where,

Parameter Description
id (string) (Required) Meta box ID (used in the 'id' attribute for the meta box).
title (string) (Required) Title of the meta box.
screen (string array WP_Screen) (Optional) The screen or screens on which to show the box (such as a post type, 'link', or 'comment'). Accepts a single screen ID, WP_Screen object, or array of screen IDs. Default is the current screen. If you have used add_menu_page() or add_submenu_page() to create a new screen (and hence screen_id), make sure your menu slug conforms to the limits of sanitize_key() otherwise the 'screen' menu may not correctly render on your page. Default value: null
context (string) (Optional) The context within the screen where the boxes should display. Available contexts vary from screen to screen. Post edit screen contexts include 'normal', 'side', and 'advanced'. Comments screen contexts include 'normal' and 'side'. Menus meta boxes (accordion sections) all use the 'side' context. Global. Default value: 'advanced'
priority (string) (Optional) The priority within the context where the boxes should show ('high', 'low'). Default value: 'default'

How to add fields?

Register single text field which have a unique meta key prefix-1-text our above registered meta box.

Here,

Parameter Description
prefix-1-text Unique meta key.
type Field type.
title Field title.
description Field description.
hint Field hint.
default Field default value.

Above registered field is looks like below screenshot in the post edit window.

All Meta Box

How to print/retrieve meta field value.

To retrieve/print the value of our registered field prefix-1-text use:


  1. Use shortcode [mf meta_key="META_KEY" post_id="POST_ID"] to print the meta value.

E.g. [mf meta_key='prefix-1-text'] By default it get the current post ID by using function get_the_ID().

OR [mf meta_key='prefix-1-text' post_id='46'] Specific post meta value by passing post ID.

  1. Use function mf_meta() to print the meta value.

E.g. ` By default it get the current post ID by using functionget_the_ID()`.

OR `` Specific post meta value by passing post ID.

  1. Use function mf_get_meta() to retrieve the meta value.

E.g. ` By default it get the current post ID by using functionget_the_ID()`.

OR `` Specific post meta value by passing post ID. E.g.

Field Types

Now, Framework support below build in HTML5 field support.

Examples

All Meta Field:

It generate the meta box and meta fields like below screenshot.

All Meta Box


All versions of wp-meta-fields with dependencies

PHP Build Version
Package Version
Requires php Version >=5.3.0
composer/installers Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package maheshwaghmare/wp-meta-fields contains the following files

Loading the files please wait ....