Uncategorized

make stickey div in wordpress plugin

 <style> .kanha { top: 32px; } </style> <div class=“container mt-3”> <!– welcome message –> <div class=” sticky-top alert alert-warning kanha” role=“alert”> <h4 class=“alert-heading”><?php _e(‘Welcome to’,‘push-notifications-reloaded’);?> <b><?php _e(‘Push Notifications Reloaded’,‘push-notifications-reloaded’);?> </b> <span>Help</span> </h4> <p><?php _e(‘A simple & easy way to send ‘,‘push-notifications-reloaded’);?> <b><?php _e(‘Push Notifications.’,‘push-notifications-reloaded’);?></b> </p> </div> </div>

when post is published send email to admin email

  function post_published_notification( $post_id, $post ) { $author = $post->post_author; /* Post author ID. */ $name = get_the_author_meta( ‘display_name’, $author ); $email = get_the_author_meta( ‘user_email’, $author ); $title = $post->post_title; $permalink = get_permalink( $post_id ); $edit = get_edit_post_link( $post_id, ” ); $to[] = sprintf( ‘%s <%s>’, $name, $email ); $subject = sprintf( ‘Published: %s’, $title …

when post is published send email to admin email Read More »

open a small windows in same tab

  function webpushr_signup_popup(){ window.open(‘https://app.webpushr.com/signup?url=<?= site_url();?>‘,“wpushr-signup-dialog”,“width=600, height=550, resizable=0, scrollbars=0, status=0, titlebar=0, left=” + ((screen.width – 600) / 2) + “, top=” + ((screen.height – 550) / 2) ); }

auto sorting disabled

 <!DOCTYPE html> <html> <head> <title>Title of the document</title> <link href=“https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/css/select2.css” rel=“stylesheet” /> <script src=“https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.js”></script> <script src=“https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.0/js/select2.js”></script> </head> <script> $(document).ready(function () { $(“select”).select2(); $(“select”).on(“select2:select”, function (evt) { var element = evt.params.data.element; var $element = $(element); $element.detach(); $(this).append($element); $(this).trigger(“change”); }); $(‘.js-example-basic-multiple’).select2(); }); </script> <body> <form action=“” method=“get”> <select style=“max-width:910%;“ class=“js-example-basic-multiple” name=“states[]” multiple=“multiple”> <option value=“AL”>Alabama</option> <option value=“B”>BAT</option> <option …

auto sorting disabled Read More »

check email exist or not

        global $wpdb;         $table_name = $wpdb->prefix . “wcmnd_analytics”;         $email = “[email protected]”;         $sql = “SELECT email FROM $table_name WHERE email =‘$email’ “;         $existEmail =  $wpdb->get_var($sql);         if (!$existEmail) {             echo ‘not exists’;         }         else{             echo ‘ exists’;         }  

how to registerer script and then enqueue when it needed

 function wpb_adding_scripts() {   wp_register_script(‘my_amazing_script’, plugins_url(‘amazing_script.js’, __FILE__), array(‘jquery’),‘1.1’, true);   wp_enqueue_script(‘my_amazing_script’); }    add_action( ‘wp_enqueue_scripts’, ‘wpb_adding_scripts’ ); refre= https://developer.wordpress.org/reference/functions/wp_register_script/ function wpb_adding_styles() { wp_register_style(‘my_stylesheet’, plugins_url(‘my-stylesheet.css’, __FILE__)); wp_enqueue_style(‘my_stylesheet’); } add_action( ‘wp_enqueue_scripts’, ‘wpb_adding_styles’ ); 

copy to clipboard

//function for copy to clipboard data function copyToClipboard(element) { var $temp = $(“<input>”); $(“body”).append($temp); $temp.val($(element).html()).select(); document.execCommand(“copy”); $temp.remove(); $(“.copy”).html(“Copied”); } //function for copy to clipboard data function tableCopy(element,id) { var $temp = $(“<input>”); $(“body”).append($temp); $temp.val($(element).html()).select(); document.execCommand(“copy”); $temp.remove(); // $(“#showAfterCopy”).show(); // $(id).html(“Copied”); $(“#liveToast”).toast(“show”); } //kanha best function for copy to clipboard data function copyNew() { var copyTextarea …

copy to clipboard Read More »

insert data into wordpress table

 <?php if ( isset( $_POST[‘submit’] ) ){ global $wpdb; $tablename=$wpdb–>prefix.‘post_job’; $data=array( ‘organizationname’ => $_POST[‘organizationname’], ‘post’ => $_POST[‘post’], ‘publishfrom’ => $_POST[‘publishfrom’], ‘publishupto’ => $_POST[‘publishupto’], ‘qualification1’ => $_POST[‘qualification1’], ‘qualification2’ => $_POST[‘qualification2’], ‘qualification3’ => $_POST[‘qualification3’], ‘qualification4’ => $_POST[‘qualification4’], ‘experience1’ => $_POST[‘experience1’], ‘experience2’ => $_POST[‘experience2’], ‘experience3’ => $_POST[‘experience3’], ‘training1’ => $_POST[‘training1’], ‘training2’ => $_POST[‘training2’], ‘training3’ => $_POST[‘training3’], ‘training4’ => …

insert data into wordpress table Read More »