Giter Club home page Giter Club logo

meta-box's People

Contributors

adelq avatar anderly avatar anhtu261091 avatar baden03 avatar d2roth avatar franz-josef-kaiser avatar funkatron82 avatar gwendolenlynch avatar hsimah avatar ictbeheer avatar lexuanbao161096 avatar michaelhume avatar mrkolby avatar nhatrangnet avatar omnicia avatar pemaxim avatar radeno avatar rilwis avatar ruanmer avatar samnajian avatar tanftw avatar thaoha avatar themeplugger avatar truongwp avatar tuankiet2605 avatar viet34tqc avatar vietsmiler avatar vincentboiardt avatar vinicius73 avatar wayneashleyberry avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

meta-box's Issues

Image Upload not working correctly...

The uploaded images and upload new images is not really working.

The add more file just jumps you to the top of the page and you cannot delete an existing file after you have uploaded just the one..

The meta-box is installed via the theme not the plugin and is running on WordPress 3.3 Release Candidate 1

Is this just waiting for WordPress 3.3 to be officially released to be fixed or....?

wysiwyg not saving paragraphs...

A wysiwyg within a meta box although saying the text is in a p tag, its not actually once its printed front end.

Bold tags work, as do others but the initial P tag does not.

Kind of making having the wysiwyg there a bit pointless?

Anyone else have this issue or just me?

Allow ui themeing css option

Been looking and personally i dont like the creamy ui chosen for the latest plugin version of the class. i still love the class though.

after looking at the code there is no way to filter it without touching core code.

can an option to choose custom ui theme be added to the next release?

Multi site

When I use Meta Boxes in Multi site Wordpress blog.,
my blog often crash when i ty to deactive the plugin.

Callback function as field type?

Hi Rilwis, first I'd like to thank you for this wonderful script.

Sometimes you need to customize the metabox a little further. It happened to me several times and I had to add the metabox outside the class, with the add_meta_box function. So why not include a callback function to display some custom code into the metabox, or at least before/after the input? I think it might be an all-round solution.

Looking forward to see updates! Thanks again.

dismiss label if 'name' attr empty || ! isset

As the title says, I'm searching for a nice way - that works for all core field classes - to dismiss the label if the name attribute is not set or empty.

Currently I'm thinking about a helper function to check this and - if it's the case - override the $html with the beginn_{$field['id']}_html filter.

What's your thoughts?

jQuery .delegate() vs. .on()

Currently we got jQuery 1.7 in WP Core

jQuery official documentation says, that we should now start using .on() instead.

Any ideas on this one?

[Feature Request] Number of file

I’m using the ‘file’ type to upload a single file. However the admin area enables the user to upload many files instead. Could you perhaps add a different type for multiple files (e.g. ‘files’) or something like how many files you would like the user to upload?

Something like:

‘type’ => ‘file’ // Field type: file upload
‘number_of_files’ => 1 // Number of files a user can upload, use ’0′ for infinite.

The reason is that enabling multiple file uploads could lead to expectations in the front-end and possible problems with retrieving the single (first file) in the list. Also I prefer to have my end-user get as clean an interface as possible.

link to comment

Save field content as single value

Currently do_field_class_actions always saves an array, due to $args[] = $field. This is a little bit annoying, as it successfully prevents meta queries. We need to add a single_value argument.

[Feature Request] Repeatable fields

This meta-box class is my favourite! It's well maintained and easy to use, without a bloaty UI.

I would love to have an option of making fields repeatable.

[Bug] Hyphen or underscore in $field['id']

This is a bug reported by another person:

However, when someone chooses a WYSIWYG field, it displays incorrectly if there is a hyphen or underscore in $field['id'], because the wp_editor function does not accept anything but lowercase letters for the editor ID.

This is how I fixed it:

$editorid=str_replace("-","",$field['id']);
wp_editor($meta, $editorid, array('textarea_name'=>$field['id'],'editor_class' => 'rwmb wysiwyg'));

Of course, this only removes hyphens to make the display correct. The script should also replace underscores, other special characters, and convert uppercase characters to lowercase. (I haven't had time to work on that yet.) However, it still passes the $field['id'] value as the name of the text area, which will allow the information in the box to be saved with that ID.

Taxonomy dropdown

I've created custom taxonomy called Models and made it hierarchical so I can add Car brands, models and versions there and keep their relations, like this:

-Ford
--Mustang
---Cobra

-Ferrari
-- 308
--- GTS

Problem is, this list might get pretty long and only one brand, one model and one version is needed per post, so checkboxes are misleading.

I'm thinking to split that metabox in to three (one for brand, one for model and another for version) and make them dropdowns. So when brand is selected in the first dropdown, second dropdown would show only models related to that brand, and the same for version. But i have no idea how to code it. Maybe anyone could show me an example?

Thanks!

Using New Media Uploader in WordPress 3.3 (beta)?

WordPress 3.3 has a new media uploader incorporating drag and drop.

Can this be incorporated into the new script?

Perhaps attaching images like a featured/thumbnail image also so a single image can be used across multiple posts/pages. As currently once an image is attached with the meta box uploader it cannot be used on any other post or page.

"Delete File" stopped working

So far (with a fresh download), I can't delete files anymore. I constantly get the alert() in my local install. I wasn't able to debug this one.

what happened to the wordpress upload iframe???

what happended to the thickbox upload that we had in the old versions??

ive just updated and just get a file input with options to add more????

the old version was better, whats happened

clone does not work with taxonomy field

Hey there,

just tried to create a taxonomy field with cloning functionality.
The cloning UI does appear and work, but only the last value is being saved.

The only workaround right now is to create a select box with the category list as options.

Cheers

On page custom taxonomy want work

Hi! I think ther's a problem when saving data from a custom meta in the page

i've used this code:

$meta_boxes[] = array(
'id' => 'lastm_users',
'title' => 'Crea la Pagina Utente',
'pages' => array('page', 'post'),
'context' => 'normal',
'priority' => 'high',

'fields' => array(
    array(
        'name' => 'Nome Utente Schedahotel',
        'id' => $prefix . 'little_author',
        'type' => 'select',
        'options' => $myusersid,
        'std' => ''
    ),
    array(
        'name' => 'Località Categoria',
        'id' => $prefix . 'little_catego',
        'type' => 'taxonomy',
        'options' => array(
            'taxonomy' => 'luogolastminute',
            'type' => 'select',
            'args' => array()
        ),
        'desc' => 'Scegli il luogo da associare'
    )
)

);

I have a prefix 'pv_'

When i call in my page with that function: get_post_meta($post->ID, 'pv_little_catego', true);

Display nothing

Unchecked checkboxes get checked again at next page load

In version 3.2.2 at line 226 the function show() checks if a custom field has any value: if not, it declares the default value. See:
$meta = ($meta !== ”) ? $meta : $field['std'];

But when a checkbox is unchecked, no data is saved and the next time the field gets loaded, it gets the standard value. If the default value is 1, true, ‘on’ or ‘checked’ an unchecked checkbox always automatically gets checked again!

A solution might be to always save a value, also when a checkbox is unchecked. Like FALSE, 0 or ‘off’…

Clone Button UI & UX

Currently we got [1], where

  • the button is below the label
  • We got a "delete" button for also for the first field, which is not deleteable

We already had [2], where

  • the button was upon the label
  • No delete button for the first field
  • The button deleted/cloned exactly the field that it was attached to

Now I see the reducement in code complexity + lines from my version to @rilwis improvements (a.k.a. the current version).

Could we go one step further and try to get the best from both worlds? This is no call to code, but more a "what would be the smartest way to extend the current solution for a better UX?".

[1] The new interface

[2] The first version

Demo new_class & WP_Walker

We should really use the built in Walker class (/wp-includes/class-wp-walker.php) instead of walk_checkbox_tree() if possible. Else it's imho a bad practice example :)

Add screenshots folder

People love images and prefer them over reading :P

We should add a screenshot folder and drop some default images for every input field in there. Discussion: Predefine look - drop shadow, border (-color), textsize, etc.

Settings Pages

@rilwis @funkedgeek

I added a branch settings_page to my fork.

You will have to take a look at /root/settings_page.php and add /root/demo/demo-settings_page.php.

To run the demo, you need to add

include_once RWMB_DIR.'demo/demo-settings_page.php';
include_once RWMB_DIR.'settings_page.php';

List of things that are tested & work:

  • Has Screen Options
  • Screen Options: 1 & 2 column layout (save & reload to try out)
  • Static Meta Boxes (which are just a proof that the page hooks work) get being added. Take a look at RW_Meta_Box_Settings_Page::show(); line 120
  • Adding title, $page_hook, capability for the settings page
  • Registers without a problem as last item within the registered "pages"/post_type sub menu
  • Help tab incl. contents - multiple tabs possible

List of things that don't work:

  • Keep meta boxes in position
  • Register meta boxes on 'side' context
  • Register custom RW_Meta_Box meta boxes
  • Saving process (So far haven't even really touched as this should work via the Settings API)

List of things to come:

  • Settings sections - like you know it from Settings pages - Settings API
  • Tabs - like you know it from Appearance » Theme select pages
    One Section = One Tab

Here's the "funny" thing: When inspecting the meta boxes, you see that they're registered and should appear. Go down to Line 190 in settings_page.php and uncomment the debug function. Then you see that everything seems to be right. I simply got no idea (and no more time) of what's wrong around here.

I would appreciate if you could take a look

Form fields not being generated

Hey guys-

I'm trying to include version 4.1 into my theme and have followed your instructions in the wiki on how to do that. I downloaded the master zip file from here.

To verify that I am doing it correctly, here's a screenshot: http://cl.ly/D9bo

I pasted the code from demo.php into the config-meta-boxes.php. Here's a screenshot of what it looks like in the post editor: http://cl.ly/D9gh

I'm not getting any debugging errors from Wordpress, and I'm running 3.3.1. Any help would be appreciated.

Translation problem

Someone has reported the problem with translation (to Italian):

In the po file some string are double (i.e. : delete, Upload file); i have translated but why double? And... the mo file don't work; as you see in the zip file , i have set the name of the file as rwmb-it_IT.mo because in the meta-box.php (line 125) the mo file in

$l18n_file = "{$dir}/{$domain}-{$GLOBALS['locale']}.mo";

with at line 30

define( 'RWMB_TEXTDOMAIN', 'rwmb' );

but the italian translation don't work.

remove style for textarea and switch args to cols/rows

We're missing cols and rows input/definition arguments for the textarea form field. Exactly here in demo.php we're even teaching people to use inline styles (which imho is bad). On the other hand: We can put the style definition there as it won't do anything - the arguemnt simply isn't taken.

4.0.2 gives white screen of death

Just updated to version 4.0.2 and unfortunately that gave me the white screen of death. Reverting back to 4.0.1 didn't solve it however and deleting the plugin also didn't help.

The only thing that worked, was to delete the demo.php from my theme. I have given this demo.php file a different name (sl_metaboxes.php) and added it to the includes folder of my theme. In my functions.php file I have called it as:
// Include Metaboxes script
include 'includes/sl_metaboxes.php';

My error log says the following:
[21-Dec-2011 07:48:48] PHP Fatal error: Class 'RW_Meta_Box' not found in /.../.../public_html/domain/wp-content/themes/salt2011/includes/sl_metaboxes.php on line 145

Line 145 calls this:
143: // Register meta boxes
144: foreach ( $meta_boxes as $meta_box ) {
145: new RW_Meta_Box( $meta_box );
146: }

Now what I don't understand is that version 4.0.1 worked with my setup, but after updating to 4.0.2 and then downgrading back to 4.0.1 it doesn't work anymore.

I have temporarily deleted the sl_metaboxes.php file, but if we cannot find a solution soon, I will have to revert back to the old hard-coded script instead of the plugin.

Looking forward to hear other experiences and hopefully a solution.

Thanks,
Piet

Notice: Undefined index after last upgrade

Hello,

Having just upgraded to the latest release I'm now receiving this error having the WP debug mode enabled: Notice: Undefined index: class in /meta-box.php on line 222.

Taxonomy Not Working

There's a strange error with the taxonomy field (checkbox_list or select) the output is always empty, if i change the $prefix the selected values are still there only for that field, when i check another post or page that includes that option , a random checkbox is selected on each post or page even if the post was not saved with those options.

I'm using the default code (no changes) and the code is inside my plugins folder. i'm not sure if i'm doing something wrong.

Warning: in_array() [function.in-array]:

I get the following error at the top of the first 'Personal Information' Meta Box, when both used as a plugin and not.....

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home//public_html/colTest/wp-content/themes/test/meta-boxes/meta-box-test/demo/demo.php on line 73

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /home//public_html/colTest/wp-content/themes/test/meta-boxes/meta-box-test/demo/demo.php on line 73

Tinymce wysiwyg editor also doesn't show in WordPress 3.3 beta 2.

Option to select pages?

Hello, i try to get an option with select or checkbox list with published pages, but i don't know how make them... i try use a new class, but i can't make to work, do you can help me?

thank you very much for your time.

// show pages list
function show_field_pages($field, $meta) {
    global $post;

    if (!is_array($meta)) $meta = (array) $meta;

    $this->show_field_begin($field, $meta);

    $options = $field['options'];
    $pages = get_pages($options['args']);

    // checkbox_list
    if ('checkbox_list' == $options['type']) {
        foreach ($pages as $page) {
            echo "<input type='checkbox' name='{$field['id']}[]' value='$page->ID'" . checked(in_array($page->ID, $meta), true, false) . " /> $page->name<br/>";
        }
    }
    // select
    else {
        echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">";

        foreach ($pages as $page) {
            echo "<option value='$page->ID'" . selected(in_array($page->ID, $meta), true, false) . ">$page->post_title</option>";
        }
        echo "</select>";
    }

    $this->show_field_end($field, $meta);
}

// show posts list
function show_field_posts($field, $meta) {
    global $post;

    if (!is_array($meta)) $meta = (array) $meta;

    $this->show_field_begin($field, $meta);

    $options = $field['options'];
    $posts = get_posts($options['args']);

    // checkbox_list
    if ('checkbox_list' == $options['type']) {
        foreach ($posts as $post) {
            echo "<input type='checkbox' name='{$field['id']}[]' value='$post->ID'" . checked(in_array($post->ID, $meta), true, false) . " /> $post->name<br/>";
        }
    }
    // select
    else {
        echo "<select name='{$field['id']}" . ($field['multiple'] ? "[]' multiple='multiple' style='height:auto'" : "'") . ">";

        foreach ($posts as $post) {
            echo "<option value='$post->ID'" . selected(in_array($post->ID, $meta), true, false) . ">$post->post_title</option>";
        }
        echo "</select>";
    }

    $this->show_field_end($field, $meta);
}

Question Really

Does this new version include Manny's advanced meta box class?

I take it we can still just include in a theme rather than as a plugin?

post format

is it possible?
'pages' => array( 'post_format', 'gallery' ),

Adding new taxonomies/categories

Hello,

Probably I'm overlooking something, but after adding a new taxonomy/category it isn't getting shown/updated in the post editor?

As far as I know, this should work?

array(
    'name' => 'Taxonomies',
    'id' => $prefix . 'mogelijkheid',
    'type' => 'taxonomy',           // File type: taxonomy
    'options' => array(
        'taxonomy' => 'mogelijkheden',   // Taxonomy name
        'type' => 'checkbox_list',  // How to show taxonomy: 'checkbox_list' (default) or 'select'. Optional
        'args' => array( ),         // Additional arguments for get_terms() function
    ),
    'desc' => 'Choose One Taxonomy'
)

Could you tell what I might be overlooking perhaps?

Thickbox image Upload for V4 + WP3.3

Hey,
I created a simple thickbox image uploader. It's a hack based on the current image.php/js and it's everything else than a perfect solution. It's just a quick hack which works for my project. It has a few drawbacks:

  1. Delete button will remove the post meta value but not the attachment
  2. It depends on a hidden input field and you need to save the page/post one time before you can reorder the images
  3. It's coded dirty & quick - I'm sure a code ninja could do it much better - however it works and that counts for me.
  4. You can use one image upload field only. It's for sure possible to modify it so that it works with more fields - however I didn't spend time on this because I don't need it.
  5. The get_post_meta return is a string and not an array.

I uploaded the image.php and image.js files @MediaFire. Maybe it helps some other users. You just need to replace the original files and call the post_meta value with "true" instead of "false".

http://www.mediafire.com/?xx6q4xr859ng156

http://www.mediafire.com/?1anljf17ayk1bq9

Regards,
thezuberat

Missing editor buttons

Hello,

Perhaps I'm overlooking something somewhere, but when using the default demo.php I've somehow lost all rich/wysiwyg editor buttons.

Edit:

It seems I've also lost the edit-slug box

Screenshot: http://d.pr/60W

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.