Support Forum » User Profile

Forum Replies Created

Viewing 15 posts - 2,011 through 2,025 (of 3,708 total)
  • Author
    Posts
  • in reply to: No Relationship posts displaying #10405
    Anh TranAnh Tran
    Keymaster

    Let me update the extension to remove the post_type rule. People still can set the post types anyway.

    Update 1: Done! Version 1.3.1 is available.

    Update 2: I was too rush. The 'post_type' seems to be related to many things. I have to revert it to the previous version.

    in reply to: No Relationship posts displaying #10399
    Anh TranAnh Tran
    Keymaster

    Hi Doug,

    It's unexpected behaviour, but it has a reason. To make the query can get posts from any side of the connection, the plugin sets the post_type to any in the query. And WP_Query checks for exclude_from_search in this case. See this:

    https://codex.wordpress.org/Class_Reference/WP_Query#Type_Parameters

    'any' - retrieves any type except revisions and types with 'exclude_from_search' set to true.

    I don't know why WordPress sets that :(. It seems kind of weird to me.

    Anh TranAnh Tran
    Keymaster

    Hi,

    Are "Tampa" and "St Pete" terms of the "office location" taxonomy?

    If so, you have some ways to store the actual address of each location (each term):

    • Use the default WordPress term's description for actual address (https://imgur.elightup.com/GIU2Bbb.png). If you don't use the description for any purpose, it's good to use it for address, cause it doesn't require any coding.
    • Or you can use the MB Term Meta extension to add a text field "Address" for "office location" taxonomy. You can use the MB Builder to create that field for you if you're not familiar with coding. Just remember to go to Settings tab and select "Terms" & "Taxonomy" for the setting "Show meta box" for.

    After that, you'll be able to enter address for each location ("term") when you edit them.

    To show the office address, you can use this snippet:

    $locations = wp_get_object_terms( get_the_ID(),  'office_location_taxonomy' );
    if ( ! empty( $locations ) && ! is_wp_error( $locations ) ) {
        $location = reset( $locations );
        echo 'Address: ', $location->description; // If you use term description.
        echo 'Address: ', rwmb_meta( 'address_field_id', array( 'object_type' => 'term' ), $location->term_id ); // If you use MB Term Meta
    }
    in reply to: No Relationship posts displaying #10395
    Anh TranAnh Tran
    Keymaster

    Hi Doug,

    I've tested your code and found the bug: In the query for single.php, it should be 'from' => get_the_ID(). Your connection is from event to speakers, so if you're on event page, the connection direction should be "from" this event.

    in reply to: Can't get Geolocation autocomplete to work, nor maps #10394
    Anh TranAnh Tran
    Keymaster

    Hi Doug,

    I've worked with the map field and Geolocation in the last couple of days and made some improvements. I've just released a new version of Geolocation extension with a better compatibility with the map field. Previously both Geolocation and map field try to enqueue their own Google Maps scripts, which causes some kind of conflict. This conflict was fine until recently, it prevents some autocomplete for the address field.

    Can you please update it or the Meta Box AIO and let me know how it goes?

    Regarding the "Find Address" button, I also added some small improvements if the map is inside a group. The change is not in the new version of Meta Box yet. It's on Github and you can download it here:

    https://github.com/wpmetabox/meta-box/

    I'm making some other improvements and will release new version of Meta Box when they're done.

    in reply to: clolor picker field problem with front end forms #10386
    Anh TranAnh Tran
    Keymaster

    Hi,

    I've just tested and see no JS errors in the console. Would you mind sharing the code of the meta box you created?

    Anh TranAnh Tran
    Keymaster

    Hi,

    To make things easier, I'd suggest adding a common CSS class (like) for all the radios. You can do that with the class attribute of the field.

    Then, you can perform some JS code like this:

    1. Get total value:
    var total = 0;
    $( '.like input:checked' ).each( function() {
        total += $(this).val();
    } );
    // Output total somewhere
    $( '#selector' ).text( total );

    Anyway, as all the radio have values 1 or 0, the total value is equal to the number of "likes", which can be done with the following code.

    1. Get number of likes:
    var total = $( '.like input:checked' ).length;
    // Show an error message
    if ( total > 30 ) {
        alert( 'You have selected more than 30 likes. Please select again' );
        // or
        $( '.error-message' ).text( 'You have selected more than 30 likes. Please select again' );
    }
    in reply to: Covering indexes #10384
    Anh TranAnh Tran
    Keymaster

    Hi David,

    When you create a table, you can set which column(s) are indexed. Just put the columns you want to index in the last param of MB_Custom_Table_API::create function.

    For example, this code will index the column email:

    MB_Custom_Table_API::create( 'my_custom_table', array(
        'address' => 'TEXT NOT NULL',
        'phone'   => 'TEXT NOT NULL',
        'email'   => 'VARCHAR(20) NOT NULL',
    ), array( 'email' ) );

    See the docs for more info.

    If you want to do that manually with raw SQL, you can do that via a tool like phpMyAdmin.

    Anh TranAnh Tran
    Keymaster

    You can:

    • Get the author of the submitted post (via post_id)
    • Get the current user ID

    And just compare them. When they match, output the shortcode. Otherwise, output some error message.

    in reply to: No wpautop - pulling meta from blog page #10359
    Anh TranAnh Tran
    Keymaster

    Hi,

    This line is correct:

    echo wpautop( $rwmb_meta( 'blog_intro', '' $blog_id ) );

    However, both wpautop and non-wpautop versions have nothing to do with div tags. They only wrap paragraphs into p tags and ignores the br. The div must be entered in the field content. So I'd suggest you ask for the access to the field content and make the change manually, or ask who entered that check the markup in the "Text" mode.

    Anh TranAnh Tran
    Keymaster

    Hi Alex,

    All values in the custom attributes are treated as strings. If we make it run as PHP code, then we have to use something similar to eval, which can open to many security issues. I think it's should be avoided in this case. If you want to do that, please modify and use the exported code instead.

    in reply to: BUG - validating fields in tabs #10344
    Anh TranAnh Tran
    Keymaster

    Hi Alex,

    If you're using the validation, then you're able to set the error message for each field. So, with specific messages, users will know which field has error and will be able to find it in tabs.

    in reply to: Add custom fields to the builder #10342
    Anh TranAnh Tran
    Keymaster

    Hi Alex and Guy,

    As Guy said, it's true that the builder doesn't support custom field types at the moment. We built it with AngularJS and there's some limitation in the code that we couldn't make it possible for developers.

    Anh TranAnh Tran
    Keymaster

    Hi, it’s on the plan and I’ll start working on that next month.

    Anh TranAnh Tran
    Keymaster

    Hi Guy, I got it. Let me find the best way to hide/replace the dashboard.

Viewing 15 posts - 2,011 through 2,025 (of 3,708 total)