Forum Replies Created
-
AuthorPosts
-
Anh Tran
KeymasterHi Florian,
Thanks for your comment. I didn’t think about this, just thougth
$thisis enough. I’ve just released new version 1.0.2 with these properties public. Please update.Anh Tran
KeymasterI was misunderstanding. Just updated the plugin to 1.1.1. Please try it.
Thanks
Anh Tran
KeymasterHi,
The group is just like another fields. To make it cloneable, please just add
'clone' => true.Anh Tran
KeymasterStrange, the code works fine to me:
Anh Tran
KeymasterHi Jackky,
Can you please give us more details on the later issue?
September 28, 2017 at 10:41 AM in reply to: is it possible to put values from settings page to function register_widget()? #7055Anh Tran
KeymasterYour code looks fine. I just found the problem. It's just the MB Settings Page is loaded at
initwith priority 5, which is later thanwidgets_init(fires atinitwith priority 0). So, to solve this problem, simply replacewidgets_initwithinit!Anh Tran
KeymasterCan I see your full code? I've just tested with the latest version 1.1 and here is my result:

Anh Tran
KeymasterHi, the code still requires the Meta Box plugin to use. It's the heart of all extensions. With the exported code, you can remove the MB Builder extension, but still need to keep Meta Box active!
Anh Tran
KeymasterSorry to miss this topic. Can you please post your code here?
September 26, 2017 at 11:44 AM in reply to: is it possible to put values from settings page to function register_widget()? #7038Anh Tran
KeymasterHi,
As long as you saved theme settings, the settings is stored in the options table and of course, you can use the helper function to get it anytime you want, even before
inithook. That's why when you print the value of the functionprefix_mega_menu_widget_classes, it always work.I guess the problem is the way you register menu locations in your theme. It probably happens after
widgets_inithook. FYI,widgets_inithook fires atinitwith priority 0. So, if you register your menu locations atinitwith priority10, it will run *after* and doesn't work. Try to move the code to register menu locations to priority 0. (You still need to check to make sure it runs *before*widgets_init).Anh Tran
KeymasterI think you write the
update_post_metaincorrectly, it should be:update_post_meta( get_the_ID(), 'link_counter', $count );September 22, 2017 at 4:02 PM in reply to: How to set meta_query of Group cloneable fields for search #7023Anh Tran
KeymasterThanks a lot for your solution. It's extremely helpful for other people.
Anh Tran
KeymasterHi,
Do you mean create a settings page for editors? If so, please set the
'capability' => 'edit_pages'for the settings page. The capabilityedit_pagesis available for only editors and admins.If you need a plugin to manage/create custom capabilities, please try the Members.
Anh Tran
KeymasterHi again,
I found the problem for your situation. Your check doesn't run when post is updated, because there's no
$GET['post']. In that case, you need to get post ID via$_POST. Here is the code:function prefix_parent_page_id_check() { $parents = get_post_ancestors( prefix_get_post_id() ); return $parents && 901 == array_pop( $parents ); } function prefix_get_post_id() { if ( isset( $_GET['post'] ) ) { return intval( $_GET['post'] ); } if ( isset( $_POST['post_ID'] ) ) { return intval( $_POST['post_ID'] ); } return false; }Anh Tran
KeymasterWhy don't you use
parentrule? It's supported by default 😉 -
AuthorPosts