Created
November 5, 2019 10:09
-
-
Save alanef/f08542084f67fd6a3aaefbb2249b876f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| Plugin Name: Date Picker Issue | |
| Plugin URI: https:// | |
| Description: Shortcode [datetest] this plugin demonstrates that the id selector does not work when The7 theme is active with WP Bakery and on the WooCommerce shop page | |
| Version: 0.1 | |
| Author: Alan | |
| */ | |
| add_action('wp_enqueue_scripts', function() { | |
| wp_enqueue_script( 'jquery-ui-datepicker' ); | |
| }); | |
| add_action('wp_footer', function(){ | |
| ?> | |
| <script> | |
| (function ($) { | |
| $( "#datepickertestid" ).datepicker(); | |
| $( ".datepickertestclass" ).datepicker(); | |
| } )(jQuery); | |
| </script> | |
| <?php | |
| },998989); | |
| add_shortcode( 'datetest', function ( $atts ) { | |
| ?> | |
| <p>Date via ID: <input type="text" id="datepickertestid"></p> | |
| <p>Date via Class: <input type="text" class="datepickertestclass"></p> | |
| <?php | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment