Un utente ha chiesto 👇
Ciao a tutti
Voglio usare lo stesso selettore di date dei Pod, in un codice personalizzato che ho scritto.
Posso chiedere gentilmente quale script utilizza il datetimepicker di Pod e come posso utilizzarlo?
Grazie in anticipo
Mathias
Lanciatore di thread
(@baggadap)
2 anni, 5 mesi fa
Ho cercato in una fonte PODS e ho scoperto come funziona. Carica prima gli script corretti:
/**
* Load Timepicker add-on
*
*
*
*/
if ( ! wp_script_is( 'jquery-ui-slideraccess', 'registered' ) ) {
// No need to add dependencies. All managed by jquery-ui-timepicker.
wp_register_script( 'jquery-ui-slideraccess', trailingslashit( plugin_dir_url( __DIR__ ) ) . 'pods/ui/js/timepicker/jquery-ui-sliderAccess.js', array(), '0.3' );
}
if ( ! wp_script_is( 'jquery-ui-timepicker', 'registered' ) ) {
wp_register_script(
'jquery-ui-timepicker', trailingslashit( plugin_dir_url( __DIR__ ) ) . 'pods/ui/js/timepicker/jquery-ui-timepicker-addon.min.js', array(
'jquery',
'jquery-ui-core',
'jquery-ui-datepicker',
'jquery-ui-slider',
'jquery-ui-slideraccess',
), '1.6.3'
);
}
if ( ! wp_style_is( 'jquery-ui-timepicker', 'registered' ) ) {
wp_register_style( 'jquery-ui-timepicker', trailingslashit( plugin_dir_url( __DIR__ ) ) . 'pods/ui/js/timepicker/jquery-ui-timepicker-addon.min.css', array(), '1.6.3' );
}
wp_enqueue_script('jquery-ui-timepicker');
wp_enqueue_style( 'jquery-ui-custom', trailingslashit( plugin_dir_url( __DIR__ ) ) . 'pods/ui/css/smoothness/jquery-ui.custom.css' );
wp_enqueue_style( 'jquery-ui-timepicker' );
Quindi contattare es
$('#basic_example_1').datetimepicker();
Questa risposta è stata modificata 2 anni, 5 mesi fa. Donatore di plugin
(@pglewis)
2 anni, 5 mesi fa
D’ora in poi funzionerà ed ecco le informazioni che stavo per includere per te prima che tu facessi il lavoro alle gambe da solo.
Facci sapere che Gutenberg ha un componente DateTime basato sulla reazione e passeremo sicuramente a quello a 2.8. Devo approfondire il problema del GH che avevano per quel nuovo componente, l’ultima volta che ho guardato qualche settimana fa avevano ancora molte cose da fare.
wordpress.org/gutenberg/handbook/components/date-time/
Questa risposta è stata modificata 2 anni, 5 mesi fa. Questa risposta è stata modificata 2 anni, 5 mesi fa. Questa risposta è stata modificata 2 anni, 5 mesi fa.
Was this helpful?
0 / 0