Discussion on Xbox Framework - Create Meta boxes, Theme Options & Admin Pages for WordPress


MaxLopez supports this item


This author's response time can be up to 1 business day.

32 comments found.


I have a question regarding https://codecanyon.net/item/xbox-framework-create-meta-boxes-theme-options-admin-pages-for-wordpress/19250995.

Can I create a free WordPress plugin using the xbox framework and upload it to wordpress directory by just buying 1 license of this framework?

Sorry, got the answer from https://codecanyon.net/licenses/standard.



This is my code: <?php require_once( 'wpparseCore/xbox.php' ); add_action( 'xbox_init', 'wppwb_admin_page'); function wppwb_admin_page(){ $wppwb_options = array( 'id' => 'wppwb-admin-page',//It will be used as "option_name" key to save the data in the wp_options table 'title' => 'Test', 'menu_title' => 'Test', 'skin' => 'teal', 'header' => array( 'icon' => '<img src="'.XBOX_URL.'/img/xbox-light.png" />', 'desc' => 'Test', )); $xbox = xbox_new_admin_page( $wppwb_options ); $xbox->add_field(array( 'id' => 'custom-switcher', 'name' => __( 'custom', 'textdomain' ), 'type' => 'switcher', 'default' => 'no', 'options' => array( 'on_value' => 'yes',//Default: on 'off_value' => 'no'//Default: off ) )); // Getting Values $xbox = Xbox::get( 'wppwb-admin-page' ); $value = $xbox->get_field_value( 'datetisdsdme-switcher' ); // If Date Time Switch in On if($value == 'yes') { // do something } } ?> But I want to get fields values outside of function wppwb_admin_page() independently, so I could require_once a file which has a class. I want this code: // Getting Values $xbox = Xbox::get( 'wppwb-admin-page' ); $value = $xbox->get_field_value( 'datetisdsdme-switcher' ); // If Date Time Switch in On if($value == 'yes') { // do something }

outside of function wppwb_admin_page().

Is it possible?

of course, read the “Get field values for Admin Pages” section of this page:


Hello, you expect to range field?

You could use two number fields.

Hi! How can I read the contents of a file and paste it into the code editor?

The above should work well.

But you could try to get the value from $ _POST

add_action('xbox_after_save_field_read-css-from-file', 'create_custom_files', 10, 3); function create_custom_files( $value, $field, $updated ){ $file_path = dirname(__FILE__) .'/example/example-css-code.php'; $value = $_POST['read-css-from-file']; //If you just want to save when there were changes. if( $updated ){ file_put_contents( $file_path, $value ); } }

POST do not work :( I do add_action(‘xbox_after_save_field_read-css-from-file’, ‘create_custom_files’, 10, 3); function create_custom_files( $value, $field, $updated ){ $file_path = dirname(FILE) .’/example/example-css-code.php’; $xbox = Xbox::get( ‘my-admin-pagel’ ); $value = $xbox->get_field_value( ‘read-css-from-file’); //If you just want to save when there were changes. if( $updated ){ file_put_contents( $file_path, $value ); } }

it is work!


Is there any prediction of conditional fields?

Hi alanmosko, I recently added a conditional field functionality.

It’s still in beta, but it works pretty well. If you like, give me your email to send you the update.

This looks perfect for a couple of project that I’m working on, one of which would be an extended license.

I do have a question – is there a hook or easy way that you can provide to run a function when settings are saved?

In my scenario, if the user changes some typography settings, I’d like a hook that would trigger my function to dump the values to a CSS file. There are other options that I may wish to dump to a JS file. If there was an on_save hook, it would allow me to do this fairly easily.

I can make it work either way… I was just wondering if you had input. Thank you, Daniel

Hi Daniel.

Of course you can do that, in fact I’ve been working on a project where I need to do that.

If you want to detect changes in any field using javascript and immediately execute your code then you can do something like:

$('.xbox-type-colorpicker .xbox-element').on('xbox_changed_value', function( event, value ){ console.log( 'colorpicker changed:' ); console.log( value ); });

There are more examples at the end of this file:


I recently added some filters and actions when saving the fields:

When all fields are saved $data = apply_filters( 'xbox_filter_data_for_save', $data ); do_action( "xbox_before_save_fields", $data, $this->object_id, $this ); do_action( "xbox_before_save_fields_{$this->object_type}", $data, $this->object_id, $this ); //code save all fields do_action( "xbox_after_save_fields", $data, $this->object_id, $updated_fields, $this ); do_action( "xbox_after_save_fields_{$this->object_type}", $data, $this->object_id, $updated_fields, $this ); When you save each field do_action( "xbox_before_save_field", $field->id, $value, $field ); do_action( "xbox_before_save_field_{$field->id}", $value, $field ); $updated = $field->save( $value ); do_action( "xbox_after_save_field", $field->id, $value, $field, $updated ); do_action( "xbox_after_save_field_{$field->id}", $value, $field, $updated );

This is a simple example I made for another user.

have a nice day Daniel…regards

Perfect, thank you for the excellent and prompt response!

I’m having a little trouble understanding Envato’s licensing terms. It appears that the difference between the Standard and Extended licenses is that the latter may be included in a paid product. It also says that the Standard may be used it a free end product (so… a plugin that’s uploaded to the WordPress repo?) https://codecanyon.net/licenses/standard Their F.A.Q. for “Use in stock items/templates” seems to contradict their license matrix in some circumstances, unless the item is GPL’d. Since it is considered a derivative of WordPress, I assume that it is also GPL’d. So… given “Exception 3,” it appears that the “Use in stock items/templates” exclusion does not apply here, correct? https://codecanyon.net/licenses/faq#small-element-stock-a

Summary of my interpretation: I can use it in one free plugin (per license purchased) uploaded to the WordPress.org repo, et al, or I can use it in one plugin/theme (per license purchased) that is sold. Yes?

Hmm, the other curious thing is that folks use Envato extended licenses in products all of the time. Just search for WordPress themes on Code Canyon. Many, if not most of them, may include Visual Composer and/or Slider Revolution, among others.

None of this makes sense and the enforcement seems dubious, and possibly corrupt (ie, Envato is happy to send DMCA notices on behalf of WPBakery because they are a big profit center for them).

I am basically going to go with your original response as it seems the safest presumption.

More reading… This page seems to suggest that the Extraction clause is irrelevant to GPL items (such as your PHP code), but not for non-GPL elements (such as any custom code that you created in your “libs/xbox*” directories or images). (Reference: “What about Envato’s license?” at http://bit.ly/2qbPrhw)

Although bizarre, I understand the wording. However, it seems that by offering a demo where the files are clearly linked would invalidate this clause as well.

It is all so confusing in order to be compliant. IANAL

EDIT: I hope that you are not irritated with me. Your prompt explanations have been appreciated and helpful. Thank you!

Wow, yes indeed everything is very confusing, but as mentioned in this article http://bit.ly/2qbPrhw) .... Themes and plugins sold on Envato Market are sold under the default split license. This means authors can protect their rights and freedoms to respect (and comply with) the GPL as well as control their own work.

“Envato Market’s license for themes or plugins sold on the Envato Market sites covers all the components of these items, except for the specific components covered by the GPL”

Therefore, clause 11 that you mentioned should only refer to the part covered by the Envato license, not the GPL.

With regard to what you say about plugins being used in themes that are sold here on Envato, I imagine they do using the Extended License + the permission of the author of the plugin.

It’s just my guess, I suppose they agree on a profit percentage or something.

This I say based on the exceptions of what can be done with the Extended License, explained in this article.


... Don’t worry, this conversation has made me learn a little more about the Envato licenses, although the truth is still a little confusing for me.

Regards :)

This is just an FYI – Okay, so I purchased a regular license because I wanted to try it out. On OS X Sierra, I wasn’t able to extract the archive when I downloaded it from the Envato downloads area. I got this error (which I have never received on other plugins downloaded from Envato): https://f001.backblazeb2.com/file/hendricks/tmp/xbox-framework-extraction-error.png

Fortunately, I was able to extract it by converting the ZIP to tar.gz (whatever it didn’t like must have been wiped by the conversion).

I just thought that I would bring it up in case you wanted to know. TY

If I purchase an Extended License, do I have permission to use it in a premium/sold theme?

Hi Daniel,

Of course, you have my permission :) , but for each of your premium themes available for sale you should obtain a separate Extended License.

An use it only in premium themes which are sold on ThemeForest market exclusively.

Thank you, and yes, I would of course purchase a license for each product that it is is used in (currently, I only have one free plugin that it is used in which I already have a license for, and I am going to purchase an extended license soon for a premium theme – neither products have been released to the public yet, the plugin is close, but the theme has a lot of work to do yet).

I was not aware of the ThemeForest exclusivity for extended, so I’m glad that you mentioned it.

Thanks again, Daniel

When will leave the next official version?

I’m using 1.1.4.

Hello, I have already sent the latest version, but it is still under review.

If you want, give me your email to send you a download link right now.

my email moskoweb@gmail

I already sent you the update.

I little bit confuse, is mean this is a plugin, and i can create admin area customize as i want, for my author and general registered user without do coding ? i try your demo, but there is no visual page to show my customize setting, any link for show the sample result ?


My plugin allows you to easily create metaboxes or admin pages.

The options have to be added by code.

Here in the documentation I explain more detailed:


That is, it is a plugin for theme developers or plugins for wordpress.

I recently created a plugin using Xbox Framework.


alanmosko Purchased

Hello, I would like to know if there’s a template for creating themes with the Xbox, or at least, how to add it to use for creating the admin theme. Thank you.

Hi Alan, I have sent a message to your email.

Hi, presale question, can i output values to javascript?

Hi siete25

Of course: Each time you make a change in a field, you can get that value in the event “xbox_changed_value”.

Two examples:

Works for any field: http://xboxframework.com/files/xbox-events.js