How do I convert all custom_field php timestamps in the database to js timestamps?

ACF using milliseconds is not standard for timestamps, and nor is it useful. How much accuracy do you need? Bear in mind that converting to something like yyyymmdd will not accommodate timezones. If you have access to PHPMyAdmin (or similar) and know your way around SQL, running a quick query would probably be the easiest … Read more

how to make wordpress plugin from PersianWebToolkit? [closed]

It sounds like you need an introduction to plugin development. As in all things WordPress Development, the WordPress Codex is the first place to look. Here is the Plugin Development information: https://developer.wordpress.org/plugins/ But you will need some PHP programming knowledge. Here’s one good place to start: https://www.w3schools.com/php/default.asp . And the googles have plenty of information … Read more

How do I sanitize the str_replace function in javascript variables

esc_js() is intended for escaping data for use within an HTML attribute. If you want to escape data for use within an inline script, wp_json_encode() should be sufficient. For example: var disabledDays = <?php echo wp_json_encode( $iva_disable_days ); ?>; This outputs: var disabledDays = [“4\/7\/2018″,”11\/18\/2017”]; If you check the variable in your dev tools console, … Read more

datepicker for custom post type admin

Issues I noticed in your code I don’t see where/how you’re calling that custom datepicker() function and you should use the same admin_enqueue_scripts hook for registering/enqueueing a stylesheet (.css) file. You should only load the CSS and JS files on the pages where the styles and scripts are being used, e.g. in your case, the … Read more

Adding jQuery datepicker to Custom Post Type Metabox [closed]

To properly work I didn’t write my js file like you. My code will only stand for admin side not the frontend. In the js enqueue js file (date-picker.js): jQuery(document).ready(function(){ jQuery(‘.ads_datepicker’).datepicker({ dateFormat: ‘yy-mm-dd’ }); }); I enqueue my script like this add_action( ‘admin_enqueue_scripts’, array($this, ‘enqueue_date_picker’ ) ); public function enqueue_date_picker(){ wp_enqueue_script( ‘date-picker-js’, plugins_url(‘/js/date_picker.js’, __FILE__), array(‘jquery’, … Read more