Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi catarinacarraro,
Thanks for purchasing and using MB Conditional Logic.
Sorry, this problem because Conditional Logic isn't compatibility with your PHP version, this is our bug and we'll have an update on the next day and you'll get the update shortly.
To fix it now, you can simply replace
['and', 'or']with
array('and', 'or')Then that line with become:
$relation = ( isset( $condition['relation'] ) && in_array( $condition['relation'], array('and', 'or') ) ) ? $condition['relation'] : 'and';Thank you and best regards.
Tan Nguyen
Anh Tran
KeymasterHi Alona,
Thanks for using our plugins.
We wouldn't recommend you include plugin in theme, the reason is same as Include Meta Box Plugin In Themes/Plugins, you can use TGM Activation Class to tell users that your theme is required that plugin.
But incase you really need to include plugin into your theme, here is the solution. Looks like you've already purchased MB Conditional Logic, so I'll use this plugin and twentyfifteen theme for example:
1. Copy whole plugin directory to your theme, for example twentyfiteen/inc
2. Open your functions.php, add this snippet to the last:if ( is_admin() ) { define( 'MBC_URL', get_template_directory_uri() . '/inc/meta-box-conditional-logic/' ); define( 'MBC_DIR', get_template_directory() . '/inc/meta-box-conditional-logic/' ); require MBC_DIR . '/meta-box-conditional-logic.php'; }Or you can change
incdirectory to whatever you want.Best regards
Tan Nguyen.
Anh Tran
KeymasterYou're welcome, and please don't hesitate to tell us if you have problem.
Anh Tran
KeymasterHi umtang41,
Just want to notify you. Did you used Conditional Logic? Does it solved your problem? And please don't hesitate to tell us if you have problem or confusing when using it ๐
Regards
Tan Nguyen.
Anh Tran
KeymasterHi Cristian,
Thanks for using MB Conditional Logic.
Conditional Logic can works with any DOM element, so you can set the visibility for meta box if page is child or parent. This is some usage example:
Visible when the page is parent (root)
'visible' => array('parent_id', '')Visible when the page is child
'visible' => array('parent_id', '!=', '')Visible when the page's parent ID is 99
'visible' => array('parent_id', 99)Visible in certain page (ID > 101 for example):
'visible' => array('post_ID', '>', 101)These examples above uses visible action, you can use hidden action in case you want to hide it.
Regards.
Anh Tran
KeymasterFYI, the latest version of Meta Box Show Hide now supports check for
is_child. Please try it out!Anh Tran
KeymasterHi, there's a way to change the returned value of
rwmb_metawhich can be useful for your case.The filter is
rwmb_metaalso and we can do like this:add_filter( 'rwmb_meta', 'prefix_meta', 10, 4 ); function prefix_meta( $meta, $key, $args, $post_id ) { if ( ! is_search() ) return $meta; // If this is search page, do whatever you want with the returned value $meta $meta = ''; return $meta; }Anh Tran
KeymasterHi Maxell,
That fatal error happened when you assign a value to function. You cannot do that.
For this problem, we'll need to change the logic before
$smof_datahas overridden byrwmb_meta. After that, we have no chance to do it. For example, we'll assign each $smof_data index with rwmb_meta key only if current page is not search page. You can post some lines on that file and I'll have a look at with you.Regards.
Anh Tran
KeymasterHi Maxell,
Can you show me where did you put
rwmb_metafunction? If you wanna show meta box value on singular pages, like Post or Page, you can put rwmb_meta to single.php, page.php or singular.php (depend on your template hierarchy).In case both singular pages and archive pages in your theme are included same file. You can exclude rmmb_meta on search page like so:
// Only execute rwmb_meta function when current page is not search page if ( ! is_search() ) rwmb_meta('your_value');Regards
Tan Nguyen
Anh Tran
KeymasterFYI, the Conditional Logic has just been released. Please redownload the Core Extensions Bundle to get it.
If you have any problem using the new extension, please let us know in the support forum.
Thanks and enjoy!
Anh Tran
KeymasterNice to hear that you've solved the problem ๐
Anh Tran
KeymasterThanks for your replies. Let me check it.
Anh Tran
KeymasterHi daveheslop,
This plugin is under development and will be available soon. When it's available, it will be included in the Core Extensions Bundle and you can download it from your account page.
Anh Tran
KeymasterYes, of course. You can use the following code to output the full URL of an image:
$image = rwmb_meta( 'field_id', 'type=image' ); echo $image['full_url'];For more information, please read this documentation.
Anh Tran
KeymasterHi again,
FYI, this feature has just been added to the latest version 4.5.4. Please update the plugin to use it.
Thanks for your idea and enjoy the plugin!
-
AuthorPosts