Support Forum ยป User Profile

Forum Replies Created

Viewing 15 posts - 3,676 through 3,690 (of 3,958 total)
  • Author
    Posts
  • in reply to: Can't use wp_query "meta_key" parameter to filter posts #1825
    Anh TranAnh Tran
    Keymaster

    Hi, as I understand, there are 2 problems here:

    1. Filtering WP_Query directly with meta values from group
    2. Get the meta values from group outside the loop and use them to filter the query

    Regarding the 1st problem: it's the same problem of sanitization data as in the link you provided. Data for a group is saved as a sanitized string of an array. So it's can't be used directly to filter the query.

    The 2nd issue seems the solution you made to filter the query, by getting the meta values first (and maybe compare them with a specific value). It's very simple to get the value outside the loop. All you need to do is providing the 3rd param for rwmb_meta function: the post ID, like this:

    //END LOOP
    $post_id = ''; // Set the post ID here
    $META_ID = 'AUCTION_HERO';
    $text_block = rwmb_meta($META_ID.'_text_block', '', $post_id );
    echo $text_block['end_date_AUCTION_HERO_'.$META_ID];
    in reply to: Problem with image_advanced field #1820
    Anh TranAnh Tran
    Keymaster

    Hi Bravebits,

    I've test with your meta boxes again. It seems that you not use use Meta Box as normally way (You extends Meta Box class, then do some change inside), so I can't tell you your problem with your code but I can make sure that it works properly if you register as normal way, like this guide:

    https://metabox.io/docs/registering-meta-boxes/

    Also, you don't have to use rwmb_outside_conditions filter. You can use that filter if you want to hide some element outside meta box. For example: post title, categories, post excerpt, etc...

    I have modified your code, you can put this to your theme functions.php to see it works:

    
    add_filter( 'rwmb_meta_boxes', function( $meta_boxes )
    {
    	  // Additional meta box for post.
    	    $meta_boxes[] = array(
    	            'id'         => 'wr_post_option',
    	            'post_types' => array( 'post' ),
    	            'title'      => _( 'Post Settings' ),
    	            'context'    => 'normal',
    	            'priority'   => 'high',
    	            'autosave'   => true,
    	            'fields'     => array(
    	                    array(
    	                            'name' => _( 'Enable large post' ),
    	                            'id'   => 'masonry_large',
    	                            'type' => 'checkbox',
    	                            'desc' => _( '<i>Support Masonry layout only</i>' ),
    	                            'std'  => 0,
    	                    ),
    	                    array(
    	                            'name' => _( 'Add image gallery' ),
    	                            'id'   => 'format_gallery',
    	                            'type' => 'image_advanced',
    	                            'visible' => array( 'post_format', 'gallery' )
    	                    ),
    	                    array(
    	                            'name'     => _( 'Video Source' ),
    	                            'id'       => 'format_video',
    	                            'type'     => 'select',
    	                            'options'  => array(
                                        'link' => _( 'Video Link' ),
                                        'file' => _( 'Video Upload File' ),
    	                            ),
    	                            'visible' => array( 'post_format', 'video' ),
    	                    ),
    	                    array(
    	                            'name'    => _( 'Video Link' ),
    	                            'id'      => 'format_video_url',
    	                            'desc'    => _( '(Support Youtube and Vimeo video)' ),
    	                            'type'    => 'oembed',
    	                            'visible' => array( 'format_video', '=', 'link' ),
    	                    ),
    	                    array(
    	                            'name'             => _( 'Upload video' ),
    	                            'id'               => 'format_video_file',
    	                            'desc'             => _( 'Support .mp4 file format only' ),
    	                            'type'             => 'file_advanced',
    	                            'max_file_uploads' => 1,
    	                            'mime_type'        => 'video',
    	                            'visible'          => array( 'format_video', '=', 'file' ),
    	                    ),
    	                    array(
    	                            'name'     => _( 'Audio Source' ),
    	                            'id'       => 'format_audio',
    	                            'type'     => 'select',
    	                            'options'  => array(
    	                                    'link' => _( 'Soundcloud Link' ),
    	                                    'file' => _( 'Upload audio' ),
    	                            ),
    	                            'visible' => array( 'post_format', 'audio' ),
    	                    ),
    	                    array(
    	                            'name' => _( 'Soundcloud Link' ),
    	                            'id'   => 'format_audio_url',
    	                            'type' => 'oembed',
    	                            'visible' => array( 'format_audio', '=', 'link' ),
    	                    ),
    	                    array(
    	                            'name'             => _( 'Upload Audio' ),
    	                            'id'               => 'format_audio_file',
    	                            'desc'             => _( 'Support .mp3 file format only' ),
    	                            'type'             => 'file_advanced',
    	                            'max_file_uploads' => 1,
    	                            'mime_type'        => 'audio',
    	                            'visible' => array( 'format_audio', '=', 'file' ),
    	                    ),
    	                    array(
    	                            'name' => _( 'Quote content' ),
    	                            'desc' => _( 'You can write the Quote content here.' ),
    	                            'id'   => 'format_quote_content',
    	                            'type' => 'textarea',
    	                            'cols' => '30',
    	                            'rows' => '6',
    	                            'visible' => array( 'post_format', 'quote' ),
    	                    ),
    	                    array(
    	                            'name'  => _( 'Quote author' ),
    	                            'id'    => 'format_quote_author',
    	                            'type'  => 'text',
    	                            'clone' => false,
    	                            'visible' => array( 'post_format', 'quote' ),
    	                    ),
    	                    array(
    	                            'name' => _( 'Link to' ),
    	                            'id'   => 'format_link_url',
    	                            'type' => 'text',
    	                            'visible' => array( 'post_format', 'link' ),
    	                    ),
    	            )
    	    );
    
    	return $meta_boxes;
    } );
    

    Regards

    Tan Nguyen

    in reply to: Autoload Extensions from Theme Framework #1815
    Anh TranAnh Tran
    Keymaster

    Hi,

    I think using TGM class is still the best way to handle the dependencies in themes and plugins. I'm working on autoload for the main plugin to make it easier to load in themes and plugins. Someone recommended me the Redux Framework, too :).

    In the meantime, if you can:
    - Use TGM class, or
    - Load the extensions directly by including the main file of the extensions (the file which has the same name as the folder), or
    - Use a small script like this https://gist.github.com/mathetos/7161f6a88108aaede32a to check if the extension is loaded or not, then run your code.

    in reply to: Problem with image_advanced field #1814
    Anh TranAnh Tran
    Keymaster

    Hi bravebits,

    This bug caused when Meta Box 4.6 use new structure for File Advanced and Image Advanced, we're fixing this bug. If you want to fix immediately, please replace this file:

    
    https://github.com/rilwis/meta-box/blob/0054dce58a359d71058c057190965afc62da1631/js/media.js
    

    I'm looking to your code and will reply you soon.

    in reply to: Shortcodes Not Outputting Fields #1806
    Anh TranAnh Tran
    Keymaster

    We resolved this bug via email and the fix is added in the latest version of MB Builder. Please update the plugin.

    in reply to: if ( ! empty ) returning blank fields rather than else content #1805
    Anh TranAnh Tran
    Keymaster

    I see. Can you please update the Meta Box to 4.7.2 and Group to 1.0.3? The 1.0.3 version of Group has a fix for this.

    in reply to: Set Custom Image Size #1804
    Anh TranAnh Tran
    Keymaster

    Hi, the extension and the plugin Meta Box does not set image size. The helper function (in the example above) has a parameter to get custom size for image.

    Not sure what are you going to do with this, but why don't you just create new image size in your theme? It's something belong to theme's functionality.

    in reply to: if ( ! empty ) returning blank fields rather than else content #1789
    Anh TranAnh Tran
    Keymaster

    Which version of the Meta Box and Group are you using? There were some problems of the plugin and group which made them didn't save the value correctly. Can you please update to the latest version and see if it's resolved?

    If it's not, can you please post the code you setup the fields? Thanks.

    in reply to: Sorting handle overlaps field label #1788
    Anh TranAnh Tran
    Keymaster

    Hi, can you please post your code?

    in reply to: Problem with image_advanced field #1782
    Anh TranAnh Tran
    Keymaster

    Hi Bravebits,

    This bug is the compatilibity bug with Conditional Logic addon and Meta Box plugin. We're in progress to fix this bug, will be released within 2 days.

    Btw, I've tested with your provided code and it works properly, perhaps your provided code not same as your code you're testing in video.

    Thanks for your patience.

    Tan Nguyen

    in reply to: Error messages on admin after upgrade to 4.7 #1780
    Anh TranAnh Tran
    Keymaster

    Hi,

    This is just fixed. I will update the plugin today.

    in reply to: Character limit of 30 on inputs #1769
    Anh TranAnh Tran
    Keymaster

    The new version 4.7.1 fixes this bug. Please update.

    in reply to: Text Fields dont save (MB Group 1.0.2) (Meta Box 4.7) #1768
    Anh TranAnh Tran
    Keymaster

    That was my mistake :(. I forgot to update the data on the server. Everything seems fine now.

    Thanks!

    in reply to: Text Fields dont save (MB Group 1.0.2) (Meta Box 4.7) #1765
    Anh TranAnh Tran
    Keymaster

    Due to a change in Meta Box 4.7 with "attributes" param, the old code for Group doesn't work. I've just updated the extension to make it work with new version of Meta Box. Please update.

    Thanks for reporting.

    in reply to: Character limit of 30 on inputs #1764
    Anh TranAnh Tran
    Keymaster

    Hi, sorry for this stupid bug :(. There's a fix for it on github and I will update the plugin right now.

Viewing 15 posts - 3,676 through 3,690 (of 3,958 total)