my notepad code notes

 /*********************SHORT CODE***********************/

function event_shortcode_display_post($attr, $content = null){

 

    $args = array(

                    'category_name'  => '',

                    'posts_per_page' => '3',

                    'order'          => 'desc',

                    'post,'          => 'post',  

'post_status' =>'publish'

                 );

 

                     

    $recent_posts = get_posts($args);

if(isset($_GET['test'])){

/* echo "<pre>";

print_r($recent_posts);die; */

}


    $output = '<ul class="postslide">';

 

    foreach ($recent_posts as $eventpost) :

$cat='';

$categories=get_the_category($eventpost->ID);

        $thumbid=get_post_thumbnail_id($eventpost->ID);

$url=wp_get_attachment_image_url($thumbid,'original');

$display_name = get_the_author_meta( 'display_name' , $eventpost->post_author ); 

$output .= '<li style="background-image:url('. $url. ')"><div class="textinfo"><a href="'.get_permalink().'"><h3>'.$eventpost->post_title.'</h3></a><div class="meta-data"><span><a href="'.get_the_author_link($eventpost->post_author).'">'.$display_name.'</a></span><span>'.date_format(date_create($eventpost->post_date),'d F Y').'</span><span>';

foreach($categories as $key=>$cat){

$output .='<a href="'.get_category_link($cat->term_id).'">'.$cat->name.'</a>';

if($key!=count($categories)-1){

$output .=',';

}

$output .= '</span><span>'.$eventpost->comment_count.' Commentaire</span></div>';  

$output .= '<p>'.strip_shortcodes(wp_trim_words( $eventpost->post_content, 35 )).'</p>

<a class="bn" href="'.get_permalink().'">Lire Plus</a>

</div></li>';      

  

    endforeach;    

     

    wp_reset_postdata();

 

    $output .= '</ul>

<script>

var $=jQuery;

$(document).ready(function($){

$(".postslide").slick({

arrow:false,

dots:true,

fade:true,

});

});

</script>

';

     

    return $output;


}

/*********short code end***********/


/*********create texonomi start***********/


 function wporg_register_taxonomy_subjects() {

     $labels = array(

         'name'              => _x( 'subjects', 'taxonomy general name' ),

         'singular_name'     => _x( 'subjects', 'taxonomy singular name' ),

         'search_items'      => __( 'Search subjects' ),

         'all_items'         => __( 'All subjects' ),

         'parent_item'       => __( 'Parent subjects' ),

         'parent_item_colon' => __( 'Parent subjects:' ),

         'edit_item'         => __( 'Edit subjects' ),

         'update_item'       => __( 'Update subjects' ),

         'add_new_item'      => __( 'Add New subjetcs' ),

         'new_item_name'     => __( 'New subjects Name' ),

         'menu_name'         => __( 'subjects' ),

     );

     $args   = array(

         'hierarchical'      => true, // make it hierarchical (like categories)

         'labels'            => $labels,

         'show_ui'           => true,

         'show_admin_column' => true,

         'query_var'         => true,

         'rewrite'           => [ 'slug' => 'subjects' ],

     );

     register_taxonomy( 'subjects',  ['post'] , $args );

}

add_action( 'init', 'wporg_register_taxonomy_subjects' );

 

add_shortcode( 'event_posts', 'event_shortcode_display_post' );//shortcode for event post


/*********create texonomi end***********/


$posttags = get_the_tags();

if ($posttags) {

  foreach($posttags as $tag) {

    echo $tag->name . ' '; 

  }

}

/*********************SHORT CODE***********************/


//clothing 4 print//

cloting 4 print csv 1st import the file and after check the combination in admin.

/*********css*********/

0 0 0 0 top right bottom left

/*********css*********/

https://chopstixandrice.com.sg/wp/

 chopstix password same in admin and ftp

 

 Reviews From Our Customers upr inst

 

 

our-esteemed-menus

/************google review get in wordpres*******/

plugin =>Widgets for Google Reviews 


<h4>The Healthier Choice</h4>

<h4>Everyday Staples</h4>



everyday-staples

the-healthier-choice


catring adimn login vodein details======>

https://www.vodien.com/login/

SavouryCatering

Neo#7966


Wordpress ACF function details ==>

https://www.advancedcustomfields.com/resources/



daily entry =>




chilmins custom css=>

https://www.chillimanis.com.sg/wp-admin/customize.php?url=https%3A%2F%2Fwww.chillimanis.com.sg%2F


chopstix ftp ==>

103.11.191.170

chopstix

WmH&<QzJAfq2X@eTR3wC


/********************put the code style.css************************/

Child Theme Create put the code style.css

/* css child

 Theme Name:   AstraChild

 Theme URI:    

 Description:  Astra Child Theme

 Author:       Ipack

 Author URI:   https://ipacktechnologies.com

 Template:     astra

 Version:      1.0.0

 License:      GNU General Public License v2 or later

 License URI:  http://www.gnu.org/licenses/gpl-2.0.html

 Tags:         light, dark, two-columns, right-sidebar, responsive-layout, accessibility-ready

 Text Domain:  AstraChild

*/

/***********************css put code function file*******************/ 

functions file put the code css set regarding


add_action( 'wp_enqueue_scripts', 'my_plugin_add_stylesheet' );

function my_plugin_add_stylesheet() {

    wp_enqueue_style( 'my-style', get_stylesheet_directory_uri() . '/style.css', false, '1.0', 'all' );

}

 */

/************************add new texonomi***************************/

function add_custom_taxonomies() {

  // Add new "Locations" taxonomy to Posts

  register_taxonomy('location', 'post', array(

    // Hierarchical taxonomy (like categories)

    'hierarchical' => true,

    // This array of options controls the labels displayed in the WordPress Admin UI

    'labels' => array(

      'name' => _x( 'Locations', 'taxonomy general name' ),

      'singular_name' => _x( 'Location', 'taxonomy singular name' ),

      'search_items' =>  __( 'Search Locations' ),

      'all_items' => __( 'All Locations' ),

      'parent_item' => __( 'Parent Location' ),

      'parent_item_colon' => __( 'Parent Location:' ),

      'edit_item' => __( 'Edit Location' ),

      'update_item' => __( 'Update Location' ),

      'add_new_item' => __( 'Add New Location' ),

      'new_item_name' => __( 'New Location Name' ),

      'menu_name' => __( 'Locations' ),

    ),

    // Control the slugs used for this taxonomy

    'rewrite' => array(

      'slug' => 'locations', // This controls the base slug that will display before each term

      'with_front' => false, // Don't display the category base before "/locations/"

      'hierarchical' => true // This will allow URL's like "/locations/boston/cambridge/"

    ),

  ));

}

add_action( 'init', 'add_custom_taxonomies', 0 );


add_action('init','create_custom_posts'); 


function create_custom_posts(){

  register_post_type( 'cms_chooser', array(

            'labels' => array(

                'name' => 'Product',

                'singular_name' => 'Product',

                'add_new' => 'Add New',

                'add_new_item' => 'Add Product',

                'edit_item' => 'Edit',

                'edit' => 'CMS',

                'new_item' => 'New CMS',

                'view_item' => 'View Detail',

                'search_items' => 'Search in CMS',

                'not_found' => 'No CMS found',

                'not_found_in_trash' => 'No Posts found in Trash',

                'view' => 'View Post'

            ),

            'public' => true,

            //'capability_type' => 'post',

            'hierarchical' => true,

            'exclude_from_search' => false,

            'show_in_nav_menus' =>  false,

            'query_var' => true,

            'menu_position' => 5,

            'supports' => array('title','page-attributes'),

            'has_archive' => true,

            'taxonomies' => array('cms-category'),

            'rewrite' => array('slug' => 'cms', 'with_front' => false )

        )

    );


    register_taxonomy(

        'cms-category',

        'cms_chooser',

        array(

            'labels' => array(

                'name' => 'Category',

                'singular_name' => 'Category',

                'search_items' =>  'Search Category',

                'popular_items' => 'Popular Category',

                'all_items' => 'All Category',

                'parent_item' => 'Parent Category',

                'parent_item_colon' => 'Parent Category',

                'edit_item' => 'Edit Category',

                'update_item' => 'Update Category',

                'add_new_item' => 'Add New Category',

                'new_item_name' => 'New Category Name'

            ),

            'hierarchical' => false,

            'show_in_nav_menus' = >  false,

            'exclude_from_search' => true,

            'public' => false,

            'show_ui' => true,

            'query_var' => 'cms-category',

            'show_tagcloud' => true,

            'rewrite' => true

        )

    );


}

http://212.8.250.46/e-landing-page-sitemap.xml

http://212.8.250.46/e-landing-page-sitemap.xml


/************************site logo in  url beaver builder**********************/

customize=>Site Identity 


password=>223371@??


/***********chopstix***************/

https://chopstixandrice.com.sg/wp/wp-login

chopstix

WmH&<QzJAfq2X@eTR3wC

/***********chopstix***************/


gmail login details=>

sharkytechnologygr@gmail.com

Sz3?4@xAoJ*1!7N



https://search.google.com/search-console/sitemaps?resource_id=http%3A%2F%2F212.8.250.46%2F


https://search.google.com/search-console/sitemaps?resource_id=http%3A%2F%2F212.8.250.46%2F

https://www.jcchouinard.com/sitemap-could-not-be-read-couldnt-fetch-in-google-search-console/

https://www.jcchouinard.com/url-inspection-tool/


website speed testing => https://gtmetrix.com/reports/212.8.250.46/itXxH4xb/#


https://wpengine.com/resources/remove-render-blocking-javascript-css-wordpress/

Autoptimize


/**********category sidebar set**************/

http://212.8.250.46/wp-admin/customize.php?url=http%3A%2F%2F212.8.250.46%2Fcategory%2Fcomputers%2F



/********evenzia user login details*******/

dev.y@evenzia.com

123@123.com

/********evenzia user login details*******/


/**** besa orignal site link****/

https://el3.thembaydev.com/besa2/category/furniture/?blog_archive_layout=left-main&blog_columns=2


/*********reward and point modual use in sharkey*********/

https://wordpress.org/plugins/points-and-rewards-for-woocommerce/


/******************Http to https Url redarect********************/

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

/******************Http to https Url redarect********************/

/***********garden stuff entry************/

https://www.gardenstuff.it/db.php?username=root&db=ps_gardenstuff_eliot_1&select=collected_env_data_test&columns%5B0%5D%5Bfun%5D=&columns%5B0%5D%5Bcol%5D=&where%5B0%5D%5Bcol%5D=device_zone&where%5B0%5D%5Bop%5D=%3D&where%5B0%5D%5Bval%5D=Monstera&where%5B1%5D%5Bcol%5D=survey_date&where%5B1%5D%5Bop%5D=LIKE+%25%25&where%5B1%5D%5Bval%5D=2022-02-04&where%5B3%5D%5Bcol%5D=&where%5B3%5D%5Bop%5D=%3D&where%5B3%5D%5Bval%5D=&limit=50&text_length=100&order%5B0%5D=survey_date&desc%5B0%5D=1

/*****************Start Laravel Notes**********************/

What is namespace in PHP Laravel=>

Namespaces can be defined as a class of elements in which each element has a unique name to that associated class. It may be shared with elements in other classes.


What are traits in Laravel?

“Traits are a mechanism for code reuse in single inheritance languages such as PHP. A Trait is intended to reduce some limitations of single inheritance by enabling a developer to reuse sets of methods freely in several independent classes living in different class hierarchies

/*****************End Laravel Notes**********************/

/************************Laravel9 API authentication token Create*************************/

Rest api authentication token=>

(i)Passport(ii)Sanctum.

1)Passport=>https://www.tutsmake.com/laravel-9-rest-api-with-passport-authentication-tutorial/

2)Sanctum=>https://dev.to/shanisingh03/laravel-api-authentication-using-laravel-sanctum-edg

2)Sanctum=>https://www.twilio.com/blog/build-restful-api-php-laravel-sanctum


/*********************put and patch in API******************/

PUT is a method of modifying resource where the client sends data that updates the entire resource . PATCH is a method of    modifying resources where the client sends partial data that is to be updated without modifying the entire data.

/*******/

/***************JSON******************/

JavaScript Object Notation

/***************JSON******************/


jQuery(".dropdown_menu").click(function() { 

jQuery(".custom_togggle").toggleClass("active"); 

});

/******************* perent class te base te child class add karne waste*********************/ 

jQuery(".custom_togggle").click(function() { 

jQuery(".dropdown-item").toggleClass("active"); 

}); 

/******************* perent class te base te child class add karne waste*********************/ 

 

/*******************class te click te id te base te html design get karne wasete*********************/ 

jQuery(".dropdown .dropdown-menu .dropdown-item").click(function() { 

var data = jQuery(this).html();

//console.log("jhkj");

console.log(data);

jQuery("#dropdownMenuButton").html(data);

}); 

/*******************class te click te id te base te html design get karne wasete*********************/ 


/*******************class te child te base te onload te id da data use karne waste*********************/ 

