anwind
Forum Replies Created
-
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] email confirmationthe question is closed
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] email confirmationin order not to create a new topic, one more question
add_filter( "adverts_form_load", "make_readonly_name" ); function make_readonly_name( $form ) { if( $form['name'] != "advert" ) { return $form; } if( is_admin() ) { return $form; } foreach( $form["field"] as $key => $field ) { if( in_array($field["name"], array( "adverts_person" ) ) ) { $form["field"][$key]["attr"] = array( "readonly" => "readonly" ); } } return $form; }
This is the code that prohibits changing the contact person.
It is necessary to prohibit email fieldsForum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] locationOh, yes, adding styles helped, it works. Thanks.
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] locationGood afternoon. Did I understand correctly.
1. The code I added to the plugin is profunctions
2. Added my APIadd_action( "init", function() { wp_register_style( 'dataru-css', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/suggestions.min.css', array(), "21.12.0" ); wp_register_script( 'dataru-js', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/js/jquery.suggestions.min.js', array( 'jquery' ), "21.12.0" ); }); add_action( 'wp_enqueue_scripts', function() { wp_enqueue_script( 'dataru-js' ); wp_enqueue_style( 'dataru-css' ); }); add_action( 'wp_footer', function() { ?> <script> document.addEventListener("DOMContentLoaded", function(event) { if( jQuery("#adverts_location").length === 0) { return; } jQuery("#adverts_location").suggestions({ token: "71198f64877251cba46a2a88ab061f4a4369298a", type: "ADDRESS", /* Вызывается, когда пользователь выбирает одну из подсказок */ onSelect: function(suggestion) { console.log(suggestion); } }); }); </script> <?php },1000);
Does not work https://websgood.ru/adverts/add?preselected_category=dlya-avtomobilej
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] locationhttps://dadata.ru/suggestions/usage/address/
To connect to the domain, registration on the website is required https://dadata.ru
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] locationUnfortunately not in English. The example is not related to [adverts_add] it’s just the logic of what would be nice to do. It is a pity that it is impossible to implement the plan.
Forum: Plugins
In reply to: [WPAdverts - Classifieds Plugin] locationit would be great to implement this in the location field on the add page and in the search form.