Skip to content

Instantly share code, notes, and snippets.

View hazratbilal0079's full-sized avatar
💭
I may be slow to respond.

Hazrat Bilal hazratbilal0079

💭
I may be slow to respond.
View GitHub Profile
@hazratbilal0079
hazratbilal0079 / Store Last Login Time in user Meta fields and Check User Status from a specific user Meta Field on Login Action through hook or Code Snippet in WordPress
Created June 6, 2024 09:20
Store Last Login Time in user Meta fields and Check User Status from a specific user Meta Field on Login Action through hook or Code Snippet in WordPress
--Hook Name
storelogin
--PhP Hook
add_action( 'jet-form-builder/custom-action/storelogin', function( $request, $action_handler ) {
// Get the user email from the request
$user_email = $request['login_email'];
// Get the user data by email
$user_data = get_user_by('email', $user_email);
@hazratbilal0079
hazratbilal0079 / Activate or Deactivate User Account through metafield and Update user Role from Frontend in WordPress with Hook or Code Snippet
Last active June 6, 2024 09:27
Activate or Deactivate User Account through metafield and Update user Role from Frontend in WordPress with Hook or Code Snippet
--Hook Name
updateuser
--PHP Hook
add_action( 'jet-form-builder/custom-action/updateuser', function( $request, $action_handler ) {
$user_id = $request['quer_user_id'];
$role = $request['user-current-role'];
$user_status = $request['user-current-status'];
@hazratbilal0079
hazratbilal0079 / Register or Invite New User with Random Password and Custom Role from Frontend with PHP Hook or Code Snippet
Created June 6, 2024 09:37
Register or Invite New User with Random Password and Custom Role from Frontend with PHP Hook or Code Snippet
--Hook Name
registernewuseras
--PHP Hook
add_action( 'jet-form-builder/custom-action/registernewuseras', function( $request, $action_handler ) {
$username = sanitize_user($_POST['emailaddress']);
$email = sanitize_email($_POST['emailaddress']);
$first_name = sanitize_text_field($_POST['firstname']);
$last_name = sanitize_text_field($_POST['lastname']);
$password = sanitize_text_field($_POST['Password']);
@hazratbilal0079
hazratbilal0079 / Hide Previous Repeater Fields while adding New in Edit with jQuery
Created June 24, 2024 06:54
Hide Previous Repeater Fields while adding New in Edit with jQuery
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
<script>
jQuery(document).ready(function($) {
// Hide all existing rows when the page loads
$('.jet-form-builder-repeater__row').hide();
// Attach a click event listener to the "Add New Comment" button
$('.jet-form-builder-repeater__new').on('click', function() {
// We need to wait for the new row to be added to the DOM
setTimeout(function() {
@hazratbilal0079
hazratbilal0079 / How to save session time for each user in WordPress, monitor it in real-time
Last active August 29, 2024 05:12
How to save session time for each user in WordPress, monitor it in real-time
Note:
Create two meta fields in the user profile. In my case, the slug for the daily timing meta field is "usersessiontime"
and for the lifetime meta field, it is "user_daily_time" and for monthly record metafield is "monthly_session_store".
In case i set the idol time 20 seconds.
@hazratbilal0079
hazratbilal0079 / css file
Last active September 11, 2024 12:23
Tabbed card layout in Html/CSS
.card.tabbed {
display: flex;
border: 1px solid #ddd;
border-radius: 8px;
overflow: hidden;
background: #fff;
margin: 20px;
}
@hazratbilal0079
hazratbilal0079 / css file
Created September 11, 2024 12:26
Mansory Card layout in HTML and CSS
.masonry-horizontal {
display: flex;
background-color: #f9f9f9;
border: 1px solid #ddd;
border-radius: 8px;
overflow: hidden;
height: 100%;
}
.masonry-image {
@hazratbilal0079
hazratbilal0079 / gist:ade5f52832e5f587090bc9276dea4405
Created September 11, 2024 12:28
Accordion card layout in HTML and CSS
<div class="card accordion">
<div class="card-image">
<img src="https://vipprops.ae/wp-content/uploads/jet-form-builder/2172fde49301047270b2897085e4319d/2024/09/Ocean-terrace.jpg" alt="Ocean Terrace">
</div>
<div class="card-content">
<h3>Hazrat Bilal Timber/Twing Accordion Card Layout 03</h3>
<div class="accordion-sections">
<div class="accordion-section">
<input type="checkbox" id="section1" class="accordion-toggle">
<label for="section1" class="accordion-header">Section 1</label>
@hazratbilal0079
hazratbilal0079 / CSS
Created September 11, 2024 12:30
On Mouse Over Display Details Card layout in Html and CSS
.overlay-card {
position: relative;
width: 100%;
max-width: 1200px; /* Adjust as needed */
height: 420px;
margin-bottom: 20px; /* Space between cards */
border-radius: 8px;
overflow: hidden;
}
@hazratbilal0079
hazratbilal0079 / CSS
Created September 11, 2024 12:31
Grid Card layout with fixed Background in HTML and CSS
.fixed-overlay-card {
position: relative;
width: 100%;
max-width: 1200px; /* Adjust as needed */
height: 420px;
margin-bottom: 20px; /* Space between cards */
border-radius: 8px;
overflow: hidden;
display: flex;
align-items: center;