jQuery(document).ready(function() { 

var data = jQuery(".dropdown .dropdown-menu .dropdown-item:first-child").html();

jQuery("#dropdownMenuButton").html(data);

});


/*******************class te child te base te onload te id da data use karne waste*********************/ 

/*******************Js and jquery events start*********************/ 

Form events blur onblur

change onchange

focus onfocus

focusin onfocusin

select onselect

submit onsubmit

Keyboard events

keydown onkeydown

keypress onkeypress

keyup onkeyup

focusout

Mouse events

  click onclick

dblclick ondblclick

focusout

hover

mousedown onmousedown

mouseenter onmouseenter

mouseleave onmouseleave

mousemove onmousemove

mouseout onmouseout

mouseover onmouseover

mouseup onmouseup

Toggle

Browser events

  Error onerror()

Resize onresize

Scroll onscroll

Document loading

  Load onload

Ready

Unload onunload 


/*******************Js and jquery events start*********************/ 

/*******************NextTradeAdminDetails*********************/ 

Bluehost.com

User: nexttradefx.in

Pwd: Amit@0427

/*******************NextTradeAdminDetails*********************/


/*******************SearchWithAjaxJs*********************/

/*******************js*********************/

/*******************link=>https://nexttradefx.in/forex-glossary/*********************/

