Locations & Profile Field

This topic contains 3 replies, has 2 voices, and was last updated by  rikbutterflyskull 8 years, 2 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #134841

    rikbutterflyskull
    Expired Member
    Post count: 3

    Hi, i need to know if there is a way to add Locations as Profile Field in BuddyPress XProfile field.

    In particular i’m looking for a way to add in xprofile a dropdown selector with the locations registered in geodir. I have 370 locations, members from these location can signup my site, should be kind to use geodir loc. instead to create fields ex novo.

    If there isn’t an easy way, how location are registered in wp and is possible to have a public list?

    Thanks, Riccardo

    #134851

    rikbutterflyskull
    Expired Member
    Post count: 3
    This reply has been marked as private.
    #135326

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hello, u can us the follwoing function to get there, if you want an array try something like this: print_r(geodir_get_location_array(array(‘format’=>array(‘type’ => ‘array’),’location_link_part’ => false)));
    If you need more exact help just let me know, if you look at the function is is pretty well commented.

    
    
    /**
     * Get location array using arguments.
     *
     * @since 1.0.0
     * @since 1.4.1 Modified to apply country/city & region/city url rules.
     * @since 1.4.4 Updated for the neighbourhood system improvement.
     * @package GeoDirectory_Location_Manager
     *
     * @global object $wpdb WordPress Database object.
     *
     * @param null|array $args {
     *    Attributes of args.
     *
     *    @type string $what What do you want to query. Possible values: city, region, country. Default: 'city'.
     *    @type string $city_val City value.
     *    @type string $region_val Region value.
     *    @type string $country_val Country value.
     *    @type string $country_non_restricted Non restricted countries.
     *    @type string $region_non_restricted Non restricted regions.
     *    @type string $city_non_restricted Non restricted cities.
     *    @type bool $filter_by_non_restricted Filter by non restricted?.
     *    @type string $compare_operator Comparison operator.
     *    @type string $country_column_name Country column name.
     *    @type string $region_column_name Region column name.
     *    @type string $city_column_name City column name.
     *    @type bool $location_link_part Location link part.
     *    @type string $order_by Order by value.
     *    @type string $no_of_records No of records to return.
     *    @type string $spage Current page number.
     *    @type array $format {
     *        Attributes of format.
     *
     *        @type string $type Type. Default: 'list'.
     *        @type string $container_wrapper Container wrapper. Default: 'ul'.
     *        @type string $container_wrapper_attr Container wrapper attr.
     *        @type string $item_wrapper Item wrapper. Default: 'li'.
     *        @type string $item_wrapper_attr Item wrapper attr.
     *
     *    }
     *
     * }
     * @param bool $switcher Todo: describe this part.
     * @return array|mixed|string
     */

    Stiofan

    #135408

    rikbutterflyskull
    Expired Member
    Post count: 3

    No not now. That function i posted seems not working well with db and query, cause creates a new field for every page load. For me now is better to add manually my locations. If i deactivate GD i’ll keep my locations for bp field.

    Many thanks

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

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket