Support

Account

Forum Replies Created

  • Thanks my issue has been fixed...

  • Hi

    I’m helping my friend with his company website. There are quite few field groups. The most crucial for me is called Open Courses and it refers only to CPT: opencourses. There are number of fields. YET when I’m adding new field (within same field group) they do not appear on the editor. Even if im editing old CPT posts or creating new one, it doesn’t show up. I would need to create and define totally new field group to achieve partially what i wanted to do. What might be the reason?

    thanks my issue has been fixed.

  • Thank you for your suggestion and pointing out how the Select2 handles search. I had just assumed Select2 was doing a text based search via JavaScript on the results. Knowing this, I went ahead an used the same code WooCommerce uses to search their shop_orders. The whole function is below:

    /**
    * WooCommerce Shop Order titles are not search friendly.
    * Use the same thing WooCommerce does to modify search.
    *
    * Taken straight from WooCommerce
    * woocommerce/includes/admin/list-tables/class-admin-list-table-orders.php
    * LN 870
    * FN search_custom_fields()
    *
    * @param WP_Query $wp
    *
    * @return void
    */
    function prefix_modify_shop_order_search_select( $wp ) {

    if( ! ( isset( $_REQUEST[‘action’] ) && ‘acf/fields/post_object/query’ == $_REQUEST[‘action’] ) ) { // Ensure we are in an ACF post_object query action
    return;
    } else if( ! ( isset( $_REQUEST[‘post_id’] ) && ‘options’ == $_REQUEST[‘post_id’] ) ) { // Ensure we’re in an option page ( Specific to my usecase )
    return;
    } else if( ! ( ‘shop_order’ == $wp->query_vars[‘post_type’] && ! empty( $wp->query_vars[‘s’] ) ) ) { // Ensure that the query is a shop_order query and search is not empty.
    return;
    }

    /**
    * All the below is WooCommerce Specific
    */
    $post_ids = wc_order_search( wc_clean( wp_unslash( $wp->query_vars[‘s’] ) ) ); // WPCS: input var ok, sanitization ok.

    if ( ! empty( $post_ids ) ) {
    // Remove “s” – we don’t want to search order name.
    unset( $wp->query_vars[‘s’] );

    // so we know we’re doing this.
    $wp->query_vars[‘shop_order_search’] = true;

    // Search by found posts.
    $wp->query_vars[‘post__in’] = array_merge( $post_ids, array( 0 ) );
    }

    }
    add_action( ‘parse_query’, ‘prefix_modify_shop_order_search_select’ );
    WooCommerce already has the query_vars in place and ready to be parsed. At this point WooCommerce does the heavy lifting. Valid as of WooCommerce version 3.8.0

    thanks my issue has been fixed.

  • I’m also interested in creating a new tab that loads a Google Maps in the tab. Probably the same result you are trying to do. So Bump!

Viewing 8 posts - 1 through 8 (of 8 total)