jQuery("#forex-glossary #forex-search #btn").click(function(e) { 

e.preventDefault();

//var val = $(this).text();

var str = $("#gsearch").val();

console.log(str); 

jQuery("#forex-glossary .pills-tab li").removeClass("active");

jQuery(this).parent().addClass("active");

jQuery("#forex-glossary .accordionlist .accordionpagen").text(str);

data={'str':str,'action':'getGlosrayData',}

jQuery.ajax({

type:"POST",

url: "/wp-admin/admin-ajax.php",

data: data,

success:function(data){

data = JSON.parse(data);

console.log("data");

console.log(data['html']);

if(data['html'].length > 0){

jQuery("#forex-glossary #accordionFlushExample").html(data['html']); 

}

}

});

});

/*******************js*********************/

/*******************PHP*********************/

function getGlosrayData(){

   

    global $wpdb;  

  //$catId = $_POST['catId'];

$search = $_POST['str'];

$q2 = array(

            'post_type' => 'faq',

            'posts_per_page'    => -1,

            's'=>$search,           

        );

$query = new WP_Query( $q2 ); 

$html = '';

if(isset($query->posts) && !empty($query->posts)){

foreach ($query->posts as $key=>$post){

$html .= '<div class="accordion-item">

<h2 class="accordion-header" id="flush-heading'.$post->ID.'">

  <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapse'.$post->ID.'" aria-expanded="false" aria-controls="flush-collapse'.$post->ID.'">

'.$post->post_title.'

  </button>

</h2>

<div id="flush-collapse'.$post->ID.'" class="accordion-collapse collapse" aria-labelledby="flush-heading'.$post->ID.'" data-bs-parent="#accordionFlushExample">

  <div class="accordion-body">

  <p>'.$post->post_content.'</p></div>

</div>

</div>';

}

}else{

$html .= '<h4 class="custom-no-result"> No result Found!</h4>';

}

$response = array("html" => $html);

print_r(json_encode($response));

wp_die();

/*******************PHP*********************/

/*******************SearchWithAjaxJs*********************/

https://wms.ovelo.fr/db.php?username=wms_ovelo&db=wms_ovelo&select=ps_customerDetails&columns%5B0%5D%5Bfun%5D=&columns%5B0%5D%5Bcol%5D=cd_id&columns%5B1%5D%5Bfun%5D=&columns%5B1%5D%5Bcol%5D=order_id&columns%5B2%5D%5Bfun%5D=&columns%5B2%5D%5Bcol%5D=email_customer&columns%5B3%5D%5Bfun%5D=&columns%5B3%5D%5Bcol%5D=presta_id_customer&columns%5B4%5D%5Bfun%5D=&columns%5B4%5D%5Bcol%5D=additional_info&columns%5B5%5D%5Bfun%5D=&columns%5B5%5D%5Bcol%5D=phone_number&columns%5B51%5D%5Bfun%5D=&columns%5B51%5D%5Bcol%5D=mobile_number&columns%5B511%5D%5Bfun%5D=&columns%5B511%5D%5Bcol%5D=&where%5B0%5D%5Bcol%5D=order_id&where%5B0%5D%5Bop%5D=%3D&where%5B0%5D%5Bval%5D=0&where%5B2%5D%5Bcol%5D=&where%5B2%5D%5Bop%5D=%3D&where%5B2%5D%5Bval%5D=&order%5B0%5D=&limit=50&text_length=100

 /******************moveeet cat.//multipal images add and remove class in click base*****************/

  $(".catenm_box").on("click",function(){

jQuery("#testDiv2 li .catenm_box").removeClass("active"); 

jQuery(this).addClass("active"); 

})

/******************same click to add and remove class*****************/

use in toggle

$(".catenm_box").on("click",function(){

jQuery(this).toggle("active"); 

})

/******************same click to add and remove class*****************/

/******************postman mooveit*****************/

https://hifivemooveat.postman.co/workspace/Hifive-api~988817bf-28d9-4854-8eb8-9ca3be0bfaa6/request/7864748-16a7f928-5b65-4226-8c89-160c204ec99f

/******************postman mooveit*****************/

/******************interface php*****************/

Unrelated classes can implement the same methods using an interface, regardless of their place in the class inheritance hierarchy

/******************interface php*****************/


/******************Turnnery operator*****************/

Ternary operators can be defined as a conditional operator that is reasonable for cutting the lines of codes in your program while accomplishing comparisons as well as conditionals..

Ternary operators mai condition pass hoti hai.

/******************Turnnery operator*****************/


/******************php token Gernator*****************/

$token = openssl_random_pseudo_bytes(8);

$token = bin2hex($token);

echo $token;

/******************php token Gernator****************/

/******************mooveit admin login****************/

https://mooveit.it/administrator/login/

/******************mooveit admin login****************/

/******************mooveit restaurent login****************/

https://mooveit.it/restaurant/login/

loves@gmail.com

love10!!

/******************mooveit admin login****************/

/******************evenzia admin login****************/

https://www.evenzia-demo.com/

/******************evenzia admin login****************/

/******************start jab redio button mai same class or value aari ho or pele se bna redio buuton mai change pe data show and hide karana ho****************/

jQuery('#ee-spco-attendee_information-reg-step-form:first-child .spco-attendee-panel-dv input:radio').change(function(){

var value=jQuery(this).val();

if(value=="No I am paying for someone else")

{

firstNamed.val('');

lastNamed.val('');

emailld.val('');

selectedVald.val('');

}

else{

firstNamed.val(arr['firstName']);

lastNamed.val(arr['lastName']);

emailld.val(arr['email']);

selectedVald.val(arr['selectedVal']);

}

}).eq(0).click();

/******************end****************/

/******************scrollTop****************/

//scrolltop use page scroll set 

<script>

$( "div.demo" ).scrollTop( 300 );

</script>

/******************scrollTop****************/

/******************Mooveit api token****************/

b4a919ae1d57b01c8dfbaecc38a9e880962317d0fe5c70a6769fabe6517561ddf6c39d5206699d33a7609ca78da6b521cb2ab2c9c0957d71904b0734d783b89dGbhBEmopBoQzBTfIulnrBvvPCkH2vZZu

/******************Mooveit api token****************/


14 december 2022

https://www.advancedcustomfields.com/resources/flexible-content/


node.js mai api ka data get karna 

1)npm install --save metaapi.cloud-sdk  command in cmd

