You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 4, 2022. It is now read-only.
I"2"<p>This documentation will show you how to install <a href="https://metabox.io/plugins">Meta Box extensions</a> via Composer.</p>
2
+
3
+
<p>If you haven’t known about <a href="https://getcomposer.org">Composer</a>, then it is a package dependency manager for PHP. The core Meta Box plugin <a href="/composer/">already supports Composer</a>. And so do its extensions.</p>
4
+
5
+
<p>You can skip the text and jump to the video tutorial below.</p>
6
+
7
+
<h2 id="setup">Setup</h2>
8
+
9
+
<p>To use Composer to install Meta Box extensions, please add <code class="highlighter-rouge">repositories</code> rule to your <code class="highlighter-rouge">composer.json</code>:</p>
<p>Please note that <strong>you need an active API Key</strong> to use Meta Box extensions with Composer. Go to <a href="https://metabox.io/my-account/">My Account</a> page to get your API Key.</p>
18
+
19
+
<p>If your license has expired, please renew it. If you don’t have any, then you need to purchase <a href="https://metabox.io/plugins/">an extension</a> or <a href="https://metabox.io/pricing/">a bundle of extensions</a>.</p>
20
+
21
+
<p>The system automatically checks if your license is still active. If yes, then you’ll granted access via Composer to Meta Box’s packages. It also ensures you have access to only extensions you purchased.</p>
22
+
23
+
<h2 id="usage">Usage</h2>
24
+
25
+
<p>To include extensions via Composer, simply add them as dependencies like this:</p>
<p><strong>Important note:</strong> the version of extensions specified in <code class="highlighter-rouge">composer.json</code> <em>must</em> be <code class="highlighter-rouge">dev-master</code>. We don’t support version constrains for Meta Box extensions yet. You always use the latest version.</p>
<p>The extensions then will be installed in the WordPress’s <code class="highlighter-rouge">wp-content/plugins</code> directory, instead of the traditional <code class="highlighter-rouge">vendor</code> folder thanks to <a href="https://github.com/composer/installers">composer/installers</a>. <code class="highlighter-rouge">composer/installers</code> is a powerful package that allows us to change the install path of packages to the specific folder we want. And by default, all Meta Box extensions have type <code class="highlighter-rouge">wordpress-plugin</code> and are installed in <code class="highlighter-rouge">wp-content/plugins</code>. For more information about <code class="highlighter-rouge">composer/installers</code>, please read <a href="https://github.com/composer/installers">this guide</a>.</p>
62
+
63
+
<p>To make the extensions work, simply load Composer’s autoload file:</p>
<p>To make it easier for developers, I’ve created a composer.json file, which contains a full list of extensions, free and premium. You can <a href="https://github.com/wpmetabox/library/blob/master/composer/composer.json">grab it here</a> and remove the extensions you don’t want to use.</p>
75
+
76
+
</div>
77
+
78
+
<h2 id="video">Video</h2>
79
+
80
+
<p>This video demonstrates how to install Meta Box extensions from wordpress.org. The approach is slightly different between premium and free extensions.</p>
<h2 id="versions--updates">Versions & Updates</h2>
85
+
86
+
<p>For your information, we only provide the latest versions of extensions (<code class="highlighter-rouge">dev-master</code>). That means you can’t set specific versions in your <code class="highlighter-rouge">composer.json</code> file.</p>
87
+
88
+
<p>Due to that issue, when you run <code class="highlighter-rouge">composer update</code> command, you might see nothing as Composer can’t load versions to check. To avoid this update issue, instead of running <code class="highlighter-rouge">composer update</code>, please:</p>
89
+
90
+
<ul>
91
+
<li>Remove the <code class="highlighter-rouge">vendor</code> folder</li>
<li><a href="https://metabox.io/introducing-composer-support-for-meta-box-extensions/">Introducing Composer support for Meta Box extensions</a></li>
105
+
<li><a href="https://metabox.io/how-to-use-composer-to-install-meta-box-extensions-from-wordpress-org/">How to use Composer to install Meta Box extensions from WordPress.org</a></li>
I"<p>With Meta Box, you can add custom attributes for inputs like text, URL, email field. This feature is very helpful if developers want to add HTML5 attributes or something like <code class="highlighter-rouge">data-*</code> attribute for their custom JavaScript code.</p>
<p>The oEmbed field creates a simple text input for entering media URL. This field offers live preview the media content. It supports <a href="https://codex.wordpress.org/Embeds">many media websites</a>.</p>
<p>Read more about <a href="/rwmb-meta/">rwmb_meta()</a> and <a href="/rwmb-get-value/">rwmb_get_value()</a>.</p>
65
+
66
+
<h2 id="hooks">Hooks</h2>
67
+
68
+
<p>The <code class="highlighter-rouge">oembed</code> field has one filter <code class="highlighter-rouge">rwmb_oembed_not_available_string</code>, which allows users to change the message for all oembed field when no embed is available.</p>
<span class="nv">$message</span> <span class="o">=</span> <span class="s1">'Sorry, what you are looking here is not available.'</span><span class="p">;</span>
<p>Developers also can hide the message with CSS, since it’s wrapped into a <code class="highlighter-rouge">div.rwmb-oembed-not-available</code>. Simply put this code into your theme or in <em>Customize > Additional CSS</em>:</p>
0 commit comments