Support Forum ยป User Profile

Forum Replies Created

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

    I mean getting the ID of the post you want to get value for. Inside the loop, you setup global post object and the helper function auto takes its ID. But outside the loop, the helper function doesn't know which post object to take ID, and thus it might output the wrong value.

    I'm not sure if that's the case, cause the situation is not 100% clear. That are just my thoughts.

    in reply to: Saving problems #1867
    Anh TranAnh Tran
    Keymaster

    It seems the version of group extension is old. Please update the Group extension to the latest version 1.0.3 which has a fix for this.

    in reply to: Problem with clonable fields and groups #1860
    Anh TranAnh Tran
    Keymaster

    Hi Johann, I think yes :), the code is correct.

    in reply to: 2 Feature Suggestions #1859
    Anh TranAnh Tran
    Keymaster

    Hmm, I see. So you set a fixed template for the front page and don't use Page template at all.

    My suggestion is making the front page a normal page template (so it won't be hardcoded) - template-front-page.php for example and use the extension to show meta box for this page template only:

    'show' => array(
        'template' => array( 'template-front-page.php' ),
    )
    in reply to: Unable to save "0" in the text field #1853
    Anh TranAnh Tran
    Keymaster

    Let me check it again and get back to you. The 4.7 has a new feature with custom attributes, including the meta value. Maybe it *thinks* the value is empty and doesn't show it.

    in reply to: Problem with clonable fields and groups #1852
    Anh TranAnh Tran
    Keymaster

    Hi Johann,

    For group, the value of a group is always an array. If it's cloneable, then the value is always array of arrays (2 level depth array), even when it's empty. So, for group, you should check the subvalue as well, not just empty on the group value.

    For other fields, I can't replicate the bug. There is also 1 open pull request for similar bug on Github (for oembed field), but I can't make the same bug:

    https://github.com/rilwis/meta-box/pull/703

    Do you see the same problem? Can you post your code?

    in reply to: rwmb_fieldID_field_title filter #1851
    Anh TranAnh Tran
    Keymaster

    Hi Saul,

    I think it's fixed in the development version on Github:

    https://github.com/rilwis/meta-box/blob/master/inc/fields/post.php#L142

    I will update the plugin soon so it's available on WordPress.org as well.

    in reply to: rwmb_meta values unset after a shortcode #1850
    Anh TranAnh Tran
    Keymaster

    In your shortcode, you use a custom query but you don't reset the query after outputting HTML. That makes the global $post object isn't reseted and contains wrong value of the current post. Thus, the rwmb_meta shortcode can't get the correct value.

    Best way to resolve this is adding wp_reset_postdata() after your query and try again.

    in reply to: 2 Feature Suggestions #1849
    Anh TranAnh Tran
    Keymaster

    Hi Johann,

    1. You mean if the page is set as the static front page in Settings | Reading? Or just front page template?

    If front page template, we already have that with the option 'template'.

    2. We have options to reorder clonable fields. Just add 'sort_clone' => true to the field and you will see :). It works for both normal fields and group.

    in reply to: Clone fields inside cloneable groups #1826
    Anh TranAnh Tran
    Keymaster

    Hi Johann,

    It's not possible to do that. The extension only supports cloning the whole group, not sub-fields.

    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: 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: 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.

Viewing 15 posts - 3,481 through 3,495 (of 3,702 total)