2)node api file ka name.


/* if($_GET['yadd'] ==5){

echo '<pre>';

print_r($term_list);

echo '</pre>';

die;

} */

/*   */ 

https://wordpress.org/plugins/advanced-custom-fields-table-field/



https://wordpress.org/plugins/wp-social/

https://wordpress.org/plugins/oa-social-login/


https://www.sitepoint.com/using-wp-list-table-to-create-wordpress-admin-tables/

text to speech plugin SiteSpeaker TTS Plugin 


custom code post courses and  currency couses only inctructor showing own posts


https://stackoverflow.com/questions/73692525/wordpress-admin-can-see-all-posts-but-editor-user-can-see-only-their-added-pos




add colum in admin dashboard

//php code//

add_filter('manage_edit-courses_columns', 'my_columns');

function my_columns($columns) {

    $columns['CourseCategory'] = 'CourseCategory';

    return $columns;

}


// Add the data to the custom columns for the book post type:

    add_action( 'manage_courses_posts_custom_column' , 'custom_course_column', 5, 8484);

    function custom_course_column( $column, $post_id ) {

global $post;

        switch ( $column ) {


            case 'CourseCategory' :

$yes_no= get_post_meta($post->ID, 'course_display', true);

if($yes_no=="1")

{

$selected_yes="checked=checked";

}

elseif($yes_no=="0")

{

  $selected_no="checked=checked";

}

else{

$selected_yes="";

$selected_no="";

}

 

                echo '<input type="radio" '.$selected_yes.' name="radiobttn_'.$post_id.'" value="1" class="mark-as-read-yes" data-postid="'.$post->ID.'" />Yes <input type="radio" '.$selected_no.' name="radiobttn_'.$post_id.'" class="mark-as-read-no" value="0"  data-postid="'.$post->ID.'" />No ';


            case 'publisher' :

                echo get_post_meta( $post_id , 'CourseCategory' , true ); 

                break;


        }

    }

/* Add Column in Course Category Listing Start */


function manage_my_courses_category_columns($columns)

{

 // add 'My Column'

 $columns['category_display'] = 'Category Display';


 return $columns;

}

add_filter('manage_edit-courses_categories_columns','manage_my_courses_category_columns');


function add_courses_categories_column_content( $content, $column_name, $term_id ) {

    $term= get_term( $term_id, 'courses_categories' );

    switch ( $column_name ) {

        case 'category_display':

$term_display = get_term_meta( $term_id, 'category_display', true);

if($term_display=="1")

{

$yes="checked=checked";

}

elseif($term_display=="0")

{

  $no="checked=checked";

}else{

$yes="";

$no="";

}

            // Do your stuff here with $term or $term_id

            echo '<input type="radio" name="radiobttn_'.$term_id.'" value="1" class="category-mark-display-yes" data-term-id="'.$term_id.'" '.$yes.' />Yes <input type="radio" name="radiobttn_'.$term_id.'" class="category-mark-display-no" value="0"  data-term-id="'.$term_id.'" '.$no.' />No ';

        default:

            break;

    }


    return $content;

}


add_filter( 'manage_courses_categories_custom_column', 'add_courses_categories_column_content', 10, 3 );




/* Add Column in Course Category Listing End */

// register the ajax action for authenticated users

add_action('wp_ajax_mark_message_as_read', 'mark_message_as_read');

add_action('wp_ajax_nopriv_mark_message_as_read', 'mark_message_as_read');


// handle the ajax request

