Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 2,611 through 2,625 (of 3,702 total)
  • Author
    Posts
  • in reply to: Using hooks data inside MB_Frontend_Post #7093
    Anh TranAnh Tran
    Keymaster

    Hi Florian,

    Thanks for your comment. I didn’t think about this, just thougth $this is enough. I’ve just released new version 1.0.2 with these properties public. Please update.

    in reply to: Does not work after update to 1.1 #7070
    Anh TranAnh Tran
    Keymaster

    I was misunderstanding. Just updated the plugin to 1.1.1. Please try it.

    Thanks

    in reply to: creating a clone group #7066
    Anh TranAnh Tran
    Keymaster

    Hi,

    The group is just like another fields. To make it cloneable, please just add 'clone' => true.

    in reply to: Does not work after update to 1.1 #7065
    Anh TranAnh Tran
    Keymaster

    Strange, the code works fine to me:

    https://imgur.elightup.com/ZWNyogv.png

    in reply to: Multiple maps #7063
    Anh TranAnh Tran
    Keymaster

    Hi Jackky,

    Can you please give us more details on the later issue?

    Anh TranAnh Tran
    Keymaster

    Your code looks fine. I just found the problem. It's just the MB Settings Page is loaded at init with priority 5, which is later than widgets_init (fires at init with priority 0). So, to solve this problem, simply replace widgets_init with init!

    in reply to: Does not work after update to 1.1 #7054
    Anh TranAnh Tran
    Keymaster

    Can I see your full code? I've just tested with the latest version 1.1 and here is my result:

    in reply to: Creating a metabox without using the MB Plugin #7053
    Anh TranAnh Tran
    Keymaster

    Hi, 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!

    in reply to: Does not work after update to 1.1 #7039
    Anh TranAnh Tran
    Keymaster

    Sorry to miss this topic. Can you please post your code here?

    Anh TranAnh Tran
    Keymaster

    Hi,

    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 init hook. That's why when you print the value of the function prefix_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_init hook. FYI, widgets_init hook fires at init with priority 0. So, if you register your menu locations at init with priority 10, 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).

    in reply to: Click counter #7034
    Anh TranAnh Tran
    Keymaster

    I think you write the update_post_meta incorrectly, it should be:

    update_post_meta( get_the_ID(), 'link_counter', $count );

    in reply to: How to set meta_query of Group cloneable fields for search #7023
    Anh TranAnh Tran
    Keymaster

    Thanks a lot for your solution. It's extremely helpful for other people.

    in reply to: How to setup capability for editors? #7012
    Anh TranAnh Tran
    Keymaster

    Hi,

    Do you mean create a settings page for editors? If so, please set the 'capability' => 'edit_pages' for the settings page. The capability edit_pages is available for only editors and admins.

    If you need a plugin to manage/create custom capabilities, please try the Members.

    in reply to: Show meta box only for top parent page ID #7011
    Anh TranAnh Tran
    Keymaster

    Hi 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;
    }
    in reply to: Show meta box only for top parent page ID #6990
    Anh TranAnh Tran
    Keymaster

    Why don't you use parent rule? It's supported by default 😉

Viewing 15 posts - 2,611 through 2,625 (of 3,702 total)