Skip to content
This repository was archived by the owner on Nov 4, 2022. It is now read-only.

Commit 3b790c9

Browse files
committed
Flatten assets folder
1 parent e867adf commit 3b790c9

File tree

315 files changed

+17417
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

315 files changed

+17417
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
I"�{"source"=>"/var/www/html/docs", "destination"=>"/var/www/html/docs/_site", "collections_dir"=>"", "cache_dir"=>".jekyll-cache", "plugins_dir"=>"_plugins", "layouts_dir"=>"_layouts", "data_dir"=>"_data", "includes_dir"=>"_includes", "collections"=>{"posts"=>{"output"=>true, "permalink"=>"/:categories/:year/:month/:day/:title/"}, "docs"=>{"permalink"=>"/:path/", "output"=>true}}, "safe"=>false, "include"=>[".htaccess"], "exclude"=>[".sass-cache", ".jekyll-cache", "gemfiles", "Gemfile", "Gemfile.lock", "node_modules", "vendor/bundle/", "vendor/cache/", "vendor/gems/", "vendor/ruby/"], "keep_files"=>[".git", ".svn"], "encoding"=>"utf-8", "markdown_ext"=>"markdown,mkdown,mkdn,mkd,md", "strict_front_matter"=>false, "show_drafts"=>nil, "limit_posts"=>0, "future"=>false, "unpublished"=>false, "whitelist"=>[], "plugins"=>["jekyll-seo-tag"], "markdown"=>"kramdown", "highlighter"=>"rouge", "lsi"=>false, "excerpt_separator"=>"\n\n", "incremental"=>false, "detach"=>false, "port"=>"4000", "host"=>"127.0.0.1", "baseurl"=>nil, "show_dir_listing"=>false, "permalink"=>"pretty", "paginate_path"=>"/page:num", "timezone"=>nil, "quiet"=>false, "verbose"=>false, "defaults"=>[{"scope"=>{"path"=>""}, "values"=>{"layout"=>"default"}}, {"scope"=>{"path"=>"", "type"=>"docs"}, "values"=>{"layout"=>"default"}}], "liquid"=>{"error_mode"=>"warn", "strict_filters"=>false, "strict_variables"=>false}, "kramdown"=>{"auto_ids"=>true, "toc_levels"=>"1..6", "entity_output"=>"as_char", "smart_quotes"=>"lsquo,rsquo,ldquo,rdquo", "input"=>"GFM", "hard_wrap"=>false, "guess_lang"=>true, "footnote_nr"=>1, "show_warnings"=>false}, "title"=>"Meta Box Documentation", "description"=>"Documentation for Meta Box - a simple yet powerful WordPress plugin that helps developers build custom meta boxes and custom fields.", "author"=>"MetaBox.io", "twitter"=>{"username"=>"wpmetabox"}, "social"=>{"name"=>"Meta Box", "links"=>["https://twitter.com/wpmetabox", "https://www.facebook.com/wpmetabox", "https://github.com/wpmetabox"]}, "lang"=>"en", "logo"=>"https://docs.metabox.io/assets/images/logo.png", "sass"=>{"style"=>"compressed"}, "livereload_port"=>35729, "serving"=>true, "watch"=>true, "url"=>"http://localhost:4000"}:ET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
I"<p>Not Found</p>
2+
:ET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
I"<p>rwmb_set_meta</p>
2+
:ET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
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>
10+
11+
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nl">"repositories"</span><span class="p">:</span><span class="w"> </span><span class="p">[{</span><span class="w">
12+
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"composer"</span><span class="p">,</span><span class="w">
13+
</span><span class="nl">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://packages.metabox.io/YOUR_API_KEY"</span><span class="w">
14+
</span><span class="p">}]</span><span class="err">,</span><span class="w">
15+
</span></code></pre></div></div>
16+
17+
<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>
26+
27+
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nl">"require"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
28+
</span><span class="nl">"meta-box/meta-box-group"</span><span class="p">:</span><span class="w"> </span><span class="s2">"dev-master"</span><span class="p">,</span><span class="w">
29+
</span><span class="nl">"meta-box/meta-box-columns"</span><span class="p">:</span><span class="w"> </span><span class="s2">"dev-master"</span><span class="p">,</span><span class="w">
30+
</span><span class="nl">"meta-box/mb-settings-page"</span><span class="p">:</span><span class="w"> </span><span class="s2">"dev-master"</span><span class="p">,</span><span class="w">
31+
</span><span class="p">}</span><span class="w">
32+
</span></code></pre></div></div>
33+
34+
<p>So, your final <code class="highlighter-rouge">composer.json</code> will be:</p>
35+
36+
<div class="language-json highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">{</span><span class="w">
37+
</span><span class="nl">"repositories"</span><span class="p">:</span><span class="w"> </span><span class="p">[{</span><span class="w">
38+
</span><span class="nl">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"composer"</span><span class="p">,</span><span class="w">
39+
</span><span class="nl">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://packages.metabox.io/YOUR_API_KEY"</span><span class="w">
40+
</span><span class="p">}],</span><span class="w">
41+
</span><span class="nl">"require"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
42+
</span><span class="nl">"meta-box/meta-box-group"</span><span class="p">:</span><span class="w"> </span><span class="s2">"dev-master"</span><span class="p">,</span><span class="w">
43+
</span><span class="nl">"meta-box/meta-box-columns"</span><span class="p">:</span><span class="w"> </span><span class="s2">"dev-master"</span><span class="p">,</span><span class="w">
44+
</span><span class="nl">"meta-box/mb-settings-page"</span><span class="p">:</span><span class="w"> </span><span class="s2">"dev-master"</span><span class="p">,</span><span class="w">
45+
</span><span class="p">}</span><span class="w">
46+
</span><span class="p">}</span><span class="w">
47+
</span></code></pre></div></div>
48+
49+
<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>
50+
51+
<p>To install the extensions, simply run:</p>
52+
53+
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>composer <span class="nb">install</span>
54+
</code></pre></div></div>
55+
56+
<p>Alternatively, you can install the extensions via command line without editing <code class="highlighter-rouge">composer.json</code>:</p>
57+
58+
<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>composer require meta-box/meta-box-group:dev-master
59+
</code></pre></div></div>
60+
61+
<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>
64+
65+
<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">require</span> <span class="s1">'vendor/autoload.php'</span><span class="p">;</span>
66+
</code></pre></div></div>
67+
68+
<p>Now Meta Box extensions are available in your plugin/theme and you can start using them!</p>
69+
70+
<div class="alert alert-info">
71+
72+
<svg class="icon icon-info" aria-hidden="true" role="img"><use href="#icon-info" xlink:href="#icon-info"></use></svg>
73+
74+
<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>
81+
82+
<iframe width="560" height="315" src="https://www.youtube.com/embed/khiCSMh3DY0" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen=""></iframe>
83+
84+
<h2 id="versions--updates">Versions &amp; 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>
92+
<li>Clear Composer cache</li>
93+
<li>Run <code class="highlighter-rouge">composer install</code> command again</li>
94+
</ul>
95+
96+
<p>You can do that with this command:</p>
97+
98+
<div class="highlighter-rouge"><div class="highlight"><pre class="highlight"><code>rm -rf vendor &amp;&amp; composer clear-cache &amp;&amp; composer install
99+
</code></pre></div></div>
100+
101+
<h2 id="futher-reading">Futher reading</h2>
102+
103+
<ul>
104+
<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>
106+
</ul>
107+
:ET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
I"�<h2 id="overview">Overview</h2>
2+
3+
<p>The hidden field creates a simple hidden input. It’s usually used to store custom data that cannot be changed.</p>
4+
5+
<h2 id="settings">Settings</h2>
6+
7+
<p>This field doesn’t have any specific settings. It only uses <a href="/field-settings/">common field settings</a>.</p>
8+
9+
<p>To store the hidden value, put it in the <code class="highlighter-rouge">std</code> setting.</p>
10+
11+
<h2 id="sample-code">Sample code</h2>
12+
13+
<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">array</span><span class="p">(</span>
14+
<span class="s1">'id'</span> <span class="o">=&gt;</span> <span class="s1">'field_id'</span><span class="p">,</span>
15+
<span class="s1">'type'</span> <span class="o">=&gt;</span> <span class="s1">'hidden'</span><span class="p">,</span>
16+
<span class="c1">// Hidden field must have predefined value</span>
17+
<span class="s1">'std'</span> <span class="o">=&gt;</span> <span class="s1">'Hidden value'</span><span class="p">,</span>
18+
<span class="p">),</span>
19+
</code></pre></div></div>
20+
21+
<h2 id="data">Data</h2>
22+
23+
<p>Although the value is fixed in the code, this field still saves it in the post meta.</p>
24+
25+
<h2 id="template-usage">Template usage</h2>
26+
27+
<p>To get the field value, use this code</p>
28+
29+
<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$value</span> <span class="o">=</span> <span class="nx">rwmb_meta</span><span class="p">(</span> <span class="nv">$field_id</span> <span class="p">);</span>
30+
<span class="k">echo</span> <span class="nv">$value</span><span class="p">;</span>
31+
</code></pre></div></div>
32+
33+
<p>Read more about <a href="/rwmb-meta/">rwmb_meta()</a>.</p>
34+
:ET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
I"<p>Meta Box Tooltip</p>
2+
:ET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
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>
2+
:ET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
I"<h2 id="overview">Overview</h2>
2+
3+
<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>
4+
5+
<h2 id="screenshot">Screenshot</h2>
6+
7+
<p><img src="https://i.imgur.com/F64cxNe.png" alt="oembed" /></p>
8+
9+
<h2 id="settings">Settings</h2>
10+
11+
<p>Besides the <a href="/field-settings/">common settings</a>, this field has the following specific settings:</p>
12+
13+
<table>
14+
<thead>
15+
<tr>
16+
<th>Name</th>
17+
<th>Description</th>
18+
</tr>
19+
</thead>
20+
<tbody>
21+
<tr>
22+
<td><code class="highlighter-rouge">size</code></td>
23+
<td>Input size. Default <code class="highlighter-rouge">30</code>. Optional.</td>
24+
</tr>
25+
<tr>
26+
<td><code class="highlighter-rouge">not_available_string</code></td>
27+
<td>The text message displayed to users when no the embed is not available. Accepts HTML.</td>
28+
</tr>
29+
</tbody>
30+
</table>
31+
32+
<h2 id="sample-code">Sample code</h2>
33+
34+
<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">array</span><span class="p">(</span>
35+
<span class="s1">'id'</span> <span class="o">=&gt;</span> <span class="s1">'oembed'</span><span class="p">,</span>
36+
<span class="s1">'name'</span> <span class="o">=&gt;</span> <span class="s1">'oEmbed(s)'</span><span class="p">,</span>
37+
<span class="s1">'type'</span> <span class="o">=&gt;</span> <span class="s1">'oembed'</span><span class="p">,</span>
38+
39+
<span class="c1">// Input size</span>
40+
<span class="s1">'size'</span> <span class="o">=&gt;</span> <span class="mi">30</span><span class="p">,</span>
41+
<span class="p">),</span>
42+
</code></pre></div></div>
43+
44+
<h2 id="data">Data</h2>
45+
46+
<p>This field saves the media URL in the post meta.</p>
47+
48+
<h2 id="template-usage">Template usage</h2>
49+
50+
<p>To output the media in the frontend, use the <a href="/rwmb-meta/">rwmb_meta()</a> helper function:</p>
51+
52+
<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$media</span> <span class="o">=</span> <span class="nx">rwmb_meta</span><span class="p">(</span> <span class="nv">$field_id</span> <span class="p">);</span>
53+
<span class="k">echo</span> <span class="nv">$value</span><span class="p">;</span>
54+
</code></pre></div></div>
55+
56+
<p>This helper function will display the oembed content, e.g. if the value is a Youtube URL, it will display the full Youtube video player.</p>
57+
58+
<p>In case you want to get the URL of the field, use this code:</p>
59+
60+
<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nv">$url</span> <span class="o">=</span> <span class="nx">rwmb_get_value</span><span class="p">(</span> <span class="nv">$field_id</span> <span class="p">);</span>
61+
<span class="k">echo</span> <span class="nv">$url</span>
62+
</code></pre></div></div>
63+
64+
<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>
69+
70+
<p>Use the filter as follows:</p>
71+
72+
<div class="language-php highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nx">add_filter</span><span class="p">(</span> <span class="s1">'rwmb_oembed_not_available_string'</span><span class="p">,</span> <span class="k">function</span><span class="p">(</span> <span class="nv">$message</span> <span class="p">)</span> <span class="p">{</span>
73+
<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>
74+
<span class="k">return</span> <span class="nv">$message</span><span class="p">;</span>
75+
<span class="p">}</span> <span class="p">);</span>
76+
</code></pre></div></div>
77+
78+
<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 &gt; Additional CSS</em>:</p>
79+
80+
<div class="language-css highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nc">.rwmb-oembed-not-available</span> <span class="p">{</span>
81+
<span class="nl">display</span><span class="p">:</span> <span class="nb">none</span><span class="p">;</span>
82+
<span class="p">}</span>
83+
</code></pre></div></div>
84+
:ET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
I"�<p>Documentation for Meta Box - a simple yet powerful WordPress plugin that helps developers build custom meta boxes and custom fields.</p>
2+
:ET
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
I"�<p><code class="highlighter-rouge">rwmb_set_meta</code> is a helper function that helps you to set meta value for an object.</p>
2+
:ET

0 commit comments

Comments
 (0)