function mark_message_as_read() {

global $wpdb;

if(isset($_REQUEST['metavalue']) && $_REQUEST['metavalue']==1)

{

$all_terms=get_the_terms($_REQUEST['postid'], 'courses_categories');

foreach($all_terms as $term){

update_term_meta( $term->term_id, 'category_display',$_REQUEST['metavalue'] );

}

update_post_meta( $_REQUEST['postid'], 'course_display', $_REQUEST['metavalue'] );

}

else{

$all_terms=get_the_terms($_REQUEST['postid'], 'courses_categories');

update_post_meta( $_REQUEST['postid'], 'course_display', $_REQUEST['metavalue'] );

foreach($all_terms as $key=>$termm){

$argsd = array(

'post_type' => 'courses',

'posts_per_page' => -1,

'tax_query' => array(

array(

'taxonomy' => 'courses_categories',

'field' => 'term_id',

'terms' => $termm->term_id,

)

),

'meta_query'    => array(

                    array(

                        'key'       => 'course_display',

                        'value'     => '1',

                        'compare'   => '=',

                    ),

                ),

);

$courses=new WP_Query($argsd);

/* echo '<pre>';

print_r($courses->posts);

echo '</pre>';

die("hkhjh"); */

if(empty($courses->posts)){

update_term_meta( $termm->term_id, 'category_display',$_REQUEST['metavalue'] );

}

}

}

}

// register the ajax action for authenticated users

add_action('wp_ajax_category_mark_display', 'category_mark_display');

add_action('wp_ajax_nopriv_category_mark_display', 'category_mark_display');


// handle the ajax request

