wordpress

Remove field from checkout page in woocommerce wordpress

/** Remove all possible fields **/ function wc_remove_checkout_fields( $fields ) { // Billing fields unset( $fields[‘billing’][‘billing_company’] ); unset( $fields[‘billing’][‘billing_email’] ); unset( $fields[‘billing’][‘billing_phone’] ); unset( $fields[‘billing’][‘billing_state’] ); unset( $fields[‘billing’][‘billing_first_name’] ); unset( $fields[‘billing’][‘billing_last_name’] ); unset( $fields[‘billing’][‘billing_address_1’] ); unset( $fields[‘billing’][‘billing_address_2’] ); unset( $fields[‘billing’][‘billing_city’] ); unset( $fields[‘billing’][‘billing_postcode’] ); // Shipping fields unset( $fields[‘shipping’][‘shipping_company’] ); unset( $fields[‘shipping’][‘shipping_phone’] ); unset( $fields[‘shipping’][‘shipping_state’] …

Remove field from checkout page in woocommerce wordpress Read More »

Update particular key and its value in wp_option table in wordpress

//first get all the value by get option   $saved_lisc_data = get_option( ‘lisc_settings’); //then put the update the key and its value $saved_lisc_data[‘lisc_match_status’] = ‘complete’; //then update the option update_option( ‘lisc_settings’ , $saved_lisc_data); //for multiple value update $lisc_updated_data = get_option( ‘lisc_settings’); $lisc_updated_data[‘lisc_enable_status’] = $lisc_enable_status; $lisc_updated_data[‘lisc_api_url’] = $_POST[‘lisc_api_url’]; $lisc_updated_data[‘lisc_interval’] = $_POST[‘lisc_interval’]; $lisc_updated_data[‘lisc_total_timing’] = $_POST[‘lisc_total_timing’]; update_option( ‘lisc_settings’ , …

Update particular key and its value in wp_option table in wordpress Read More »

use wp_ajax in wordpress

  Wp Ajax – WordPress Hook to Handle Ajax Request wp_ajax is not a hook or callback, rather it is just a prefix of hooks or callbacks. Those callbacks  are usually available while making ajax call. When a browser or web-client request with an action query parameter to http://example.com/wp–admin/admin–ajax.php file, a hook becomes available to use. Which use wp_ajax_ as prefix. Brief …

use wp_ajax in wordpress Read More »

add image upload section to wordpress theme customizer

  function dev365_default_banner( $wp_customize ){ $wp_customize->add_section( ‘generate_layout_banner’, array( ‘title’ => __( ‘Default Banner’, ‘generatepress’ ), ‘priority’ => 70, ‘panel’ => ‘generate_layout_panel’, ) ); $wp_customize->add_setting( ‘generate_default_banner’); $wp_customize->add_control( new WP_Customize_Image_Control( $wp_customize, ‘generate_default_banner’, array( ‘label’ => __( ‘Default Banner’, ‘generatepress’ ), ‘section’ => ‘generate_layout_banner’, ‘settings’ => ‘generate_default_banner’, ) ) ); } add_action( ‘customize_register’, ‘dev365_default_banner’); add_action(‘generate_after_navigation’, ‘testdata’); function testdata(){ …

add image upload section to wordpress theme customizer Read More »

wordpress image block settings

Remove top and bottom padding from images and cover block .pt-cv-content-item {padding-bottom: 0px;} /*covermedia top and bottom border padding*/.alignfull {margin: 0px 0;} /*coverphoto bottom border*/.pt-cv-ifield > *, .pt-cv-view .pt-cv-content-item > * {margin-bottom: 0px;} for a whole block all images  .kanha .wp-block-image img {    border:2px solid red; } remove border photo caption .wp-caption { border: …

wordpress image block settings Read More »

wordpress use nonce in form

 Use the following code inside just before tag on your front end code. wp_nonce_field(‘name_of_your_action’, ‘name_of_your_nonce_field’); The above code will generate two hidden inputs inside your form tag. Now you can verify your nonce in the backend where you will process your form. Use the following code to verify the nonce you just created above. if(wp_verify_nonce($_REQUEST[‘name_of_your_nonce_field’], …

wordpress use nonce in form Read More »

wp list table 2

 <div id=“wpbody” role=“main”> <div id=“wpbody-content”> <div class=“wrap”> <h1 class=“wp-heading-inline”> Table Title</h1> <a href=“#” class=“page-title-action”>Add Subscriber</a> <hr class=“wp-header-end”> <h2 class=“screen-reader-text”>Filter posts list</h2> <ul class=“subsubsub”> <li class=“all”><a href=“edit.php?post_type=post” class=“current” aria-current=“page”>Total Subscriber <span class=“count”>(46)</span></a></li> <!– <li class=”publish”><a href=”edit.php?post_status=publish&amp;post_type=post”>Published <span class=”count”>(42)</span></a> |</li> –> </ul> <form id=“posts-filter” method=“get”> <p class=“search-box”> <label class=“screen-reader-text” for=“post-search-input”>Search Posts:</label> <input type=“search” id=“post-search-input” name=“s” value=“”> <input …

wp list table 2 Read More »