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 | |
| $city = null; | |
| $get_city_array = array(); | |
| $get_args_emploi = array( | |
| 'post_type' => 'emploi', | |
| 'posts_per_page' => -1, | |
| 'post_status' => array('publish', 'draft', 'future'), | |
| 'orderby' => 'date', |
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
| jQuery(document).ready(function($) { | |
| jQuery('.monemploi_add_code_postal_text').on('keydown', function(event) { | |
| geocoder = new google.maps.Geocoder(); | |
| var adresse = jQuery('.monemploi_add_code_postal_text').val(); | |
| geocoder.geocode({ 'address': adresse }, function(results, status) { | |
| if (results[0]) { | |
| var city = ""; | |
| for (var i = 0; i < results[0].address_components.length; i++) { | |
| for (var b = 0; b < results[0].address_components[i].types.length; b++) { | |
| if (results[0].address_components[i].types[b] == "locality") { |
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 | |
| function send_email_on_future_publish( $new_status, $old_status, $post ) { | |
| // Check if the new status is 'publish' and the old status was 'future' | |
| if ( 'publish' === $new_status && 'future' === $old_status ) { | |
| // Ensure it's a 'post' type (can add other post types if needed) | |
| if ( 'post' === $post->post_type ) { | |
| $author = get_userdata( $post->post_author ); | |
| $author_email = $author->user_email; | |
| $post_title = get_the_title( $post->ID ); |
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 | |
| function create_scheduled_post_programmatically() { | |
| // Define the future publication date and time | |
| $schedule_timestamp = strtotime('+1 day 10:00:00'); // Example: Schedule for tomorrow at 10 AM | |
| // Convert the timestamp to the required MySQL datetime format | |
| $publish_date = date('Y-m-d H:i:s', $schedule_timestamp); | |
| // Convert to GMT time for post_date_gmt, accounting for your WordPress site's timezone settings | |
| $publish_date_gmt = get_gmt_from_date($publish_date); |
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
| var count = 0; | |
| $("#update").click(function() { | |
| count++; | |
| $("#counter").html("My current count is: "+count); | |
| }); | |
| $("#update").click(function() { | |
| count += 120; // increase by 120 |
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
| // Source - https://stackoverflow.com/a/45591102 | |
| // Posted by hallleron | |
| // Retrieved 2026-02-06, License - CC BY-SA 3.0 | |
| $('input[name="name"]').on('keyup keydown', updateCount); | |
| function updateCount() { | |
| $('#characters').text($(this).val().length); | |
| } |
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
| <form action="<?php echo esc_url( admin_url('admin-post.php') ); ?>" method="post" enctype="multipart/form-data"> | |
| <!-- Security field --> | |
| <?php wp_nonce_field( 'media_upload', 'media_upload_nonce' ); ?> | |
| <label for="file_upload">Select File:</label> | |
| <input type="file" name="file_upload" id="file_upload" required /> | |
| <input type="hidden" name="action" value="frontend_media_upload"> | |
| <input type="submit" name="submit" value="Upload Media" /> | |
| </form> | |
| <?php |
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
| // Source - https://stackoverflow.com/a | |
| // Posted by James | |
| // Retrieved 2026-01-14, License - CC BY-SA 3.0 | |
| function getDistance() | |
| { | |
| //Find the distance | |
| var distanceService = new google.maps.DistanceMatrixService(); | |
| distanceService.getDistanceMatrix({ | |
| origins: [$("#autocompleteDeparture").val()], |
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 | |
| add_action( 'um_registration_set_extra_data', 'my_custom_after_registration_action', 10, 2 ); | |
| function my_custom_after_registration_action( $user_id, $args ) { | |
| if ( empty( $user_id ) || is_wp_error( $user_id ) ) { | |
| return; | |
| } | |
| // Check if the specific radio button field value exists in the submitted data |
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 | |
| function add_custom_item_to_menu( $items, $args ) { | |
| if ( $args->theme_location == 'primary-menu' ) { | |
| $user = wp_get_current_user(); | |
| $user_meta = get_userdata($user->ID); | |
| $user_role = $user_meta->roles[0]; | |
| if($user_role == 'um_employeur' || $user_role == 'administrator'){ | |
| $items .= "<li id='main-menu'><a href='https://monemploi.net/ajouter-un-emploi/'>Ajouter un emploi</a></li>"; | |
| } |
NewerOlder