meta-box | best plugin for WordPress custom fields | Content Management System library

 by   wpmetabox PHP Version: 4.13.1 License: No License

kandi X-RAY | meta-box Summary

kandi X-RAY | meta-box Summary

meta-box is a PHP library typically used in Web Site, Content Management System, Wordpress applications. meta-box has no bugs, it has no vulnerabilities and it has medium support. You can download it from GitHub.

Meta Box helps you add custom fields and details on your website such as pages, posts, forms and anywhere you want using over 40 different field types such as text, images, file upload, checkboxes, and more. On top of that, each WordPress custom field type has extensive internal options for unlimited content possibilities. Complete customization and control is just a few clicks away. Adding WordPress custom fields and custom meta boxes is quick and painless: Select the field types you want in the user-friendly Online Generator, then copy and paste the code into your child theme's functions.php file. There are also free and premium extensions available to add enhanced capabilities. You can manage the display and organization of your WordPress custom fields, the conditions upon which they appear, and become the ultimate WordPress data wizard. You can also check out the full list of extensions and MetaBox.io for details.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              meta-box has a medium active ecosystem.
              It has 1132 star(s) with 431 fork(s). There are 73 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 68 open issues and 1054 have been closed. On average issues are closed in 107 days. There are 3 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of meta-box is 4.13.1

            kandi-Quality Quality

              meta-box has 0 bugs and 0 code smells.

            kandi-Security Security

              meta-box has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              meta-box code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              meta-box does not have a standard license declared.
              Check the repository for any license declaration and review the terms closely.
              OutlinedDot
              Without a license, all rights are reserved, and you cannot use the library in your applications.

            kandi-Reuse Reuse

              meta-box releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.
              meta-box saves you 2371 person hours of effort in developing the same functionality from scratch.
              It has 5171 lines of code, 343 functions and 143 files.
              It has medium code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed meta-box and discovered the below as its top functions. This is intended to give you an instant insight into meta-box implemented functionality, and help decide if they suit your requirements.
            • Normalize field arguments .
            • Render a map .
            • Get sanitize callback .
            • Generate field html
            • Generate a file field
            • Render the meta box .
            • Check for updates .
            • Enqueue scripts .
            • Get file information .
            • Ajax request to get users .
            Get all kandi verified functions for this library.

            meta-box Key Features

            No Key Features are available at this moment for meta-box.

            meta-box Examples and Code Snippets

            No Code Snippets are available at this moment for meta-box.

            Community Discussions

            QUESTION

            How to attach the pdf file in the custom post type in the WordPress?
            Asked 2021-Dec-16 at 10:50

            I am using WordPress. I have created a custom post type. Now I have to add the file upload option so that the admin can upload the pdf.

            I have tried some code and I am getting the output and it's correct.

            Now, My issue is when I upload the pdf and click on the publish button then it's not uploading. I am not getting any errors. I am using the below code.

            ...

            ANSWER

            Answered 2021-Dec-16 at 10:50

            To see if there is attached file to your post edit the following function

            Source https://stackoverflow.com/questions/70377395

            QUESTION

            Remove 'Move to Trash' under woocommerce order action for shop manager
            Asked 2021-Sep-29 at 13:12

            According to this post, custom post type, hide or disable the trash button in publish meta box, this is specifically removing for post. I couldn't find any post solutions relating to remove 'Move to trash' under woocommerce order action. Does this code apply same to removing this button on woocommerce?

            ...

            ANSWER

            Answered 2021-Sep-29 at 13:06

            To prevent deleting post/order/custom post is capability per user role. To prevent shop_manager role from deleting orders you must remove that capability. All other solutions will visualy work but someone who knows his stuff still can delete order if he wants. So place the following function in your functions.php

            Source https://stackoverflow.com/questions/69376545

            QUESTION

            Enable and disable 'edit' on orders for shop manager (woocommerce)
            Asked 2021-Sep-29 at 09:52

            I'm currently using the woocommerce-readonly-role this plugin to disable the ability to edit for a specific user where they only are able to view orders instead of editing just for shipping purposes in woocommerce. However, I need to enable some of the buttons to be editable, and I actually have some other features/custom code in the orders and need to enable it to be editable. Hence, in the current plugin I'm using, no matter which features I've added on, it is still unable to edit as I assuming the plugin is disabling the whole 'clickable' button on the order page regardless of additional features I added into order page.

            So, I'm planning to be selective on which button is not accessible for the specific user. The main issue is how do I disable edit (only enable readonly) more button / field edit including for shop manager only as below: You image reference may view from here: https://snipboard.io/AtOWBY.jpg

            1. Disable Add Order (I was following this and added to function Remove or hide "add new" button on woocommerce on bulk order panel using the code below

            ...

            ANSWER

            Answered 2021-Sep-29 at 09:52

            Use get_current_user(), this way you can get user object then check user's role from the object and if it is shop manager then apply your code as you mentioned.

            Source https://stackoverflow.com/questions/69363645

            QUESTION

            Limit WooCommerce Product Short Description to text only (Disable tinymce editor)
            Asked 2021-Jun-30 at 11:57

            I want to limit the Product Short Description, so that only text can be added. (Disable tinymce editor). As there is post excerpt in regular posts.

            Current:

            • Product Short Description = TinyMCE Editor

            Expected:

            • Regular Posts Excerpt = TEXT ONLY

            From what i found, this is what WooCommerce does to replace the standard excerpt box.

            In includes/admin/class-wc-admin-meta-boxes.php on line 119 there is

            ...

            ANSWER

            Answered 2021-Jun-30 at 11:57

            You can use the wp_editor_settings WordPress hook in combination with some conditions.

            Note that not only 'tinymce' is set to false, but also 'quicktags' and 'mediabuttons'

            So you get:

            Source https://stackoverflow.com/questions/68191563

            QUESTION

            wp.data.select('meta') property undefined with Gutenberg for WordPress
            Asked 2021-Jun-03 at 00:30

            I use Gutenberg with WordPress and I would like to check some fields before the user publish his post.

            I would like to check if the featured image, the title and a simple text field in a meta-box are not empty.

            If a field is empty a notification is displayed and I locked the "Publish" button.

            For the moment all works fine with the featured image and the title. But when I'm trying to check is the text field in the meta-box is empty I got errors :

            ...

            ANSWER

            Answered 2021-Jun-03 at 00:30

            That could happen when the XHR/AJAX request that fetches post data from the REST API hasn't been fully resolved, so you can't simply access the metadata like that. You need to ensure that getEditedPostAttribute('meta') actually returns an object and only then access the _myprefix_text_metafield property.

            So try with this instead:

            Source https://stackoverflow.com/questions/67808739

            QUESTION

            Display a product custom field only in WooCommerce Admin single orders for Manual Orders
            Asked 2021-Jan-25 at 23:57

            Following Display a product custom field only in WooCommerce Admin single orders answer to my previous question, which:

            1. Adds a Custom SKU Field (ArticleID)
            2. Saves the Custom SKU (ArticleID) as Hidden Order Item Meta Data
            3. Saves the Custom SKU (ArticleID) as Hidden Order Item Meta Data for Manual Orders

            However, it seems that the last part (for Manual Orders) is causing a conflict with this following other custom code I added for Gateway Fees:

            ...

            ANSWER

            Answered 2021-Jan-25 at 23:57

            You need to target only line items on the last function, this way:

            Source https://stackoverflow.com/questions/65892831

            QUESTION

            WooCommerce sort order items by categories
            Asked 2021-Jan-17 at 09:22

            {UPDATE}

            I want to sort products on backend order details by category menu order. So my categories are Clothing, Decor, Music, and products must be ordered in this way.

            I tried with this snippet

            ...

            ANSWER

            Answered 2021-Jan-17 at 09:22
            add_filter( 'woocommerce_order_get_items', 'filter_order_get_items_by_categories12', 10, 3 );
            
            function filter_order_get_items_by_categories12( $items, $order ) {
                global $woocommerce, $wpdb;
            
                $c1 = $wpdb->get_results( "select t1.order_item_name,t1.order_item_id,t5.name,t2.meta_value from
                    wp_woocommerce_order_items as t1 LEFT JOIN wp_woocommerce_order_itemmeta as t2 ON t1.order_item_id =
                    t2.order_item_id LEFT JOIN wp_term_relationships as t3 ON t2.meta_value = t3.object_id LEFT JOIN wp_term_taxonomy
                    as t4 ON t3.term_taxonomy_id = t4.term_taxonomy_id LEFT JOIN wp_terms as t5 ON t4.term_id = t5.term_id where
                    t1.order_id = '" . $order->get_id() . "' and t1.order_item_type='line_item' and t2.meta_key='_product_id' and
                    t4.taxonomy='product_cat' ORDER BY `t5`.`name` ASC" );
            
                $sorted_item_ids = array();
            
                foreach ( $c1 as $data ) {
                    if ( !in_array( $data->order_item_id, $sorted_item_ids ) ) {
            
                        $sorted_item_ids[] = $data->order_item_id;
                    }
                }
                $sorete_arr = [];
                foreach ( $sorted_item_ids as $value ) {
                    if ( $items[ $value ] instanceof WC_Order_Item_Product )
                        $sorete_arr[ $value ] = $items[ $value ];
                }
            
            
            
                return ($sorete_arr) ? $sorete_arr : $items;
            }
            

            Source https://stackoverflow.com/questions/65750393

            QUESTION

            Link to custom archive page links to page-template instead
            Asked 2020-Oct-22 at 09:25

            On my page-projects.php template page I am outputting image posts from my CPT 'projects'.
            I want to add a 'see all' link to my 'archive-projects.php (using: echo get_post_type_archive_link('/projects');), but it's linking to the same page-projects.php that I am on...

            • created template page in root called page-projects.php
            • in dashboard the page is 'photography' with slug of 'projects' and is assigned project template(page-projects.php) from 'page attributes' meta-box
            • CPT is 'projects', and each project is assigned project template(page-projects.php) from 'page attributes' meta-box
            • created archive-projects.php in root and in CPT code I have added for archive 'has_archive' => true

            Why is it linking to my custom post type page that I am already on and not my custom post type archive page?

            ...

            ANSWER

            Answered 2020-Oct-22 at 09:25

            If your page who list projects slug is projects AND your archive slug is also projects WordPress will always display your page.

            The archive page need to have a different slug.

            Source https://stackoverflow.com/questions/64478731

            QUESTION

            Undefined index: post (wordpress plugin)
            Asked 2020-Apr-18 at 11:21

            I checked WordPress using query monitoring plug and I got this error:

            Undefined index: post
            the error in plugin n-custom-point
            error locations are :

            1- wp-content/plugins/n-custom-point/class/metabox-user-group.php:17 prefix_register_meta_boxes() and this is line 17

            ...

            ANSWER

            Answered 2020-Apr-17 at 10:18

            This is a PHP Notice, it can be fixed by changing the line from:

            Source https://stackoverflow.com/questions/61268584

            QUESTION

            Customizing WooCommerce product data label without plugin - WEIGHT
            Asked 2020-Apr-11 at 16:58

            I'd like to change the product meta label from "Weight" to "Square Feet" in both the back end and front end.

            I've tried this and a few [hundred] variations without success:

            ...

            ANSWER

            Answered 2020-Jan-22 at 17:53

            You may use this snippet

            Source https://stackoverflow.com/questions/59864880

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install meta-box

            To getting started with the plugin, please read the Quick Start Guide.
            Visit Plugins > Add New
            Search for Meta Box
            Click the Install Now button to install the plugin
            Click the Activate button to activate the plugin
            Unzip the download package
            Upload meta-box to the /wp-content/plugins/ directory
            Activate the plugin through the 'Plugins' menu in WordPress

            Support

            We won't leave you high and dry. We provide regularly updated, and extensive documentation as well as tutorials on how to use MetaBox and custom fields in WordPress to your advantage as well as in the most efficient way possible.
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/wpmetabox/meta-box.git

          • CLI

            gh repo clone wpmetabox/meta-box

          • sshUrl

            git@github.com:wpmetabox/meta-box.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Content Management System Libraries

            Try Top Libraries by wpmetabox

            mb-custom-post-type

            by wpmetaboxJavaScript

            library

            by wpmetaboxPHP

            mb-relationships

            by wpmetaboxPHP

            mb-rest-api

            by wpmetaboxPHP

            docs

            by wpmetaboxHTML