function category_mark_display() {

global $wpdb;

if(isset($_REQUEST['metavalue']) && $_REQUEST['metavalue']==1)

{

update_term_meta( $_REQUEST['termId'], 'category_display', $_REQUEST['metavalue'] );

getrm($_REQUEST['termId'],'courses_categories');

else{

update_term_meta( $_REQUEST['termId'], 'category_display', $_REQUEST['metavalue'] );

}

}


function getrm($termid,$taxo)

{

$child_term = get_term( $termid,$taxo );

$parent_term = get_term( $child_term->parent, $taxo );

if($parent_term->term_id){

getrm($parent_term->term_id,$taxo);

update_term_meta( $parent_term->term_id, 'category_display', 1 );

echo $parent_term->term_id;

}

 //js code//

 jQuery(document).ready(function() {

    jQuery('.term-parent-wrap #parent.postform').select2();

if(jQuery("#courses_categorieschecklist li a").hasClass("icc-expand")){

jQuery("#courses_categorieschecklist li a").removeClass("icc-expand");

jQuery("#courses_categorieschecklist li a").addClass("icc-contract");

jQuery("#courses_categorieschecklist li ul.children").removeAttr("style");

}

   jQuery(".mark-as-read-yes").click(function () {

   var parent_row =jQuery(this).attr("data-postid");

var post_value= jQuery(this).val();

console.log(parent_row);

console.log(post_value);

jQuery.ajax({

type: "POST",

url: "/wp-admin/admin-ajax.php",

data: {

action: "mark_message_as_read",

postid: parent_row,

metavalue: post_value,

},

success: function (output) {

   console.log(output);

   jQuery('.customNoti-main').remove();

   jQuery( '<div class="customNoti-main"><p class="alert alert-success">Course Update Successfully</p></div>' ).insertBefore( "#wpfooter #footer-left" );

   setTimeout(function () {

jQuery('.customNoti-main').remove();

}, 5000);

}

});

});

jQuery(".mark-as-read-no").click(function () {

   var parent_row =jQuery(this).attr("data-postid");

var post_value= jQuery(this).val();

console.log(parent_row);

console.log(post_value);

jQuery.ajax({

type: "POST",

url: "/wp-admin/admin-ajax.php",

data: {

action: "mark_message_as_read",

postid: parent_row,

metavalue: post_value,

},

success: function (output) {

   console.log(output);

   jQuery('.customNoti-main').remove();

   jQuery( '<div class="customNoti-main"><p class="alert alert-success">Course Update Successfully</p></div>' ).insertBefore( "#wpfooter #footer-left" );

   setTimeout(function () {

jQuery('.customNoti-main').remove();

}, 5000);

}

});

});

   jQuery(".category-mark-display-yes").click(function () {

   var parent_row =jQuery(this).attr("data-term-id");

var post_value= jQuery(this).val();

console.log(parent_row);

console.log(post_value);

jQuery.ajax({

type: "POST",

url: "/wp-admin/admin-ajax.php",

data: {

action: "category_mark_display",

termId: parent_row,

metavalue: post_value,

},

success: function (output) {

console.log(output);

jQuery('.customNoti-main').remove();

jQuery( '<div class="customNoti-main"><p class="alert alert-success">Category Update Successfully</p></div>' ).insertBefore( "#wpfooter #footer-left" );

setTimeout(function () {

jQuery('.customNoti-main').remove();

}, 5000);

}

});

});

jQuery(".category-mark-display-no").click(function () {

   var parent_row =jQuery(this).attr("data-term-id");

var post_value= jQuery(this).val();

console.log(parent_row);

console.log(post_value);

jQuery.ajax({

type: "POST",

url: "/wp-admin/admin-ajax.php",

data: {

action: "category_mark_display",

termId: parent_row,

metavalue: post_value,

},

success: function (output) {

   console.log(output);

   jQuery('.customNoti-main').remove();

       jQuery( '<div class="customNoti-main"><p class="alert alert-success">Category Update Successfully</p></div>' ).insertBefore( "#wpfooter #footer-left" );

   setTimeout(function () {

jQuery('.customNoti-main').remove();

}, 5000);

}

});

});

-----end colum in admin-----

https://help.tradestation.com/10_00/eng/tradestationhelp/elanalysis/indicator/algo___simple_algos_winform_indicator_.htm


ReadSpeckor

https://docs.typo3.org/p/readspeaker/readspeaker-services/main/en-us/Configuration/Index.html#configuration

https://admin.readspeaker.com/portal/index.php/system/login

https://wordpress.com/forums/topic/readspeaker/

https://www.readspeaker.com/solutions/text-to-speech-online/readspeaker-textaid/signup/



firefox pdf extenshn

https://winaero.com/enable-loading-userchrome-css-usercontent-css-firefox/



ajax in wordpress

jQuery(document).ready(function() { 

//jQuery(".pills-tab .pcurrencydata").removeClass("active"); 

//jQuery(this).addClass("active"); 

var post_data = jQuery(".pills-tab .pcurrencydata.active").attr("data-type");//active class ke base pe data type get karna

console.log(post_data);

data={'post_data':post_data,'action':'currencyIndicesCourseAjax',}

jQuery.ajax({

type: "POST",

url: "/wp-admin/admin-ajax.php",

data: data,

success:function(data){

data = JSON.parse(data);

//console.log("data");

//console.log(data['html']);

if(data['html'].length > 0){

jQuery("#forex-currency-ajax .customAjaxdata").html(data['html']); 

setTimeout(function () { 

console.log("data['chart_image']");

console.log(data['chart']);

jQuery("#forex-currency-ajax .customAjaxdata .chartImage-main").html(data['chart']);

}, 1000);

if(post_data == "courses")

$(".slider.courselist").slick({

dots: true,

infinite: true,

nav: false,

slidesToShow: 4,

slidesToScroll: 4,

responsive: [

{

  breakpoint: 1200,

  settings: {

slidesToShow: 3

  }

},

{

  breakpoint: 991,

  settings: {

slidesToShow: 2

  }

},

{

  breakpoint: 650,

  settings: {

slidesToShow: 1,

slidesToScroll: 1,

arrows: true,

dots: false,

  }

},

{

  breakpoint: 480,

  settings: {

slidesToShow: 1,

slidesToScroll: 1,

arrows: true,

centerMode: true,

dots: false,

centerPadding: '15%',

      }

    }

  ]

  }); 

}

}

});

});


//28-01-2023

profile address new field create


public-profile.php  =  /public_html/wp-content/plugins/tutor/templates

my-profile.php      =  /public_html/wp-content/plugins/tutor/templates/dashboard

dashboard.php       =  /public_html/wp-content/plugins/tutor/templates/dashboard

registration.php    =  /public_html/wp-content/plugins/tutor/templates/dashboard

profile.php         =  /public_html/wp-content/plugins/tutor/templates/dashboard/settings

users-profile-field.php = /public_html/wp-content/plugins/tutor/views/metabox/user-profile-fields.php

new create address.php  = /public_html/wp-content/plugins/tutor/templates/profile

function.php create new address hook



https://docs.google.com/spreadsheets/d/1t74Kt4QWfcDDX5Ko0gnFIfh5perUJMe9vXtoURPtZ10/edit#gid=0

Comments

Popular posts from this blog

condition in table data for html

React.js Notes